Double precision floating point support


I try to use the double function for atomicAdd

__device__ double GPUInfo::atomicAddDouble(double* address, double val)


double old = *address, assumed;

do {

assumed = old;

old =


atomicCAS((unsigned long long int*)address,


__double_as_longlong(val + assumed)));

} while (assumed != old);

return old;


The argument

-gencode arch=compute_13,code=sm_13

has been added in the flag field of NVCC compiler.

But, I got this error:

Description Resource Path Location Type

identifier “__double_as_longlong” is undefined /MatchedFilter/Source line 31 C/C++ Problem

identifier “__longlong_as_double” is undefined /MatchedFilter/Source line 29 C/C++ Problem

no instance of overloaded function “atomicCAS” matches the argument list /MatchedFilter/Source line 30 C/C++ Problem

make: *** [Source/cu_GPUInformation.o] Error 2 MatchedFilter line 0 C/C++ Problem

I use eclipse with nvcc 3.2 on Ubuntu 10.10.

Try [font=“Courier New”]-arch=compute_13[/font].

I guess you have another [font=“Courier New”]-gencode[/font] option for a lower compute capability there as well. In that case the code gets compiled for all architectures given, which fails for compute capabilities up to 1.2.

Thank, it was my problem!