Error: function "atomicAdd (double *, double)" is already defined

I get this error when trying to compile the caffe DeepLab_v2 derivative on Ubuntu 14.04.5 with Cuda 8.0.

Does anyone know how to solve this?

DeepLab_v2 compiles fine on another computer with Cuda 7.5, but since I have Pascal Titan X on my current computer, I probably need to use Cuda 8.0.

+7
caffe cuda
source share
1 answer

I finally got his job using the comment by @Robert Crovella. I had to modify the common.cuh file from the DeepLab_v2 wizard branch as follows:

 #ifndef CAFFE_COMMON_CUH_ #define CAFFE_COMMON_CUH_ #include <cuda.h> #if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 600 #else 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; if (val==0.0) return __longlong_as_double(old); do { assumed = old; old = atomicCAS(address_as_ull, assumed, __double_as_longlong(val +__longlong_as_double(assumed))); } while (assumed != old); return __longlong_as_double(old); } #endif #endif 
+25
source share

All Articles