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 4. Kernel programming: data types and device memory

 

This chapter covers
  • Introducing a simple OpenCL kernel
  • Using OpenCL’s scalar and vector data types
  • Understanding the OpenCL device model

 

In this chapter, we’re going to put aside the scaffolding that creates and deploys kernels, and start coding the kernels themselves. We’ll examine the data types available in OpenCL kernels, and that means we’ll finally get to discuss vectors. When you process data with vectors, you put aside boring, decades-old data types like char, float, and int, and use new, exciting data types like char16, int3, and float4. Now we’re cooking!

I didn’t learn about vector programming until after I left college, but I’ve always enjoyed it since. It doesn’t ...

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