Skip to content

Commit 006e77c

Browse files
committed
add some stream syncs in nn_descent
1 parent 6f86848 commit 006e77c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cpp/src/neighbors/detail/nn_descent.cuh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,7 @@ void GNND<Data_t, Index_t>::add_reverse_edges(Index_t* graph_ptr,
11841184
graph_ptr, d_rev_graph_ptr, NUM_SAMPLES, list_sizes);
11851185
raft::copy(
11861186
h_rev_graph_ptr, d_rev_graph_ptr, nrow_ * NUM_SAMPLES, raft::resource::get_cuda_stream(res));
1187+
raft::resource::sync_stream(res);
11871188
}
11881189

11891190
template <typename Data_t, typename Index_t>
@@ -1320,11 +1321,11 @@ void GNND<Data_t, Index_t>::build(Data_t* data, const Index_t nrow, Index_t* out
13201321
graph_buffer_.data_handle(),
13211322
nrow_ * DEGREE_ON_DEVICE,
13221323
raft::resource::get_cuda_stream(res));
1323-
raft::resource::sync_stream(res);
13241324
raft::copy(thrust::raw_pointer_cast(dists_host_buffer_.data()),
13251325
dists_buffer_.data_handle(),
13261326
nrow_ * DEGREE_ON_DEVICE,
13271327
raft::resource::get_cuda_stream(res));
1328+
raft::resource::sync_stream(res);
13281329
13291330
graph_.sample_graph_new(thrust::raw_pointer_cast(graph_host_buffer_.data()), DEGREE_ON_DEVICE);
13301331
}

0 commit comments

Comments
 (0)