From c9dc794e19e448e5d5147eae837e0f2356259f21 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 27e3f450c5..2fbc2cfb50 --- 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) { @@ -40,4 +42,6 @@ static __inline__ __device__ double atomicAdd(double* address, double val) { using hppl::atomicAdd; #endif +#endif + #endif /* HL_DEVICE_FUNCTIONS_CUH_ */ -- GitLab