Jump to ratings and reviews
Rate this book

CUDA by Example: An Introduction to General-Purpose GPU Programming

Rate this book
This book is required reading for anyone working with accelerator-based computing systems. " From the Foreword by Jack Dongarra, University of Tennessee and Oak Ridge National Laboratory CUDA is a computing architecture designed to facilitate the development of parallel programs. In conjunction with a comprehensive software platform, the CUDA Architecture enables programmers to draw on the immense power of graphics processing units (GPUs) when building high-performance applications. GPUs, of course, have long been available for demanding graphics and game applications. CUDA now brings this valuable resource to programmers working on applications in other domains, including science, engineering, and finance. No knowledge of graphics programming is required just the ability to program in a modestly extended version of C. " CUDA by Example, " written by two senior members of the CUDA software platform team, shows programmers how to employ this new technology. The authors introduce each area of CUDA development through working examples. After a concise introduction to the CUDA platform and architecture, as well as a quick-start guide to CUDA C, the book details the techniques and trade-offs associated with each key CUDA feature. You ll discover when to use each CUDA C extension and how to write CUDA software that delivers truly outstanding performance. Major topics covered include
Parallel programming
Thread cooperation
Constant memory and events
Texture memory
Graphics interoperability
Atomics
Streams
CUDA C on multiple GPUs
Advanced atomics
Additional CUDA resources All the CUDA software tools you ll need are freely available for download from NVIDIA.http: //developer.nvidia.com/object/cuda-by-e...

320 pages, Paperback

First published July 29, 2010

29 people are currently reading
190 people want to read

About the author

Jason Sanders

16 books3 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
65 (35%)
4 stars
77 (42%)
3 stars
39 (21%)
2 stars
1 (<1%)
1 star
1 (<1%)
Displaying 1 - 18 of 18 reviews
Profile Image for Thomas Wolfe.
8 reviews3 followers
September 18, 2011
This book fits the mold of what most programmers are always looking for more of: trendy topics that seize the dialog. However, it's more than just trendy as my journey through this book was a mind expanding experience and I had a lot of fun working through the examples.

Shared memory, weaves/warps/texture memory, atomics, multiple GPUs, streams, reductions, just to name of few of the indispensable tools covered in this book. If you're going to develop software for massively parallel architectures I'd recommend this book.

The main reason I chose to read this book is because at the time I started reading it, there were no OpenCL books and from what I have read both languages are very similar apart from some naming conventions and other minor trivialities. Personally I prefer OpenCL seeing how it's not owned by a single vendor and it works on several brands of hardware. I’d still recommend this book even if you're going to be developing software for OpenCL.

In regards to reductions, the dot product sample blew my mind. Using a separate shared memory buffer so that each block has it's own buffer to write to to avoid millions of threads competing for write access to a single buffer (not to mention a ten-fold performance improvement). I can't help but remember Dijkstra:
"Simplicity is a great virtue but it requires hard work to achieve it and education to appreciate it. And to make matters worse: complexity sells better."
Profile Image for Andrew.
34 reviews
October 18, 2010
Great introduction to CUDA. You could probably find all this information somewhere on the web, but save yourself the time and read the book. It reads quick with well explained examples focusing on the CUDA and not side issues. There is only the occasional problem with it assuming to know what libraries to link against such as GL or glut, but that I figured out pretty quick. The books really gets you going on CUDA fast.
Profile Image for Venkatesh-Prasad.
223 reviews
May 27, 2022
If the reader is familiar with C and concurrency, then this book is a fast read as it walks through the examples that are simple yet convey the programming concepts and it does not ask the reader to fill the gaps in explanation. It covers all of the basic concepts of cuda programming along with the associated common and simple gotchas.

On the downside, the book is light on explaining the details of Cuda architecture and is it affects the programming. For such details, look elsewhere. If you are looking for parallel algorithm patterns, then look elsewhere. Also, since the book is a decade old, it does not cover recent changes to cuda architecture and programming model.

All said, this is a great first book to learn cuda programming.
224 reviews14 followers
August 11, 2025
I had great fun reading this book. The book is over a decade old (written in 2011) at the time of CUDA 3.0 while CUDA 13.0 was released while I was reading through this book. But fortunately this book is quite solid and most of the knowledge in the book is still relevant today.
Profile Image for Hao Ca Vien.
74 reviews4 followers
October 21, 2017
Great book on cuda introduction. Good for learners who need a little extra 'umph' to get over the curve!

1 review
Read
February 8, 2023
Great read, easy to follow, but chapter 7 is outdated at CUDA version 12, because texture reference was removed.
Profile Image for Amani.
65 reviews79 followers
December 11, 2016
A perfect introduction for CUDA programming. Well organized and sectioned. I suggest it strongly for each one to start using CUDA to get benefit from GPU parallel development. It is the first book I have read to get ready for my master thesis.

The main issue I have noticed is the lack of instructions to install CUDA and configure its environment on different operating systems. Another issue is the repeating of many ideas and parts all over the book.
434 reviews5 followers
July 20, 2016
Although, CUDA and it's ecosystem changed a bit over last 5 years, it's still a rather good introduction
Profile Image for Antonio.
38 reviews7 followers
May 19, 2013
This is the most interesting Cuda book I've found. The examples are useful and clearly explained and OpenGL integration is done elegantly.
Profile Image for Yasser Mohammad.
93 reviews23 followers
September 7, 2016
Very easy to follow but not as detailed as other introductions. Recommended if you are a new comer
Profile Image for Ion Tyberious.
3 reviews
February 24, 2015
Seminal introduction to abusing your video card as a monster calculator. Excellent first book on CUDA, if a tad out dated.
6 reviews
January 30, 2016
really great book for the newcomers. There are a lot of easy examples for the basic feature of cuda c.
Displaying 1 - 18 of 18 reviews

Can't find what you're looking for?

Get help and learn more about the design.