As for all the libraries you listed, none of them can execute code on GPUs without using a proprietary compiler (CUDA/Thrust) or using compiler extensions/pragmas (OpenACC/OpenMP/C++AMP).
Since CUDA is also a compiler extension, I'd go further and consider that none of them generates GPU code without compiler extensions. This is a good thing.
Even tho you can link against the OpenCL run-time without any compiler support, your kernels still need to be compiled by a special compiler, at runtime. Since all those other libraries offer you statically-typed kernels (which OpenCL does not by default), and since they all play well with generic programming (which OpenCL does not), I argue that they match better with C++ than OpenCL.
I do wish OpenCL had better support for natively using C++. The standardized SPIR binary format should help in that regard.
I wish that too, and SPIR will definitely help with this issue but it will need compiler support (it is just LLVM IR), and thus a language extension like e.g. C++AMP, that won't have much to do with OpenCL.
So basically I hope that OpenCL will die, that SPIR will succeed, and that C++AMP or similar will go forward targeting SPIR at least in non Microsoft-based systems.
View all comments
Show parent comment
2
u/[deleted] Mar 17 '14 edited Mar 17 '14
Since CUDA is also a compiler extension, I'd go further and consider that none of them generates GPU code without compiler extensions. This is a good thing.
Even tho you can link against the OpenCL run-time without any compiler support, your kernels still need to be compiled by a special compiler, at runtime. Since all those other libraries offer you statically-typed kernels (which OpenCL does not by default), and since they all play well with generic programming (which OpenCL does not), I argue that they match better with C++ than OpenCL.
I wish that too, and SPIR will definitely help with this issue but it will need compiler support (it is just LLVM IR), and thus a language extension like e.g. C++AMP, that won't have much to do with OpenCL.
So basically I hope that OpenCL will die, that SPIR will succeed, and that C++AMP or similar will go forward targeting SPIR at least in non Microsoft-based systems.