Programming Books C Java PHP Python Learn more Browse Programming Books
CUDA by Example and over one million other books are available for Amazon Kindle. Learn more

Sorry, this item is not available in
Image not available for
Image not available

To view this video download Flash Player


Sign in to turn on 1-Click ordering
Sell Us Your Item
For a $12.56 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Start reading CUDA by Example on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

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

Jason Sanders , Edward Kandrot
4.1 out of 5 stars  See all reviews (46 customer reviews)

Buy New
$31.98 & FREE Shipping on orders over $35. Details
Only 17 left in stock (more on the way).
Ships from and sold by Gift-wrap available.
In Stock.
Rented by RentU and Fulfilled by Amazon.
Want it Monday, July 14? Choose One-Day Shipping at checkout. Details
Free Two-Day Shipping for College Students with Amazon Student


Amazon Price New from Used from
Kindle Edition $17.27  
Paperback $31.98  
Shop the new
New! Introducing the, a hub for Software Developers and Architects, Networking Administrators, TPMs, and other technology professionals to find highly-rated and highly-relevant career resources. Shop books on programming and big data, or read this week's blog posts by authors and thought-leaders in the tech industry. > Shop now

Book Description

July 29, 2010 0131387685 978-0131387683 1

“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.

Frequently Bought Together

CUDA by Example: An Introduction to General-Purpose GPU Programming + CUDA Handbook: A Comprehensive Guide to GPU Programming, The + Programming Massively Parallel Processors, Second Edition: A Hands-on Approach
Price for all three: $138.48

Buy the selected items together

Editorial Reviews

About the Author

Jason Sanders is a senior software engineer in the CUDA Platform group at NVIDIA. While at NVIDIA, he helped develop early releases of CUDA system software and contributed to the OpenCL 1.0 Specification, an industry standard for heterogeneous computing. Jason received his master’s degree in computer science from the University of California Berkeley where he published research in GPU computing, and he holds a bachelor’s degree in electrical engineering from Princeton University. Prior to joining NVIDIA, he previously held positions at ATI Technologies, Apple, and Novell. When he’s not writing books, Jason is typically working out, playing soccer, or shooting photos.


Edward Kandrot is a senior software engineer on the CUDA Algorithms team at NVIDIA. He has more than twenty years of industry experience focused on optimizing code and improving performance, including for Photoshop and Mozilla. Kandrot has worked for Adobe, Microsoft, and Google, and he has been a consultant at many companies, including Apple and Autodesk. When not coding, he can be found playing World of Warcraft or visiting Las Vegas for the amazing food.

Product Details

  • Paperback: 312 pages
  • Publisher: Addison-Wesley Professional; 1 edition (July 29, 2010)
  • Language: English
  • ISBN-10: 0131387685
  • ISBN-13: 978-0131387683
  • Product Dimensions: 9 x 7.5 x 0.7 inches
  • Shipping Weight: 1.2 pounds (View shipping rates and policies)
  • Average Customer Review: 4.1 out of 5 stars  See all reviews (46 customer reviews)
  • Amazon Best Sellers Rank: #73,305 in Books (See Top 100 in Books)

More About the Authors

Discover books, learn about writers, read author blogs, and more.

Customer Reviews

Most Helpful Customer Reviews
61 of 65 people found the following review helpful
"CUDA by example: an introduction to general-purpose GPU programming" is a brand new text by Jason Sanders and Edward Kandrot, senior members of NVIDIA's CUDA development team. This is basically the second introductory text to hit the market on general-purpose GPU programming, the first one being "Programming Massively Parallel Processors: A Hands-On Approach" by David Kirk and Wen-Mei Hwu.

The Good: it is not very common to find a technical book in this price range that is not simply in greyscale. Perhaps unsurprisingly for an NVIDIA book there's quite a bit of green, and this definitely enhances the reading experience. On a more substantive note: the authors really mean the "by example" part of "CUDA by example". From chapter 3 onward, all the main concepts are fleshed out by showing and dissecting lots of code -- probably more so than in Kirk & Hwu's text, which includes application case studies, but also more extensive treatments of the CUDA architecture. As with any example-based book, it is important to run and modify the programs while reading through the text. Right now there are a few hiccups with the files Sanders & Kandrot were kind enough to provide (e.g. as of this writing README.txt and license.txt do not have the appropriate permissions set), but I'm pretty sure these are just teething troubles which will disappear soon enough. The writing is cheerful (e.g. "For those readers who are more familiar with Star Trek than with weaving, a warp in this context has nothing to do with the speed of travel through space.", p. 106) and the explanations are for the most part clear, the language being pretty lucid -- once again, probably more so than in the Kirk & Hwu volume.
Read more ›
Was this review helpful to you?
16 of 17 people found the following review helpful
5.0 out of 5 stars Great starting point for learning CUDA. July 22, 2010
Format:Kindle Edition|Verified Purchase
I downloaded CUDA by Example on the Kindle and starting reading it. Sanders and Kandrot provide a nice step by step walk through of how to program with CUDA and the examples are really straight forward. It begins with the basic hello world introduction to the programming model, then dives deeper into the different API features with examples in each chapter.
I would recommend this book to anyone who wants to get started using CUDA.
(Found the source code online, not sure what the other review is about.)
Comment | 
Was this review helpful to you?
16 of 17 people found the following review helpful
5.0 out of 5 stars The best introduction to CUDA by far. July 22, 2010
Format:Kindle Edition|Verified Purchase
This is an excellent introduction to CUDA. The prose and content are excellent: I read it cover-to-cover in a single sitting and enjoyed every page.

