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..71fbb8ab3d 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_ = @@ -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; }; /** @@ -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 =