OpenCL has an event-based synchronization mechanism. These event handles identify the unique commands in the queue and can be used for synchronizing algorithm execution. It can also be used for profiling the queued task. We will discuss more about profiling in a later section. OpenCL event is an object which holds the state of the task. An OpenCL event state is defined as one of the following stages based on the life time of the task:
CL_QUEUED
: The command is enqueued into thecommand_queue
queue, but it has not yet been submitted to the device. This state is the first state for all events except for the user events.CL_SUBMITTED
: This state means that the host has submitted this command to the host. All user events reach this state before running.CL_RUNNING
: When the command is dequeued on the device the event reaches the state ofCL_RUNNING
. The device has started to execute this command. If this event is waiting for other events to complete then...