support double precision in cuda

Hi all,
I am totally new in cuda.
I have a program for solving linear equations written in cuda c (compiling and running in visual studio in windows).
It works fine with float variables
supposing my GPU compute capability is higher than 1.3 , what should I do to make this program work with Double variables ?


compile with -arch=compute_20,code=sm_20 --> to support double precision

and rewrite your code with double precision variable.

A Best practice should be to make your cuda methods templated in order to generate the good version at compile time and avoid copy/paste errors.

Thanks X3LiF
I compile the program by hitting F7 in visual studio in windows 8.
now, how to compile it with -arch=compute_20,code=sm_20 options???
where should I feed the options?

In Visual Studio, select “Project” -> “Properties”.

In “Configuration Properties”, select “CUDA C/C++” and then select “Device”.

“Code Generation” is the value you want to change.

that’s it!
thanks fmwyso

I rewrote the code with double precision and compiled it wiith -arch=compute_20,code=sm_20 .
but nothing changed. and it’s outputs are single precision.
is there anything to do?

What do you mean the output is single? Are you printing enough significant digits?
use %22.16 lf

thanks pasoleatis

Please keep in mind that you can print 100 digits if you want ( just change 22.16 with other numbers). What you need to do is to do a specific operation (like a+b) in CUDA and then check up to the significant digits that the results are same.

Hi all
Finally i could run the program with your help.
the program solves linear equation systems in double precision with Gaussian elimination method
but it works only for systems with a few equations (unknowns).
whenever the number of unknowns increases it outputs NAN… :(
my system has more than 1000 unknowns!
i guess Suspectedly it is because size of thread blocks which is 16*16…
the program code that i use is in
at CUDA Implementation section
it is kind of you, if take a look at the code and guide me what to do , to get the program solve the systems of 1000 or more unknowns

thanx alot

does any one have cuda c or c++ code for solving linear equations with double precision?
which can solve large systems?

any help is appreciated

Have you looked at cuBLAS and the samples in the CUDA SDK ?

Also there is the MAGMA library for linux and CULA.