C Specification
To enqueue a command-buffer to execute on command-queues, call the function
// Provided by cl_khr_command_buffer
cl_int clEnqueueCommandBufferKHR(
cl_uint num_queues,
cl_command_queue* queues,
cl_command_buffer_khr command_buffer,
cl_uint num_events_in_wait_list,
const cl_event* event_wait_list,
cl_event* event);
clEnqueueCommandBufferKHR is provided by the cl_khr_command_buffer extension.
|
Parameters
-
num_queues is the number of command-queues listed in queues.
-
queues is a pointer to an ordered list of command-queues to execute the command-buffer on. queues can be
NULL, in which case the default command-queues used on command-buffer creation are used and num_queues must be 0. -
command_buffer refers to a valid command-buffer object.
-
event_wait_list, num_events_in_wait_list specify events that need to complete before this particular command can be executed. If event_wait_list is
NULL, then this particular command does not wait on any event to complete. If event_wait_list isNULL, num_events_in_wait_list must be 0. If event_wait_list is notNULL, the list of events pointed to by event_wait_list must be valid and num_events_in_wait_list must be greater than 0. The events specified in event_wait_list act as synchronization points. The context associated with events in event_wait_list and command_queue must be the same. The memory associated with event_wait_list can be reused or freed after the function returns. -
event will return an event object that identifies this command and can be used to query for profiling information or queue a wait for this particular command to complete. event can be
NULLin which case it will not be possible for the application to wait on this command or query it for profiling information.
Description
|
To enqueue a command-buffer it must be in a Executable state, see clFinalizeCommandBufferKHR. |
clEnqueueCommandBufferKHR returns CL_SUCCESS if the command-buffer
execution was successfully queued, or one of the errors below:
-
CL_INVALID_if command_buffer is not a valid command-buffer.COMMAND_ BUFFER_ KHR -
CL_INVALID_if command_buffer has not been finalized.OPERATION -
CL_INVALID_if command_buffer was not created with theOPERATION CL_COMMAND_flag and is in the Pending state.BUFFER_ SIMULTANEOUS_ USE_ KHR -
CL_INVALID_if queues isVALUE NULLand num_queues is > 0, or queues is notNULLand num_queues is 0. -
CL_INVALID_if num_queues is > 0 and not the same value as num_queues set on command_buffer creation.VALUE -
CL_INVALID_if any element of queues is not a valid command-queue.COMMAND_ QUEUE -
CL_INCOMPATIBLE_if the properties of any command-queue in queues contains a property not specified byCOMMAND_ QUEUE_ KHR CL_DEVICE_.COMMAND_ BUFFER_ SUPPORTED_ QUEUE_ PROPERTIES_ KHR -
CL_INCOMPATIBLE_if the properties of any command-queue in queues does not contain the minimum properties specified byCOMMAND_ QUEUE_ KHR CL_DEVICE_.COMMAND_ BUFFER_ REQUIRED_ QUEUE_ PROPERTIES_ KHR -
CL_INVALID_if any element of queues does not have the same device as the command-queue set on command_buffer creation at the same list index.DEVICE -
CL_INVALID_if any element of queues does not have the same context as the command-queue set on command_buffer creation at the same list index.CONTEXT -
CL_INVALID_if context associated with command_buffer and events in event_wait_list are not the same.CONTEXT -
CL_OUT_if there is a failure to queue the execution instance of command_buffer on the command-queues because of insufficient resources needed to execute command_buffer.OF_ RESOURCES -
CL_INVALID_if event_wait_list isEVENT_ WAIT_ LIST NULLand num_events_in_wait_list > 0, or event_wait_list is notNULLand num_events_in_wait_list is 0, or if event objects in event_wait_list are not valid events. -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the device.OF_ RESOURCES -
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the host.OF_ HOST_ MEMORY
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.