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

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.