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 2. Host programming: fundamental data structures

 

This chapter covers
  • Understanding the six basic OpenCL data structures
  • Creating and examining the data structures in code
  • Combining the data structures to send kernels to a device

 

The first step in programming any OpenCL application is coding the host application. The good news is that you only need regular C and C++. The bad news is that you have to become familiar with six strange data structures: platforms, devices, contexts, programs, kernels, and command queues.

The preceding chapter presented these structures as part of an analogy, but the goal of this chapter is to explain how they’re used in code. For each one, we’ll look at two types of functions: those that create the ...

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