To enqueue a command to execute a kernel on a device, using a single work-item, call the function
const cl_event* event_wait_list,
|clEnqueueTask is deprecated by version 2.0.
command_queue is a valid host command-queue. The kernel will be queued for execution on the device associated with command_queue.
kernel is a valid kernel object. The OpenCL context associated with kernel and command-queue must be the same.
event_wait_list and 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 is
NULL, num_events_in_wait_list must be 0. If event_wait_list is not
NULL, 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 returns an event object that identifies this command and can be used to query or wait for this command to complete. If event is
NULLor the enqueue is unsuccessful, no event will be created and therefore it will not be possible to query the status of this command or to wait for this command to complete. If event_wait_list and event are not
NULL, event must not refer to an element of the event_wait_list array.
clEnqueueTask is equivalent to calling clEnqueueNDRangeKernel with
work_dim set to 1, global_work_offset set to
set to 1, and local_work_size set to 1.
CL_SUCCESS if the kernel-instance was successfully
Otherwise, it returns one of the following errors:
CL_INVALID_if there is no successfully built program executable available for device associated with command_queue.
CL_INVALID_if command_queue is not a valid host command-queue.
CL_INVALID_if kernel is not a valid kernel object.
CL_INVALID_if context associated with command_queue and kernel are not the same or if the context associated with command_queue and events in event_wait_list are not the same.
CL_INVALID_if the kernel argument values have not been specified.
CL_INVALID_if a work-group size is specified for kernel in the program source and it is not (1, 1, 1).
WORK_ GROUP_ SIZE
CL_INVALID_if the required number of sub-groups is specified for kernel in the program source and is not consistent with a work-group size of (1, 1, 1).
WORK_ GROUP_ SIZE
CL_MISALIGNED_if a sub-buffer object is specified as the value for an argument that is a buffer object and the offset specified when the sub-buffer object is created is not aligned to
SUB_ BUFFER_ OFFSET
CL_DEVICE_value for device associated with queue. This error code is missing before version 1.1.
MEM_ BASE_ ADDR_ ALIGN
CL_INVALID_if an image object is specified as an argument value and the image dimensions (image width, height, specified or compute row and/or slice pitch) are not supported by device associated with queue.
CL_IMAGE_if an image object is specified as an argument value and the image format (image channel order and data type) is not supported by device associated with queue.
FORMAT_ NOT_ SUPPORTED
CL_OUT_if there is a failure to queue the execution instance of kernel on the command-queue because of insufficient resources needed to execute the kernel. See how this error code is used with clEnqueueNDRangeKernel for examples.
CL_MEM_if there is a failure to allocate memory for data store associated with image or buffer objects specified as arguments to kernel.
OBJECT_ ALLOCATION_ FAILURE
CL_INVALID_if event_wait_list is
EVENT_ WAIT_ LIST
NULLand num_events_in_wait_list > 0, or event_wait_list is not
NULLand num_events_in_wait_list is 0, or if event objects in event_wait_list are not valid events.
CL_INVALID_if SVM pointers are passed as arguments to a kernel and the device does not support SVM or if system pointers are passed as arguments to a kernel and/or stored inside SVM allocations passed as kernel arguments and the device does not support fine grain system SVM allocations.
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the device.
CL_OUT_if there is a failure to allocate resources required by the OpenCL implementation on the host.
OF_ HOST_ MEMORY
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.