logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

clEnqueueTask - Enqueues a command to execute a kernel on a device.

Authors

TheKhronosGroup

Errors

       Returns CL_SUCCESS if the kernel execution was successfully queued, or one of the errors below:

       •   CL_INVALID_PROGRAM_EXECUTABLE if there is no successfully built program executable available for
           device associated with command_queue.

       •   CL_INVALID_COMMAND_QUEUE if command_queue is not a valid command-queue.

       •   CL_INVALID_KERNEL if kernel is not a valid kernel object.

       •   CL_INVALID_CONTEXT if context associated with command_queue and kernel is not the same or if the
           context associated with command_queue and events in event_wait_list are not the same.

       •   CL_INVALID_KERNEL_ARGS if the kernel argument values have not been specified.

       •   CL_INVALID_WORK_GROUP_SIZE if a work-group size is specified for kernel using the
           functionQualifiers(3clc) ((reqd_work_group_size(X,Y,Z))) qualifier in program source and is not (1,
           1, 1).

       •   CL_MISALIGNED_SUB_BUFFER_OFFSET 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
           CL_DEVICE_MEM_BASE_ADDR_ALIGN value for device associated with queue.

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

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

       •   CL_MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for data store associated
           with image or buffer objects specified as arguments to kernel.

       •   CL_INVALID_EVENT_WAIT_LIST if event_wait_list is NULL and num_events_in_wait_list > 0, or
           event_wait_list is not NULL and num_events_in_wait_list is 0, or if event objects in event_wait_list
           are not valid events.

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

Name

       clEnqueueTask - Enqueues a command to execute a kernel on a device.

       cl_intclEnqueueTask(cl_command_queuecommand_queue,cl_kernelkernel,cl_uintnum_events_in_wait_list,constcl_event*event_wait_list,cl_event*event);

Notes

        1. OpenCL Specification
           page 172, section 5.8 - Executing Kernels (updated for 1.2 rev 14)

The Khronos Group                                  11/18/2024                                CLENQUEUETASK(3clc)

Parameters

command_queue
           A valid command-queue. The kernel will be queued for execution on the device associated with
           command_queue.

        kernel
           A valid kernel object. The OpenCL context associated with kernel and command_queue must be the same.

         num_events_in_wait_list ,  event_wait_list
           Sspecify 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 particular kernel execution instance. Event objects are
           unique and can be used to identify a particular kernel execution instance later on. If event is NULL,
           no event will be created for this kernel execution instance and therefore it will not be possible for
           the application to query or queue a wait for this particular kernel execution instance.

See Also

clEnqueueNDRangeKernel(3clc), clEnqueueNativeKernel(3clc)

Specification

OpenCLSpecification[1]

See Also