diff --git a/cpp/src/distance/detail/kernels/kernel_matrices.cu b/cpp/src/distance/detail/kernels/kernel_matrices.cu index 9ed25f959c..8b631d795c 100644 --- a/cpp/src/distance/detail/kernels/kernel_matrices.cu +++ b/cpp/src/distance/detail/kernels/kernel_matrices.cu @@ -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 */ @@ -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); } } @@ -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); } } @@ -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)); } } } diff --git a/cpp/src/distance/detail/sparse/lp_distance.cuh b/cpp/src/distance/detail/sparse/lp_distance.cuh index 38025329b9..8533ed83c8 100644 --- a/cpp/src/distance/detail/sparse/lp_distance.cuh +++ b/cpp/src/distance/detail/sparse/lp_distance.cuh @@ -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 */ @@ -266,7 +266,7 @@ class jensen_shannon_unexpanded_distances_t : public distances_t { raft::linalg::map( config_->handle, raft::make_device_vector_view(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(out_dists, n))); }