Skip to content

Commit

Permalink
Const raft handle in sparse bfknn (#280)
Browse files Browse the repository at this point in the history
Authors:
  - Corey J. Nolet (https://github.com/cjnolet)

Approvers:
  - Dante Gama Dessavre (https://github.com/dantegd)
  - Alex Fender (https://github.com/afender)
  - Paul Taylor (https://github.com/trxcllnt)

URL: #280
  • Loading branch information
cjnolet authored Jun 25, 2021
1 parent 03e666e commit 4f959fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cpp/include/raft/sparse/distance/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace distance {

template <typename value_idx, typename value_t>
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;
Expand All @@ -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 <typename value_t>
Expand Down
6 changes: 3 additions & 3 deletions cpp/include/raft/sparse/selection/knn.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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_ =
Expand Down Expand Up @@ -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;
};

/**
Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit 4f959fc

Please sign in to comment.