---
name: "clGetEventInfo"
section: "3clc"
platform: "linux"
package: "opencl-1.2-man-doc"
version: "1.0~svn33624-5.1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/clGetEventInfo"
---

# clGetEventInfo(3clc)

Returns information about the event object.

## NAME

clGetEventInfo - Returns information about the event object.

##

**cl\_int clGetEventInfo(cl\_event** *event***, cl\_event\_info** *param\_name***, size\_t** *param\_value\_size***, void \****param\_value***, size\_t \****param\_value\_size\_ret***);**

## 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\_info** | **Return Type** | **Information returned in *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)](/cl_khr_gl_event/3clc.md) is enabled) **CL\_COMMAND\_ACQUIRE\_D3D10\_OBJECTS\_KHR** (if [**cl\_khr\_d3d10\_sharing**(3clc)](/cl_khr_d3d10_sharing/3clc.md) is enabled) **CL\_COMMAND\_RELEASE\_D3D10\_OBJECTS\_KHR** (if [**cl\_khr\_d3d10\_sharing**(3clc)](/cl_khr_d3d10_sharing/3clc.md) is enabled) **CL\_COMMAND\_ACQUIRE\_DX9\_MEDIA\_SURFACES\_KHR** (if [**cl\_khr\_dx9\_media\_sharing**(3clc)](/cl_khr_dx9_media_sharing/3clc.md) is enabled) **CL\_COMMAND\_RELEASE\_DX9\_MEDIA\_SURFACES\_KHR** (if [**cl\_khr\_dx9\_media\_sharing**(3clc)](/cl_khr_dx9_media_sharing/3clc.md) is enabled) **CL\_COMMAND\_ACQUIRE\_D3D11\_OBJECTS\_KHR** (if [**cl\_khr\_d3d11\_sharing**(3clc)](/cl_khr_d3d11_sharing/3clc.md) is enabled) **CL\_COMMAND\_RELEASE\_D3D11\_OBJECTS\_KHR** (if [**cl\_khr\_d3d11\_sharing**(3clc)](/cl_khr_d3d11_sharing/3clc.md) is enabled) |
| **CL\_EVENT\_COMMAND\_ EXECUTION\_STATUS** | cl\_int | Return the execution status of the command identified by *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. |

## NOTES

Using **clGetEventInfo** to determine if a command identified by *event* has finished execution (i.e. **CL\_EVENT\_COMMAND\_EXECUTION\_STATUS** returns **CL\_COMPLETE**) is not a synchronization point. There are no guarantees that the memory objects being modified by command associated with *event* will be visible to other enqueued commands.

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

## SPECIFICATION

**OpenCL Specification**\[1\]

## SEE ALSO

[**clReleaseEvent**(3clc)](/clReleaseEvent/3clc.md), [**clRetainEvent**(3clc)](/clRetainEvent/3clc.md), [**clWaitForEvents**(3clc)](/clWaitForEvents/3clc.md), [**cl\_khr\_gl\_event**(3clc)](/cl_khr_gl_event/3clc.md)

## AUTHORS

**The Khronos Group**

## COPYRIGHT

Copyright © 2007-2011 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.

## NOTES

- 1\.

  OpenCL Specification

  page 180, section 5.9 - Event Objects
