The problem is a not so obvious missing local barrier needed after the line seed = randomBlock[blockDim -1]; // blockDim=256 At first it looks like the barrier after writing randomBlock[threadIdx] should work because there are no other local memory writes in the loop.