Chapter 2 described an OpenCL program that included the basic API calls to create a context, device, program, kernel, and memory buffers; write and read the buffers; and finally execute the kernel on the chosen device. This chapter looks, in more detail, at OpenCL contexts (i.e., environments) and devices and covers the following concepts:
• Enumerating and querying OpenCL platforms
• Enumerating and querying OpenCL devices
• Creating contexts, associating devices, and the corresponding synchronization and memory management defined by this implied environment
As discussed in Chapter 2, the first step of an OpenCL application is to query the set of OpenCL platforms and choose one or ...