O'Reilly logo

GPU Gems 2: Programming Techniques for High-Performance Graphics and General-Purpose Computation by Randima Fernando, Matt Pharr

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 34. GPU Flow-Control Idioms

Mark HarrisNVIDIA Corporation

Ian BuckStanford University

Flow control is one of the most fundamental concepts taught to beginning programmers. Branching and looping are such basic concepts that it can be daunting to write software for a platform that supports them in a limited manner. The latest GPUs support vertex and fragment program branching in multiple forms, but their highly parallel nature requires care in how they are used. This chapter surveys some of the limitations of branching on current GPUs and describes a variety of techniques for iteration and decision making in GPGPU programs.

Flow-Control Challenges

Let’s start by discussing the most obvious form of flow control on GPUs. All current high-level ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required