Enqueues a wait for a specific event or a list of events to complete before any future commands queued in the command-queue are executed.

cl_int clEnqueueWaitForEvents ( cl_command_queue command_queue,
  cl_uint num_events,
  const cl_event *event_list)



A valid command-queue.


Specifies the number of events given by event_list.


Events specified in event_list act as synchronization points. Each event in event_list must be a valid event object returned by a previous call to the following:


The context associated with events in event_list and command_queue must be the same.


Returns CL_SUCCESS if the function was successfully executed, or one of the errors below:

  • CL_INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue.
  • CL_INVALID_CONTEXT if the context associated with command_queue and events in event_list are not the same.
  • CL_INVALID_VALUE if num_events is zero or event_list is NULL.
  • CL_INVALID_EVENT if event objects specified in event_list are not valid events.
  • CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.


OpenCL Specification

Also see

clEnqueueNDRangeKernel, clEnqueueTask, clEnqueueNativeKernel, clEnqueueReadBuffer, clEnqueueWriteBuffer, clEnqueueMapBuffer, clEnqueueReadImage, clEnqueueWriteImage, clEnqueueMapImage, clEnqueueCopyBuffer, clEnqueueCopyImage, clEnqueueCopyBufferToImage, clEnqueueCopyImageToBuffer, clEnqueueMarker

Copyright © 2007-2009 The Khronos Group Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.