From f2aa2747ca0396f6459c0a71425601a13d677fb9 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Thu, 1 Sep 2016 10:50:48 +0800 Subject: [PATCH] fixed build issue of double definition of atomicAdd on modern GPUs --- paddle/cuda/include/hl_device_functions.cuh | 4 ++++ 1 file changed, 4 insertions(+) mode change 100644 => 100755 paddle/cuda/include/hl_device_functions.cuh diff --git a/paddle/cuda/include/hl_device_functions.cuh b/paddle/cuda/include/hl_device_functions.cuh old mode 100644 new mode 100755 index 408ff35d963c6..e7481b90e1a9c --- a/paddle/cuda/include/hl_device_functions.cuh +++ b/paddle/cuda/include/hl_device_functions.cuh @@ -16,6 +16,8 @@ limitations under the License. */ #ifndef HL_DEVICE_FUNCTIONS_CUH_ #define HL_DEVICE_FUNCTIONS_CUH_ +#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 600 + namespace hppl { static __inline__ __device__ double atomicAdd(double* address, double val) { @@ -38,4 +40,6 @@ static __inline__ __device__ double atomicAdd(double* address, double val) { using hppl::atomicAdd; +#endif + #endif /* HL_DEVICE_FUNCTIONS_CUH_ */