To enqueue a wait for a specific event or a list of events to complete before any future commands queued in a command-queue are executed, call the function
cl_int clEnqueueWaitForEvents( cl_command_queue command_queue, cl_uint num_events, const cl_event* event_list);
command_queue is a valid host command-queue.
event_list and num_events specify events that need to complete before this particular command can be executed.
The events specified in event_list act as synchronization points. The context associated with events in event_list and command_queue must be the same. The memory associated with event_list can be reused or freed after the function returns.
CL_SUCCESS if the function is successfully
Otherwise, it returns one of the following errors:
CL_INVALID_COMMAND_QUEUEif command_queue is not a valid host command-queue.
CL_INVALID_CONTEXTif context associated with command_queue and events in event_list are not the same.
CL_INVALID_VALUEif num_events is 0 or event_list is
CL_OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.
For more information, see the OpenCL Specification
This page is extracted from the OpenCL Specification. Fixes and changes should be made to the Specification, not directly.
Copyright (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.