C Specification

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);

Parameters

  • 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.

Description

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.

clEnqueueWaitForEvents returns CL_​SUCCESS if the function is successfully executed. Otherwise, it returns one of the following errors:

  • CL_​INVALID_​COMMAND_​QUEUE if command_queue is not a valid host command-queue.

  • CL_​INVALID_​CONTEXT if context associated with command_queue and events in event_list are not the same.

  • CL_​INVALID_​VALUE if num_events is 0 or event_list is NULL.

  • CL_​OUT_​OF_​RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.

  • CL_​OUT_​OF_​HOST_​MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.

See Also

Document Notes

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.