Boost Compute
In this book, we have chosen Boost Compute (written by Kyle Lutz) as the library for accessing the GPU. The reasons we picked Boost Compute are that it is very well written, vendor independent, and contains almost all STL algorithms. On top of that, it is a part of Boost, one of the most widely used C++ library.
Throughout this section we will keep a steady focus on the syntactic similarities between Boost Compute and STL algorithms, therefore many Boost Compute code examples will be presented side by side with its equivalent STL algorithm implementation.
Basic concepts of Boost Compute
Boost Compute has a few basic concepts, which are good to grasp before going further:
- Device, the equivalent of the actual GPU on which the operations will be executed
- Context, the context could be considered the gate to the device
- Queue, a command queue on which you push operations, which are then executed asynchronously via the GPU driver
On top of that, as GPUs in many cases have their own exclusive...