In C++ AMP, kernel functions or lambdas are marked with restrict(amp), which imposes severe restrictions on the allowed subset of C++ (listed here). Does CUDA allow any more freedom on the subset of C or C++ in kernel functions?
In C++ AMP, kernel functions or lambdas are marked with restrict(amp), which imposes severe
Share
As of Visual Studio 11 and CUDA 4.1,
restrict(amp)functions are more restrictive than CUDA’s analogous__device__functions. Most noticeably, AMP is more restrictive about how pointers can be used. This is a natural consequence of AMP’s DirectX11 computational substrate, which disallows pointers in HLSL (graphics shader) code. By constrast, CUDA’s lower-level IR is PTX, which is more general purpose than HLSL.Here’s a line by line comparison:
You can read more about
restrict(amp)‘s restrictions here. You can read about C++ support in CUDA__device__functions in Appendix D of the CUDA C Programming Guide.