The authors clearly explain the basic CUDA paradigm starting with very simple code and working up to progressively more complex examples. The authors spend a considerable amount of time discussing different memory types and memory access styles, motivating when each style is appropriate. The code snippets are clean, clear and concise, providing a minimal yet complete introduction to each new language feature.

Highly recommended!

The book does not provide an HTML pointer to the source code used in the book. Edward Kandrot writes: "The Kindle version shipped a week too soon, it was supposed to ship next week when the physical book ships. Because of this, the website at NVIDIA wasn't done yet. Jason just spent the day making the website happen!

[...] is where the source code is currently located. I hope this helps. I wrote the examples to be specific for what is being covered, putting extras in the header files so as not to distract from the topic at hand. Only really works if the reader has the header files as well..."
Comment | 
Was this review helpful to you?
7 of 7 people found the following review helpful
5.0 out of 5 stars Professional effort April 1, 2011
Format:Paperback|Verified Purchase
I purchased this book a few months ago, and was able to get through the bulk of it while on a day-long flight. It is a well structured, albeit terse approach to the CUDA architecture. I think on its own, the book deserves 3.5-4 stars. However, I have also read the most recent OpenCL book (rough cuts - actual release sometime in July 2011), and without using this CUDA book as a background / reference, the OpenCL book is incomprehensible. Hence, as of now, this book is the best there is out there for those interested in venturing into OpenCL or CUDA (no, the book does not teach you OpenCL constructs or syntax, but I found the architectural foundations to be fairly similar).

Also, CUDA is by far a more professional and better groomed effort, and this book reflects that difference. A simple comparison of Nvidia's CUDA support pages with the Kronos' abysmal OpenCL web page will illustrate the point (with the latter's broken or incorrect links, a web design that look like a college freshman's HTML project from the mid 90s, and a handful of hodge-podge and unprofessional scribbles, and requiring a dozen or so clicks and reading incomplete wikis to realize that there is no OpenCL developer "package" from Kronos, except for what Nvidia and AMD are individually making available for their hardware -- so much for creating platform heterogeneity).

However, I am still determined to pursue OpenCL over CUDA, betting my time and effort on a completely open source (and hopefully, someday homogeneous) platform. Otherwise, OpenCL will join the graveyard of many other "nice idea, but half-baked" programming languages of the past.
Comment | 
Was this review helpful to you?
Most Recent Customer Reviews
4.0 out of 5 stars Very good introduction on CUDA
If you are new to the world of GPU programming and CUDA works for what you want to do then this is a very good book to start with. Read more
Published 1 month ago by Douglas R. Jones
4.0 out of 5 stars Can't go without this book if you are learning CUDA.
CUDA programming is often recommended as the best place to start out when learning about programming GPU's. Read more
Published 3 months ago by M. Henri De Feraudy
5.0 out of 5 stars Nicely written
Great book. Quickly impresses you. Easy to understand and written with lots of experience. Good book to have especially if you know C.
Published 3 months ago by Rajeev Kumar
5.0 out of 5 stars Awesome book
This is how programming books should be. Anyone familiar with "Learning Python the Hard Way" will understand the benefits of walking you through lots of code and explaining... Read more
Published 8 months ago by Brad
5.0 out of 5 stars THE best introduction to CUDA programming!
Although this does not cover new features on the Kepler architecture, this is still the best introduction to CUDA programing available. Read more
Published 9 months ago by John Kapenga
5.0 out of 5 stars This should be your first CUDA book.
As of today, this book is the easiest book to follow from all the CUDA books I've found. If you are new to CUDA development, this is it. Read more
Published 11 months ago by Steven B.
4.0 out of 5 stars Pretty simple and easy to follow for a beginner.
It is pretty simple and easy to follow for a beginner. The only thing I miss in this book is the actual GPU architecture, this book gives a more superficial explanation of... Read more
Published 11 months ago by priya
3.0 out of 5 stars A potentially great introduction to CUDA spoiled by endless typos and...
I don't regret buying this book because the contents are a very good tutorial on CUDA. That said, this is a unnecessarily hard to read book, and here's why:

-... Read more
Published 13 months ago by Henrique
1.0 out of 5 stars Useless
This book is not worth the paper it is written on. As others have commented, the code is cluttered and difficult to decipher. It is obviously written by "Software People". Read more
Published 14 months ago by J.I.M.
5.0 out of 5 stars Good book
This book was very good and in depth, it had lots of examples and was good at presenting its information.
Published 15 months ago by Pen Name
Search Customer Reviews
Search these reviews only


Have something you'd like to share about this product?
Start a new discussion
First post:
Prompts for sign-in

Search Customer Discussions
Search all Amazon discussions

Look for Similar Items by Category