CPU fallback on C++ AMP?
-
Wednesday, July 18, 2012 2:04 PM
Hello all,
I'm looking into using AMP with my .NET class library (P/invoke). Am I correct in my assumption that if something should go wrong with a GPU kernel launch, the AMP method will fall back to the CPU? If so, is there a way to restrict the execution of the AMP kernel only to the GPU and, if at runtime it can't, to fall back to the C# code in my class library? Thanks!
-L
All Replies
-
Wednesday, July 18, 2012 4:18 PMOwner
Hi L
The CPU fallback is for Windows 8 only and it is the WARP accelerator:
http://www.danielmoth.com/Blog/Running-C-AMP-Kernels-On-The-CPU.aspx…do not confuse that with the CPU accelerator which cannot execute code in our v1:
http://blogs.msdn.com/b/nativeconcurrency/archive/2012/03/10/cpu-accelerator-in-c-amp.aspx…or with REF which can execute things really slowly:
http://blogs.msdn.com/b/nativeconcurrency/archive/2012/03/11/direct3d-ref-accelerator-in-c-amp.aspxWARP is an implicit fallback when you don’t specify an accelerator explicitly. You can read more about our current default algorithm here:
http://blogs.msdn.com/b/nativeconcurrency/archive/2012/02/02/default-accelerator-in-c-amp.aspxSo you can either specify an accelerator explicitly or you can check what the default is and decide not to execute the parallel_for_each at all. Both of those approaches would avoid the implicit fallback.
Cheers
Danielhttp://www.danielmoth.com/Blog/
- Proposed As Answer by Zhu, Weirong Wednesday, July 18, 2012 6:02 PM
- Marked As Answer by DanielMothMicrosoft Employee, Owner Monday, July 23, 2012 7:32 PM

