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

clGetEventInfo - Returns information about the event object.

Authors

TheKhronosGroup

Errors

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

       •   CL_INVALID_VALUE if param_name is not valid, or if size in bytes specified by param_value_size is <
           size of return type as described in the table above and param_value is not NULL.

       •   CL_INVALID_VALUE if information to query given in param_name cannot be queried for event.

       •   CL_INVALID_EVENT if event is not a valid event object.

       •   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

       clGetEventInfo - Returns information about the event object.

       cl_intclGetEventInfo(cl_eventevent,cl_event_infoparam_name,size_tparam_value_size,void*param_value,size_t*param_value_size_ret);

Notes

        1. OpenCL Specification
           page 180, section 5.9 - Event Objects

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

Parameters

event
           Specifies the event object being queried.

       param_value
           A pointer to memory where the appropriate result being queried is returned. If param_value is NULL,
           it is ignored.

       param_value_size
           Specifies the size in bytes of memory pointed to by param_value. This size must be ≥ size of the
           return type as described in the table below.

       param_value_size_ret
           Returns the actual size in bytes of data copied to param_value. If param_value_size_ret is NULL, it
           is ignored.

       param_name
           Specifies the information to query. The list of supported param_name types and the information
           returned in param_value by clGetEventInfo is described in the table below:
           ┌──────────────────────────┬──────────────────┬───────────────────────────────────────────────────────────────┐
           │ cl_event_infoReturnTypeInformationreturnedin                                       │
           │                          │                  │ param_value                                                   │
           ├──────────────────────────┼──────────────────┼───────────────────────────────────────────────────────────────┤
           │ CL_EVENT_COMMAND_QUEUE   │ cl_command_queue │ Return the command-queue                                      │
           │                          │                  │ associated with event.  For                                   │
           │                          │                  │ user event objects, a NULL                                    │
           │                          │                  │ value is returned.                                            │
           ├──────────────────────────┼──────────────────┼───────────────────────────────────────────────────────────────┤
           │ CL_EVENT_CONTEXT         │ cl_context       │ Return the context                                            │
           │                          │                  │ associated with event.                                        │
           ├──────────────────────────┼──────────────────┼───────────────────────────────────────────────────────────────┤
           │ CL_EVENT_COMMAND_TYPE    │ cl_command_type  │ Return the command                                            │
           │                          │                  │ associated with event.  Can                                   │
           │                          │                  │ be one of the following                                       │
           │                          │                  │ values:                                                       │
           │                          │                  │                CL_COMMAND_NDRANGE_KERNEL                      │
           │                          │                  │                CL_COMMAND_TASK                                │
           │                          │                  │                CL_COMMAND_NATIVE_KERNEL                       │
           │                          │                  │                CL_COMMAND_READ_BUFFER                         │
           │                          │                  │                CL_COMMAND_WRITE_BUFFER                        │
           │                          │                  │                CL_COMMAND_COPY_BUFFER                         │
           │                          │                  │                CL_COMMAND_READ_IMAGE                          │
           │                          │                  │                CL_COMMAND_WRITE_IMAGE                         │
           │                          │                  │                CL_COMMAND_COPY_IMAGE                          │
           │                          │                  │                CL_COMMAND_COPY_BUFFER_TO_IMAGE                │
           │                          │                  │                CL_COMMAND_COPY_IMAGE_TO_BUFFER                │
           │                          │                  │                CL_COMMAND_MAP_BUFFER                          │
           │                          │                  │                CL_COMMAND_MAP_IMAGE                           │
           │                          │                  │                CL_COMMAND_UNMAP_MEM_OBJECT                    │
           │                          │                  │                CL_COMMAND_MARKER                              │
           │                          │                  │                CL_COMMAND_ACQUIRE_GL_OBJECTS                  │
           │                          │                  │                CL_COMMAND_RELEASE_GL_OBJECTS                  │
           │                          │                  │                CL_COMMAND_READ_BUFFER_RECT                    │
           │                          │                  │                CL_COMMAND_WRITE_BUFFER_RECT                   │
           │                          │                  │                CL_COMMAND_COPY_BUFFER_RECT                    │
           │                          │                  │                CL_COMMAND_USER                                │
           │                          │                  │                CL_COMMAND_BARRIER                             │
           │                          │                  │                CL_COMMAND_MIGRATE_MEM_OBJECTS                 │
           │                          │                  │                CL_COMMAND_FILL_BUFFER                         │
           │                          │                  │                CL_COMMAND_FILL_IMAGE                          │
           │                          │                  │                CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR            │
           │                          │                  │                (if cl_khr_gl_event(3clc) is enabled)          │
           │                          │                  │                CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR           │
           │                          │                  │                (if cl_khr_d3d10_sharing(3clc) is enabled)     │
           │                          │                  │                CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR           │
           │                          │                  │                (if cl_khr_d3d10_sharing(3clc) is enabled)     │
           │                          │                  │                CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR      │
           │                          │                  │                (if cl_khr_dx9_media_sharing(3clc) is enabled) │
           │                          │                  │                CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR      │
           │                          │                  │                (if cl_khr_dx9_media_sharing(3clc) is enabled) │
           │                          │                  │                CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR           │
           │                          │                  │                (if  cl_khr_d3d11_sharing(3clc) is enabled)    │
           │                          │                  │                CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR           │
           │                          │                  │                (if  cl_khr_d3d11_sharing(3clc) is enabled)    │
           │                          │                  │                                                               │
           │                          │                  │                                                               │
           ├──────────────────────────┼──────────────────┼───────────────────────────────────────────────────────────────┤
           │ CL_EVENT_COMMAND_        │ cl_int           │ Return the execution status of the command identified by      │
           │ EXECUTION_STATUS         │                  │ event.  The valid values are:                                 │
           │                          │                  │                                                               │
           │                          │                  │ CL_QUEUED (command has been enqueued in the command-queue),   │
           │                          │                  │                                                               │
           │                          │                  │ CL_SUBMITTED (enqueued command has been submitted by the host │
           │                          │                  │ to the device associated with the command-queue),             │
           │                          │                  │                                                               │
           │                          │                  │ CL_RUNNING (device is currently executing this command),      │
           │                          │                  │                                                               │
           │                          │                  │ CL_COMPLETE (the command has completed), or                   │
           │                          │                  │                                                               │
           │                          │                  │ Error code given by a negative integer value. (command was    │
           │                          │                  │ abnormally terminated – this may be caused by a bad memory    │
           │                          │                  │ access etc.) These error codes come from the same set of      │
           │                          │                  │ error codes that are returned from the platform or runtime    │
           │                          │                  │ API calls as return values or errcode_ret values.             │
           │                          │                  │                                                               │
           │                          │                  │ The error code values are negative, and event state values    │
           │                          │                  │ are positive. The event state values are ordered from the     │
           │                          │                  │ largest value (CL_QUEUED) for the first or initial state to   │
           │                          │                  │ the smallest value (CL_COMPLETE or negative integer value)    │
           │                          │                  │ for the last or complete state. The value of CL_COMPLETE and  │
           │                          │                  │ CL_SUCCESS are the same.                                      │
           ├──────────────────────────┼──────────────────┼───────────────────────────────────────────────────────────────┤
           │ CL_EVENT_REFERENCE_COUNT │ cl_uint          │ Return the event reference count. The reference count         │
           │                          │                  │ returned should be considered immediately stale. It is        │
           │                          │                  │ unsuitable for general use in applications.  This feature is  │
           │                          │                  │ provided for identifying memory leaks.                        │
           └──────────────────────────┴──────────────────┴───────────────────────────────────────────────────────────────┘

See Also

clReleaseEvent(3clc), clRetainEvent(3clc), clWaitForEvents(3clc), cl_khr_gl_event(3clc)

Specification

OpenCLSpecification[1]

See Also