Greetings and salutations! This text is an introductory guide to GPU programming with Python and CUDA. GPU may stand for Graphics Programming Unit, but we should be clear that this book is not about graphics programming—it is essentially an introduction to General-Purpose GPU Programming, or GPGPU Programming for short. Over the last decade, it has become clear that GPUs are well suited for computations besides rendering graphics, particularly for parallel computations that require a great deal of computational throughput. To this end, NVIDIA released the CUDA Toolkit, which has made the world of GPGPU programming all the more accessible to just about anyone with some C programming knowledge.
The aim of Hands-On GPU Programming with Python and CUDA is to get you started in the world of GPGPU programming as quickly as possible. We have strived to come up with fun and interesting examples and exercises for each chapter; in particular, we encourage you to type in these examples and run them from your favorite Python environment as you go along (Spyder, Jupyter, and PyCharm are all suitable choices). This way, you will eventually learn all of the requisite functions and commands, as well as gain an intuition of how a GPGPU program should be written.
Initially, GPGPU parallel programming seems very complex and daunting, especially if you've only done CPU programming in the past. There are so many new concepts and conventions you have to learn that it may seem like you're starting all over again at zero. During these times, you'll have to have some faith that your efforts to learn this field are not for naught. With a little bit of initiative and discipline, this subject will seem like second nature to you by the time you reach the end of the text.
Happy programming!