Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cpp/src/distance/detail/kernels/kernel_matrices.cu
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RAFT_KERNEL polynomial_kernel_nopad(
{
for (size_t tid = threadIdx.x + blockIdx.x * blockDim.x; tid < len;
tid += blockDim.x * gridDim.x) {
inout[tid] = pow(gain * inout[tid] + offset, exponent);
inout[tid] = pow(gain * inout[tid] + offset, (math_t)exponent);
}
}

Expand All @@ -51,7 +51,7 @@ RAFT_KERNEL polynomial_kernel(
tidy += blockDim.y * gridDim.y)
for (size_t tidx = threadIdx.x + blockIdx.x * blockDim.x; tidx < rows;
tidx += blockDim.x * gridDim.x) {
inout[tidx + tidy * ld] = pow(gain * inout[tidx + tidy * ld] + offset, exponent);
inout[tidx + tidy * ld] = pow(gain * inout[tidx + tidy * ld] + offset, (math_t)exponent);
}
}

Expand Down Expand Up @@ -118,7 +118,7 @@ RAFT_KERNEL rbf_kernel_expanded(
for (size_t tidx = threadIdx.x + blockIdx.x * blockDim.x; tidx < rows;
tidx += blockDim.x * gridDim.x) {
inout[tidx + tidy * ld] =
exp(-1.0 * gain * (norm_x[tidx] + norm_y_val - inout[tidx + tidy * ld] * 2));
exp(-gain * (norm_x[tidx] + norm_y_val - inout[tidx + tidy * ld] * 2));
}
}
}
Expand Down
Loading