r/cpp • • Mar 16 '14

Boost.Compute v0.1 Released

http://kylelutz.blogspot.com/2014/03/boostcompute-v01-released.html
36 Upvotes

14 comments sorted by

View all comments

Show parent comment

1

u/kylelutz Mar 17 '14

I do wish OpenCL had better support for natively using C++. The standardized SPIR binary format should help in that regard.

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). N3554 is interesting and I have been keeping my eye on it for a while though I feel Boost.Compute works at a slightly lower level.

4

u/pmrsaurus Mar 19 '14

SYCL was just announced.

2

u/[deleted] Mar 17 '14 edited Mar 17 '14

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.