Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions cpp/src/distance/detail/kernels/kernel_matrices.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down 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
4 changes: 2 additions & 2 deletions cpp/src/distance/detail/sparse/lp_distance.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -266,7 +266,7 @@ class jensen_shannon_unexpanded_distances_t : public distances_t<value_t> {
raft::linalg::map(
config_->handle,
raft::make_device_vector_view<value_t, int64_t>(out_dists, n),
[=] __device__(value_t input) { return raft::sqrt(0.5 * input); },
[=] __device__(value_t input) { return raft::sqrt(value_t(0.5) * input); },
raft::make_const_mdspan(raft::make_device_vector_view<const value_t, int64_t>(out_dists, n)));
}

Expand Down
Loading