concept host in category opencl

appears as: host, hosts, The host, A host
OpenCL in Action: How to Accelerate Graphics and Computation

This is an excerpt from Manning's book OpenCL in Action: How to Accelerate Graphics and Computation.

In OpenCL parlance, these tasks are called kernels. A kernel is a specially coded function that’s intended to be executed by one or more OpenCL-compliant devices. Kernels are sent to their intended device or devices by host applications. A host application is a regular C/C++ application running on the user’s development system, which we’ll call the host. For many developers, the host dispatches kernels to a single device: the GPU on the computer’s graphics card. But kernels can also be executed by the same CPU on which the host application is running.

Hosts applications manage their connected devices using a container called a context. Figure 1.1 shows how hosts interact with kernels and devices.

Figure 1.1. Kernel distribution among OpenCL-compliant devices

To create a kernel, the host selects a function from a kernel container called a program. Then it associates the kernel with argument data and dispatches it to a structure called a command queue. The command queue is the mechanism through which the host tells devices what to do, and when a kernel is enqueued, the device will execute the corresponding function.

Figure 8.4. Transferring a rectangular buffer section to the host in C++

OpenGL is a vast topic, and for a full discussion of the API, I recommend The OpenGL SuperBible by Richard S. Wright et al. In contrast, the humble goal of this appendix is to provide you with enough background to enable you to code simple 3-D applications. The discussion will follow the right side of figure B.2. We’ll examine how the host packages data first and then look at how to code vertex and fragment shaders. Then we’ll see how the OpenGL Utility Toolkit (GLUT) creates windows that OpenGL applications can draw on.