Skip to content

Commit

Permalink
Remove strided subsampling
Browse files Browse the repository at this point in the history
  • Loading branch information
tfeher committed Jan 18, 2024
1 parent 615c9a6 commit 0cb6caf
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions cpp/include/raft/spatial/knn/detail/ann_utils.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -618,17 +618,9 @@ void subsample(raft::resources const& res,
{
IdxT n_dim = output.extent(1);
IdxT n_train = output.extent(0);
if (seed == -1 || n_train == n_samples) {
IdxT trainset_ratio = n_samples / n_train;
RAFT_LOG_INFO("Fixed stride subsampling");
RAFT_CUDA_TRY(cudaMemcpy2DAsync(output.data_handle(),
sizeof(T) * n_dim,
input,
sizeof(T) * n_dim * trainset_ratio,
sizeof(T) * n_dim,
n_train,
cudaMemcpyDefault,
resource::get_cuda_stream(res)));
if (n_train == n_samples) {
RAFT_LOG_INFO("No subsampling");
raft::copy(output.data_handle(), input, n_dim * n_samples, resource::get_cuda_stream(res));
return;
}
RAFT_LOG_DEBUG("Random subsampling");
Expand Down

0 comments on commit 0cb6caf

Please sign in to comment.