Skip to content

Commit

Permalink
remove const_cast in anticipation of rapidsai/raft#280
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed Jun 24, 2021
1 parent fd209b7 commit 402da8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cpp/src/metrics/pairwise_distance.cu
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void pairwiseDistance_sparse(const raft::handle_t &handle, value_t *x,
raft::distance::DistanceType metric,
float metric_arg) {
raft::sparse::distance::distances_config_t<value_idx, value_t> dist_config(
const_cast<raft::handle_t &>(handle));
handle);

dist_config.b_nrows = x_nrows;
dist_config.b_ncols = n_cols;
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/tsne/distances.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ void get_distances(const raft::handle_t &handle,
raft::sparse::selection::brute_force_knn(
input.indptr, input.indices, input.data, input.nnz, input.n, input.d,
input.indptr, input.indices, input.data, input.nnz, input.n, input.d,
k_graph.knn_indices, k_graph.knn_dists, k_graph.n_neighbors,
const_cast<raft::handle_t &>(handle), ML::Sparse::DEFAULT_BATCH_SIZE,
ML::Sparse::DEFAULT_BATCH_SIZE, DEFAULT_DISTANCE_METRIC);
k_graph.knn_indices, k_graph.knn_dists, k_graph.n_neighbors, handle,
ML::Sparse::DEFAULT_BATCH_SIZE, ML::Sparse::DEFAULT_BATCH_SIZE,
DEFAULT_DISTANCE_METRIC);
}

// sparse, int64
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/umap/knn_graph/algo.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ void launcher(const raft::handle_t &handle,
raft::sparse::selection::brute_force_knn(
inputsA.indptr, inputsA.indices, inputsA.data, inputsA.nnz, inputsA.n,
inputsA.d, inputsB.indptr, inputsB.indices, inputsB.data, inputsB.nnz,
inputsB.n, inputsB.d, out.knn_indices, out.knn_dists, n_neighbors,
const_cast<raft::handle_t &>(handle), ML::Sparse::DEFAULT_BATCH_SIZE,
ML::Sparse::DEFAULT_BATCH_SIZE, raft::distance::DistanceType::L2Expanded);
inputsB.n, inputsB.d, out.knn_indices, out.knn_dists, n_neighbors, handle,
ML::Sparse::DEFAULT_BATCH_SIZE, ML::Sparse::DEFAULT_BATCH_SIZE,
raft::distance::DistanceType::L2Expanded);
}

template <>
Expand Down

0 comments on commit 402da8e

Please sign in to comment.