-
Book Overview & Buying
-
Table Of Contents
The C++ Programmer's Mindset
By :
Programming accelerators and coprocessors, such as GPUs, can greatly improve the computational throughput and expand your capabilities for solving problems. However, the programming model for these devices varies greatly, and usually requires a very different approach to programming to make use of the massive parallelism. Understanding the architecture of the target device and the nature of the problem itself is critical to producing fast and efficient code. When it comes to programming these devices, one can either make use of indirect programming using libraries such as NVIDIA Thrust (or equivalent) and OpenMP device offload, or directly using CUDA or SYCL.
One of the early problems one will encounter with using specialized hardware is the movement of data. Sending large amounts of data to and from a GPU, for instance, is expensive and needs to be managed carefully. This can be done automatically, as is the case for OpenMP offload or SYCL, or it can be a manual process...