Caught exception: Concurrency::parallel_for_each not supported on the selected accelerator "CPU accelerator". RRS feed

  • Question

  • Hi All,

    I was trying to run a parallel_for_each on a CPU accelerator, but I ended up with an exception saying it's not supported for my CPU (Intel Q6600 quad-core, SSE3, Windows 7 64-bit, DirectX11). (C++ AMP code works great on both an Geforce GTX 470 and an HD 6450 cards plugged into my PC.)  According to Daniel Moth's blog,, if DirectX11 is not installed, it should go to a CPU emulation fallback, which sort of implies that parallel_for_each should just work on a CPU accelerator in some capacity.

    I'm wondering, what sort of hardware and software minimum requirements for CPU accelerators to work?


    P.S. C++ AMP definitely rocks.  Much better than the stone knives and bearskins of CUDA and OpenCL.

    Tuesday, September 27, 2011 10:07 PM


  • Hi Ken,

    You can't actually run a parallel_for_each on the CPU accelerator (which, to be specific, is the one you get when you construct an accelerator using "accelerator::accelerator(accelerator::cpu_accelerator)", a call which was brought to you by the department of redundancy department).

    What Moth meant is that you can run it on a DirectX 11 device that uses the CPU.  You have two choices for that, WARP and REF.  To use WARP, you need Windows 8.  You can then specify the target accelerator like this:

         accelerator device(accelerator::direct3d_warp);

         array<int,1> myArray(..., device.default_view);

         parallel_for_each(myArray.grid, [&myArray] (index<1> idx) restrict(directed) { ... });

    Your code will then run on your CPU using SSE and multiple threads to achieve parallelism.  Note once again that you need Windows 8 for this.  Normally C++ AMP would fall back to this automatically, but if you're using Windows 7, it currently doesn't have that fall-back.

    You can also use REF, but that will be very slow since it's only meant for verification and debugging.  You can changet the above example to use REF by replacing "accelerator::direct3d_warp" with "accelerator::direct3d_ref"). 

    I hope that helps.

    P.S. I'm glad you're liking C++ AMP.  My inner Mr. Spock is pleased with your Star Trek reference.

    Tuesday, September 27, 2011 11:48 PM