Commit 65caf22b authored by Yutong Zhao's avatar Yutong Zhao
Browse files

Fixes a race-condition in compute Range

parent 31d761d5
...@@ -73,6 +73,7 @@ __global__ void computeRange(const DATA_TYPE* __restrict__ data, unsigned int le ...@@ -73,6 +73,7 @@ __global__ void computeRange(const DATA_TYPE* __restrict__ data, unsigned int le
__syncthreads(); __syncthreads();
} }
minimum = rangeBuffer[0]; minimum = rangeBuffer[0];
__syncthreads();
rangeBuffer[threadIdx.x] = maximum; rangeBuffer[threadIdx.x] = maximum;
__syncthreads(); __syncthreads();
for (unsigned int step = 1; step < blockDim.x; step *= 2) { for (unsigned int step = 1; step < blockDim.x; step *= 2) {
......
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