Skip to content
Open
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: 4 additions & 0 deletions cpp/src/neighbors/ivf_rabitq/utils/reductions.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ __inline__ __device__ T blockReduceSum(T val)
int wid = threadIdx.x >> 5;

val = warpReduceSum(val);
// Wait until every warp has finished reading shared[] in the previous call
// before this call overwrites it. Doing this after the warp-local reduction
// overlaps the extra synchronization with useful work.
__syncthreads();
if (lane == 0) shared[wid] = val;
__syncthreads();

Expand Down
Loading