Cuda and C++ AMP double precision
-
Tuesday, March 27, 2012 4:46 PM
Dear all
I have a question regarding double precision in C++ AMP. I have an NVIDIA GTS 450, and two version of the same program, one in CUDA and the other one in C++ AMP. The C++ AMP version, in the case I use double precision just crash, with float it is working. This is reasonable because the video card should not support the double precision.
The CUDA version is working with double,without problems. I compile using what they suggest here http://www.herikstad.net/2009/05/cuda-and-double-precision-floating.html in order to have support of double-precision floating-point math.
Moreover reading this http://techreport.com/articles.x/19619 it seems that my videocard can process double-precision floating-point math, and with CUDA does.
Why is not possible with C++ AMP?
Thanks a lot for your help
Stefano
All Replies
-
Wednesday, March 28, 2012 2:37 AMOwner
Hi Stefano
For C++ AMP, first please read this blog post about double precision:
http://blogs.msdn.com/b/nativeconcurrency/archive/2012/02/07/double-precision-support-in-c-amp.aspxWhen you say "crash", does that mean an unhandled exception? Do you have the exception details? Are you trying this with the latest DirectX 11 driver from your hardware vendor? Also what OS are you using?
Cheers
Danielhttp://www.danielmoth.com/Blog/
-
Wednesday, March 28, 2012 7:16 AM
Hi Daniel
thanks a lot for your response. Those are my answers
- When you say "crash", does that mean an unhandled exception?runtime_exception;http://blogs.msdn.com/b/nativeconcurrency/archive/2012/02/09/runtime-exception-of-c-amp.aspx
2. Do you have the exception details?
"Concurrency::parallel_for_each uses features (full double_precision)
unsupported by the selected accelerator."
3. Are you trying this with the latest DirectX 11 driver from your
hardware vendor?
I'm using the latest drivers from the official source at
http://www.geforce.com/drivers
How can I make sure that my system has a WDDM 1.2 driver?
4. Also what OS are you using?
Windows Server 2008 R2 (NT version 6.1)
More details:
In addition to the above-mentioned exception, GTS 450 is not listed as
supporting double precision:
http://www.danielmoth.com/Blog/What-DX-Level-Does-My-Graphics-Card-Support-Does-It-Go-To-11.aspx
However, double-precision floating-point operations are supported for
CUDA compute capability 2.x, with GTS 450 having CUDA compute capability
2.1 (DirectX 11 is also listed in "Supported Technologies"):
http://www.geforce.com/hardware/desktop-gpus/geforce-gts-450/specifications
More precisely, it claims "DirectX 11 GPU with Shader Model 5.0 support":
http://www.geforce.com/hardware/desktop-gpus/geforce-gts-450/features
I've noticed a similar issue being discussed here before:
http://social.msdn.microsoft.com/Forums/en/parallelcppnative/thread/a823d853-d684-4657-8b68-32de26a6fb05
And yet, in accordance with GTS 450 having CUDA compute capability 2.1
I'm able to successfully use double-precision computations in my CUDA
programs, including but not limited to transcendental functions like the
exponential function or the logarithm.
However, an attempt to similarly use exp or log from the
concurrency::precise_math namespace fails.
Cheers
Stefano
- When you say "crash", does that mean an unhandled exception?runtime_exception;http://blogs.msdn.com/b/nativeconcurrency/archive/2012/02/09/runtime-exception-of-c-amp.aspx
-
Wednesday, March 28, 2012 6:31 PMOwner
Hi Stefano
You mentioned precise_math namespace, so please make sure you have read our blog post on the math library: http://blogs.msdn.com/b/nativeconcurrency/archive/2012/02/08/math-library-for-c-amp.aspx
I am sorry that the double precision situation is still not clear to you; I know it is not as straightforward as I would like it to be, at this moment in time.
Based on what you wrote, I suspect that you have a WDDM 1.1 driver and that your card supports_limited_double_precision. Can you please confirm that the property returns true? Again, the way to do that, and the double precision situation for C++ AMP (please note that CUDA is totally irrelevant within this context so none of those links or documentation will help), is described here: http://blogs.msdn.com/b/nativeconcurrency/archive/2012/02/07/double-precision-support-in-c-amp.aspx
If you can confirm that it supports limited double precision, then all you need is a WDDM 1.2 driver, and you will be able to get full double precision. The only issue, at this moment in time during the Beta period, is that you need to run your tests on Windows 8 (or Windows Server 8). I expect the hardware vendors to have WDDM 1.2 drivers for Windows 7 (and Windows Server 2008 R2) before C++ AMP ships.
Please feel free to post follow up questions if you have them, we are always happy to help.
Cheers
Daniel
http://www.danielmoth.com/Blog/
- Proposed As Answer by Zhu, Weirong Wednesday, March 28, 2012 7:24 PM
- Marked As Answer by DanielMothMicrosoft Employee, Owner Friday, April 06, 2012 7:27 AM
-
Friday, March 30, 2012 1:05 PM
Hi Daniel
thanks a lot for the suggestions. I will try to install windows 8 or wait for a driver update
Cheers
Stefano

