Hello CUDA
Every programming journey starts with a simple ‘Hello World’ program, and with all the features that GPUs provide to the developer, it is the best approach to explaining how things really work. As with any intricate topic, there is a myriad of detail that complicates GPU programming. If we had to know it all before writing any code it would be tiresome and boring. To avoid this, we will adopt an incremental approach. We will learn a little about how to program our GPU devices, and we will have to believe in a little magic here and there until we grasp all the concepts.
We’ll start with a superficial understanding of what makes a GPU program, and then move on to a fully functional toy program as a milestone in terms of using our GPU device. At the end of the chapter, we will wrap up with a section on how to use the default NVIDIA example of querying a device and some discussion of the main details that can be inspected from the execution environment...