Skip to content

Commit d01b67f

Browse files
committed
fix: sync cuda stream before using related variable
1 parent ad9c478 commit d01b67f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/cuco/detail/dynamic_map.inl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ void dynamic_map<Key, Value, Scope, Allocator>::insert(
175175
sizeof(atomic_ctr_type),
176176
cudaMemcpyDeviceToHost,
177177
stream));
178+
CUCO_CUDA_TRY(cudaStreamSynchronize(stream));
178179
submaps_[submap_idx]->size_ += h_num_successes;
179180
size_ += h_num_successes;
180181
first += n;
@@ -223,6 +224,7 @@ void dynamic_map<Key, Value, Scope, Allocator>::erase(
223224
sizeof(atomic_ctr_type),
224225
cudaMemcpyDeviceToHost,
225226
stream));
227+
CUCO_CUDA_TRY(cudaStreamSynchronize(stream));
226228
submaps_[i]->size_ -= h_submap_num_successes;
227229
size_ -= h_submap_num_successes;
228230
}

0 commit comments

Comments
 (0)