From 345737d0fe0339831e79cadad9df47f1b398fea0 Mon Sep 17 00:00:00 2001 From: chengduoZH Date: Tue, 8 May 2018 13:37:31 +0800 Subject: [PATCH] add sync --- paddle/fluid/platform/cuda_device_function.h | 1 + 1 file changed, 1 insertion(+) diff --git a/paddle/fluid/platform/cuda_device_function.h b/paddle/fluid/platform/cuda_device_function.h index e81c385727b..ecec4178f2d 100644 --- a/paddle/fluid/platform/cuda_device_function.h +++ b/paddle/fluid/platform/cuda_device_function.h @@ -63,6 +63,7 @@ __device__ T reduceSum(T val, int tid, int len) { val += platform::CudaShuffleDownSync(mask, val, offset); if (tid < warpSize) shm[tid] = 0; + __syncthreads(); if (tid % warpSize == 0) { shm[tid / warpSize] = val; -- GitLab