Tuesday, May 5, 2009

CUDA and double precision floating point numbers

If you are in any way using CUDA to computations involving doubles, you need to perform a few adjustments to have it work. By default CUDA has double support disabled, this entails that all doubles are silently converted into floats inside kernels and any double precision calculations computed are incorrect.

To enable the use of doubles inside CUDA kernels you first need to make sure you have a CUDA Compute 1.3-capable card. These are the newer versions of the nVidia CUDA cards such as the GTX 260, GTX 280, Quadro FX 5800, and Tesla S1070 and C1060.
Thereby you have to add a command line options to the nvcc compiler: --gpu-architecture sm_13 .

Note: you can use sm_11 and sm_12 to enable functionality added in CUDA 1.1 and CUDA 1.2 respectively.

Source: https://www.cs.virginia.edu/~csadmin/wiki/index.php/CUDA_Support/Enabling_double-precision and http://forums.nvidia.com/index.php?showtopic=84999&pid=481809&mode=threaded&start=#entry481809

No comments:

Post a Comment