The previous chapter was all about the OpenCL program and kernel creation, and enqueing the kernels in an NDRange. We also discussed different types of tasks, which will be queued on to a device command queue. Every application will need to keep track of these tasks and synchronize the data view for a computational task. The OpenCL standard provides this synchronizing entity in the form of cl_event
objects.
A simple Wikipedia definition defines Events as an action that is usually initiated outside the scope of a program and the status of these events is handled by a piece of code inside the program. There may be multiple sources for events. A typical source of event handle is the OpenCL clEnqueue*
routines. An OpenCL runtime libraries changes the state of all events enqueued to the command queue. It keeps track of all the operations, which a host program initiates on to the various OpenCL devices. OpenCL Events are used mainly to synchronize the execution...