O'Reilly logo

OpenCL in Action: How to Accelerate Graphics and Computation by Matthew Scarpino

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 10. General coding principles

 

This chapter covers
  • Determining values for global size and local size
  • Implementing the reduction algorithm in OpenCL
  • Synchronizing work-items in different work-groups

 

In the preceding chapters, the example host applications have executed kernels using a single work-item. This is fine when you’re learning OpenCL or testing a new application, but for production code, this is unacceptable. OpenCL’s great strength is that you can execute kernels using millions or even billions of work-items, and if you’re not going to put them to use, you might as well program in regular C.

Making use of all this processing power isn’t easy. You need a clear understanding of how work-items and work-groups access memory, ...

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