I'm playing around with C++ AMP but for some reason the most dumbed down code won't compile. This:
concurrency::extent<2> e(2,2);
concurrency::parallel_for_each(grid<2>(e), [](index<2> i) restrict(direct3d) {
});
results in the following error:
error C3576: 'wmain::': Concurrency::details::_Parallel_for_each argument #3 has unsupported type c:\program files (x86)\microsoft visual studio 11.0\vc\include\amp.h
It just doesn't appear to like the lambda expression being passed for const _Kernel_type& _Kernel
Note; I'm using Visual Studio 11 Developer Preview which includes AMP support. "restrict(direct3d)" is a new keyword to support controlling which accelerator runs the code in question.
Any ideas? I've tried copying from a few different examples but nothing works so I'm a bit stumped.
Your lambda passed to parallel_for_each is an empty class (no variables are captured, therefore there are no data members). You cannot have any useful computation without data, that is why you are getting an error.
Please add concurrency::array or concurrency::array_view to your example, like so:
Note: This applies only to Visual Studio 11 Developer Preview. The behavior will change in upcoming Beta release. Your code will compile as is, without any errors. Passing empty class would simply not do anything.