Added syncthreads in reduction.