From 1f43415e2996900885de6b5f9e4d60f22d4d64f6 Mon Sep 17 00:00:00 2001 From: Fan Yang Date: Fri, 26 Aug 2016 17:12:14 +0800 Subject: [PATCH] fixed build issue when CUDA version > 6.0 --- include/caffe/common.cuh | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 include/caffe/common.cuh diff --git a/include/caffe/common.cuh b/include/caffe/common.cuh old mode 100644 new mode 100755 index 63e7399..8eeb9e8 --- a/include/caffe/common.cuh +++ b/include/caffe/common.cuh @@ -6,6 +6,7 @@ #include // CUDA: atomicAdd is not defined for doubles +#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 600 static __inline__ __device__ double atomicAdd(double *address, double val) { unsigned long long int* address_as_ull = (unsigned long long int*)address; unsigned long long int old = *address_as_ull, assumed; @@ -17,5 +18,6 @@ static __inline__ __device__ double atomicAdd(double *address, double val) { } while (assumed != old); return __longlong_as_double(old); } +#endif #endif