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

Get OpenCL in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.