OpenCL Programming Guide-9.2 Event objects, events generated on the host, events that affect execution on the host

event object

Let’s further analyze the incident itself. Events are objects. Similar to all other objects in OpenCL, we define 3 functions to manage these objects:

clGetEventInfo
clRetainEvent
clReleaseEvent

The following function increments the reference count of the specified event object:

cl_int clRetainEvent(cl_event event)

Note that any OpenCL command that returns an event will implicitly call a reserved function on this event.

If the function executes successfully, clRetainEvent() returns CL_SUCCESS; otherwise, it returns one of the following errors.

CL_INVALID_EVENT : 这个事件不是一个合法的事件对象
CL_OUT_OF_RESOURCES : 在设备上分配OpenCL实现所需要的资源时失败
CL_OUT_OF_HOST_MEMORY : 在宿主机上分配OpenCL实现所需要的资源时失败

To release an event, use the following function:

cl_int clReleaseEvent

Guess you like

Origin blog.csdn.net/qq_36314864/article/details/132558440