Home > Store > Programming > General Programming/Other Languages

larger cover

Add To My Wish List

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

Register your product to gain access to bonus material or receive a coupon.

  • Description
  • Extras
  • Reviews
  • Sample Content
  • Updates

Product Author Bios

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 M.S. in computer science from the University of California Berkeley where he published research in GPU computing, and he holds a B.S.E. in electrical engineering from Princeton University. Prior to joining NVIDIA, Sanders previously held positions at ATI Technologies, Apple, and Novell. When he's not writing books, Jason is typically in the gym, playing soccer, or shooting photos. Edward Kandrot is 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, Google, and 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.

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

Author's Site

Please visit the author's companion page at http://developer.nvidia.com/object/cuda-by-example.html.

Customer Reviews

57 of 61 people found the following review helpful
4.0 out of 5 stars A good introduction to CUDA C which could well supplant its competition, July 24, 2010
This review is from: CUDA by Example: An Introduction to General-Purpose GPU Programming (Paperback)
"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... Read more
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


16 of 17 people found the following review helpful
5.0 out of 5 stars Great starting point for learning CUDA., July 22, 2010
Amazon Verified Purchase(What's this?)
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.)
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


15 of 16 people found the following review helpful
5.0 out of 5 stars The best introduction to CUDA by far., July 22, 2010
By 
Mark A. Peot (Chapel Hill, NC USA) - See all my reviews
(REAL NAME)   
Amazon Verified Purchase(What's this?)
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... Read more
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


Share your thoughts with other customers:
 See all 38 customer reviews...

Online Sample Chapter

Parallel Programming in CUDA C

Table of Contents

Foreword xiii

Preface xv

Acknowledgments xvii

About the Authors xix

 

Chapter 1: Why CUDA? Why Now? 1

1.1 Chapter Objectives 2

1.2 The Age of Parallel Processing 2

1.3 The Rise of GPU Computing 4

1.4 CUDA 6

1.5 Applications of CUDA 8

1.6 Chapter Review 11

 

Chapter 2: Getting Started 13

2.1 Chapter Objectives 14

2.2 Development Environment 14

2.3 Chapter Review 19

 

Chapter 3: Introduction to CUDA C 21

3.1 Chapter Objectives 22

3.2 A First Program 22

3.3 Querying Devices 27

3.4 Using Device Properties 33

3.5 Chapter Review 35

 

Chapter 4: Parallel Programming in CUDA C 37

4.1 Chapter Objectives 38

4.2 CUDA Parallel Programming 38

4.3 Chapter Review 57

 

Chapter 5: Thread Cooperation 59

5.1 Chapter Objectives 60

5.2 Splitting Parallel Blocks 60

5.3 Shared Memory and Synchronization 75

5.4 Chapter Review 94

 

Chapter 6: Constant Memory and Events 95

6.1 Chapter Objectives 96

6.2 Constant Memory 96

6.3 Measuring Performance with Events 108

6.4 Chapter Review 114

 

Chapter 7: Texture Memory 115

7.1 Chapter Objectives 116

7.2 Texture Memory Overview 116

7.3 Simulating Heat Transfer 117

7.4 Chapter Review 137

 

Chapter 8: Graphics Interoperability 139

8.1 Chapter Objectives 140

8.2 Graphics Interoperation 140

8.3 GPU Ripple with Graphics Interoperability 147

8.4 Heat Transfer with Graphics Interop 154

8.5 DirectX Interoperability 160

8.6 Chapter Review 161

 

Chapter 9: Atomics 163

9.1 Chapter Objectives 164

9.2 Compute Capability 164

9.3 Atomic Operations Overview 168

9.4 Computing Histograms 170

9.5 Chapter Review 183

 

Chapter 10: Streams 185

10.1 Chapter Objectives 186

10.2 Page-Locked Host Memory 186

10.3 CUDA Streams 192

10.4 Using a Single CUDA Stream 192

10.5 Using Multiple CUDA Streams 198

10.6 GPU Work Scheduling 205

10.7 Using Multiple CUDA Streams Effectively 208

10.8 Chapter Review 211

 

Chapter 11: CUDA C on Multiple GPUs 213

11.1 Chapter Objectives 214

11.2 Zero-Copy Host Memory 214

11.3 Using Multiple GPUs 224

11.4 Portable Pinned Memory 230

11.5 Chapter Review 235

 

Chapter 12: The Final Countdown 237

12.1 Chapter Objectives 238

12.2 CUDA Tools 238

12.3 Written Resources 244

12.4 Code Resources 246

12.5 Chapter Review 248

 

Appendix A: Advanced Atomics 249

A.1 Dot Product Revisited 250

A.2 Implementing a Hash Table 258

A.3 Appendix Review 277

 

Index 279

Sample Pages

Download the sample pages (includes Chapter 4 and Index)

 
Best Value

Book + eBook Bundle  $71.98  $43.19

Book Price $31.99
eBook Price $11.20
eBook formats included

Buy

This book includes free shipping!

Buy

Book  $39.99  $31.99

Usually ships in 24 hours.

This book includes free shipping!

Buy

eBook (Watermarked)  $31.99  $25.59

Includes EPUB, MOBI, and PDF
About eBook Formats

This eBook includes the following formats, accessible from your Account page after purchase:

ePubEPUBThe open industry format known for its reflowable content and usability on supported mobile devices.

MOBIMOBIThe eBook format compatible with the Amazon Kindle and Amazon Kindle applications.

Adobe ReaderPDFThe popular standard, used most often with the free Adobe® Reader® software.

This eBook requires no passwords or activation to read. We customize your eBook by discretely watermarking it with your name, making it uniquely yours.

Purchase Reward: One Month Free Subscription
By completing any purchase on InformIT, you become eligible for an unlimited access one-month subscription to Safari Books Online.

Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.