Skip to content

Commit f603edf

Browse files
committed
Add sync(), move sync() up a line.
1 parent d0edb05 commit f603edf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/popsift/common/excl_blk_prefix_sum.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class Block
7373
if( threadIdx.x == 0 && threadIdx.y == 0 ) {
7474
loop_total = 0;
7575
}
76+
__syncthreads();
7677

7778
const int start = threadIdx.y * blockDim.x + threadIdx.x;
7879
const int wrap = blockDim.x * blockDim.y;
@@ -131,9 +132,8 @@ class Block
131132
*/
132133
_mapping_writer.set( ebs, self, cell );
133134
}
134-
135-
// Wait to update loop_total until everyone is done.
136135
__syncthreads();
136+
137137
if( threadIdx.y == 0 && threadIdx.x == 31 ) {
138138
loop_total += ibs;
139139
}

0 commit comments

Comments
 (0)