Commit 9c1a2669 authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed thread synchronization bug

parent a5e3869f
......@@ -76,8 +76,10 @@ __kernel void computeBucketPositions(int numBuckets, __global int* bucketOffset,
// Perform a parallel prefix sum.
for (int step = 1; step < get_local_size(0); step *= 2) {
int add = buffer[get_local_id(0)-step];
barrier(CLK_LOCAL_MEM_FENCE);
if (get_local_id(0) >= step)
buffer[get_local_id(0)] += buffer[get_local_id(0)-step];
buffer[get_local_id(0)] += add;
barrier(CLK_LOCAL_MEM_FENCE);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment