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] Const raft handle in sparse bfknn #280

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
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