Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REVIEW] Fixing overflow in expanded distances #365

Merged
Merged
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
2 changes: 1 addition & 1 deletion cpp/include/raft/sparse/distance/detail/bin_distance.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ __global__ void compute_binary_warp_kernel(value_t *__restrict__ C,
const value_t *__restrict__ R_norms,
value_idx n_rows, value_idx n_cols,
expansion_f expansion_func) {
value_idx tid = blockDim.x * blockIdx.x + threadIdx.x;
std::size_t tid = blockDim.x * blockIdx.x + threadIdx.x;
value_idx i = tid / n_cols;
value_idx j = tid % n_cols;

Expand Down
4 changes: 2 additions & 2 deletions cpp/include/raft/sparse/distance/detail/l2_distance.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ __global__ void compute_euclidean_warp_kernel(
value_t *__restrict__ C, const value_t *__restrict__ Q_sq_norms,
const value_t *__restrict__ R_sq_norms, value_idx n_rows, value_idx n_cols,
expansion_f expansion_func) {
value_idx tid = blockDim.x * blockIdx.x + threadIdx.x;
std::size_t tid = blockDim.x * blockIdx.x + threadIdx.x;
value_idx i = tid / n_cols;
value_idx j = tid % n_cols;

Expand All @@ -85,7 +85,7 @@ __global__ void compute_correlation_warp_kernel(
const value_t *__restrict__ R_sq_norms, const value_t *__restrict__ Q_norms,
const value_t *__restrict__ R_norms, value_idx n_rows, value_idx n_cols,
value_idx n) {
value_idx tid = blockDim.x * blockIdx.x + threadIdx.x;
std::size_t tid = blockDim.x * blockIdx.x + threadIdx.x;
value_idx i = tid / n_cols;
value_idx j = tid % n_cols;

Expand Down