From c324484946815e761e2c522b9a679ffbe82a33fd Mon Sep 17 00:00:00 2001 From: "Corey J. Nolet" Date: Thu, 24 Jun 2021 17:47:15 -0400 Subject: [PATCH 1/2] Const raft handle in sparse bfknn --- cpp/include/raft/sparse/selection/knn.cuh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/include/raft/sparse/selection/knn.cuh b/cpp/include/raft/sparse/selection/knn.cuh index 47df50bbe5..c27af0fb0e 100644 --- a/cpp/include/raft/sparse/selection/knn.cuh +++ b/cpp/include/raft/sparse/selection/knn.cuh @@ -120,7 +120,7 @@ class sparse_knn_t { const value_idx *queryIndices_, const value_t *queryData_, size_t queryNNZ_, int n_query_rows_, int n_query_cols_, value_idx *output_indices_, value_t *output_dists_, int k_, - raft::handle_t &handle_, + const raft::handle_t &handle_, size_t batch_size_index_ = 2 << 14, // approx 1M size_t batch_size_query_ = 2 << 14, raft::distance::DistanceType metric_ = @@ -429,7 +429,7 @@ void brute_force_knn(const value_idx *idxIndptr, const value_idx *idxIndices, const value_idx *queryIndices, const value_t *queryData, size_t queryNNZ, int n_query_rows, int n_query_cols, value_idx *output_indices, value_t *output_dists, int k, - raft::handle_t &handle, + const raft::handle_t &handle, size_t batch_size_index = 2 << 14, // approx 1M size_t batch_size_query = 2 << 14, raft::distance::DistanceType metric = From fc185e591926300d1a91d666b0bdb017e6ee7e5b Mon Sep 17 00:00:00 2001 From: "Corey J. Nolet" Date: Thu, 24 Jun 2021 18:03:38 -0400 Subject: [PATCH 2/2] Additional consts needed --- cpp/include/raft/sparse/distance/common.h | 4 ++-- cpp/include/raft/sparse/selection/knn.cuh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/include/raft/sparse/distance/common.h b/cpp/include/raft/sparse/distance/common.h index 36982c36ff..1c55412eec 100644 --- a/cpp/include/raft/sparse/distance/common.h +++ b/cpp/include/raft/sparse/distance/common.h @@ -24,7 +24,7 @@ namespace distance { template struct distances_config_t { - distances_config_t(raft::handle_t &handle_) : handle(handle_) {} + distances_config_t(const raft::handle_t &handle_) : handle(handle_) {} // left side value_idx a_nrows; @@ -42,7 +42,7 @@ struct distances_config_t { value_idx *b_indices; value_t *b_data; - raft::handle_t &handle; + const raft::handle_t &handle; }; template diff --git a/cpp/include/raft/sparse/selection/knn.cuh b/cpp/include/raft/sparse/selection/knn.cuh index 47df50bbe5..f0eb23320b 100644 --- a/cpp/include/raft/sparse/selection/knn.cuh +++ b/cpp/include/raft/sparse/selection/knn.cuh @@ -394,7 +394,7 @@ class sparse_knn_t { int n_idx_rows, n_idx_cols, n_query_rows, n_query_cols, k; - raft::handle_t &handle; + const raft::handle_t &handle; }; /**