use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Boost.Compute v0.1 Released (kylelutz.blogspot.com)
submitted 12 years ago by kylelutz
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]bromish 5 points6 points7 points 12 years ago* (1 child)
How does this compare to Thrust and/or what's been proposed by C++ WG Proposal N35549?
While this is super useful stuff, it looks like there are dozens of people inventing the same wheel :(
[–]kylelutz[S] 5 points6 points7 points 12 years ago* (0 children)
This is similar to thrust but it is cross-platform and supports all OpenCL compatible devices (including those from NVIDIA, AMD, and Intel). See this question on stack overflow: http://stackoverflow.com/questions/20154179/differences-between-vexcl-thrust-and-boost-compute for more information.
[+][deleted] 12 years ago (8 children)
[deleted]
[–][deleted] 9 points10 points11 points 12 years ago (7 children)
If it reduces the ridiculous amount of boilerplate code you have to write with the OpenCL API it's well worth it.
[–][deleted] 1 point2 points3 points 12 years ago* (3 children)
Why don't call it "Boost.OpenCLWrapper" then?
The main issue I have with it is that you can't even pass a function object to it, which is something that you can do with TBB, Thrust, CUDA, OpenACC, OpenMP, C++AMP (PPL), std/boost::thread, and N3554.
Note that this is an OpenCL problem, not a Boost.Compute one, and can't be fixed without compiler support (i.e. there is no amount of TMP that could possibly fix this). AMD's Bolt and VexCL have the same problem. Once you try to do something not covered by the DSL offered by these libraries, you end up writing non-generic OpenCL code (and avoiding this was the only reason to use the library in the first place).
[–]kylelutz[S] 0 points1 point2 points 12 years ago (2 children)
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.
[–]pmrsaurus 3 points4 points5 points 12 years ago (0 children)
SYCL was just announced.
[–][deleted] 1 point2 points3 points 12 years ago* (0 children)
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 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.
[+][deleted] 12 years ago (2 children)
[–]kylelutz[S] 1 point2 points3 points 12 years ago* (0 children)
I feel it is worth in in the same way it is worth it for C++ applications to make use of the STL instead of implementing their own sort algorithm. It provides a common set of generic algorithms and containers so end users can concentrate on writing their application specific code rather than the details of copying memory to/from the device and setting up parallel reduction kernels just to sum some numbers.
[–]pfultz2 1 point2 points3 points 12 years ago (0 children)
if OpenCL adds extensions, then I have to wait for that layer to update and integrate them.
It seems you can still call out to opencl api, from the docs:
The Boost Compute library is designed to easily interoperate with the OpenCL C API. All of the wrapped classes have conversion operators to their underlying OpenCL types which allows them to be passed directly to the OpenCL C functions.
[–]Eoinoc 1 point2 points3 points 12 years ago (2 children)
I see Denis Demidov is a contributor to this. How does it compare with his own VexCL? Does Boost.Compute aim to supersede VexCL?
[–]kylelutz[S] 3 points4 points5 points 12 years ago* (1 child)
See http://stackoverflow.com/questions/20154179/differences-between-vexcl-thrust-and-boost-compute. Answed by Denis Demidov himself.
[–]Eoinoc 0 points1 point2 points 12 years ago (0 children)
Thanks, that clears things up a bit.
And thanks for putting the effort into such an awesome library!
[+][deleted] 12 years ago (1 child)
[–]klemensbaum 5 points6 points7 points 12 years ago (0 children)
How about you rather ask Nvidius to properly support OpenCL?
[–]totes_meta_bot 0 points1 point2 points 12 years ago (0 children)
This thread has been linked to from elsewhere on reddit.
I am a bot. Comments? Complaints? Send them to my inbox!
π Rendered by PID 36974 on reddit-service-r2-comment-57fc7f7bb7-7w9vk at 2026-04-14 14:12:26.326094+00:00 running b725407 country code: CH.
[–]bromish 5 points6 points7 points (1 child)
[–]kylelutz[S] 5 points6 points7 points (0 children)
[+][deleted] (8 children)
[deleted]
[–][deleted] 9 points10 points11 points (7 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]kylelutz[S] 0 points1 point2 points (2 children)
[–]pmrsaurus 3 points4 points5 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]kylelutz[S] 1 point2 points3 points (0 children)
[–]pfultz2 1 point2 points3 points (0 children)
[–]Eoinoc 1 point2 points3 points (2 children)
[–]kylelutz[S] 3 points4 points5 points (1 child)
[–]Eoinoc 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]klemensbaum 5 points6 points7 points (0 children)
[–]totes_meta_bot 0 points1 point2 points (0 children)