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

clSetUserEventStatus - Sets the execution status of a user event object.

Authors

TheKhronosGroup

Errors

       Returns CL_SUCCESS if the function was executed successfully. Otherwise, it returns one of the following
       errors

       •   CL_INVALID_EVENT if event is not a valid user event.

       •   CL_INVALID_VALUE if the execution_status is not CL_COMPLETE or a negative integer value.

       •   CL_INVALID_OPERATION if the execution_status for event has already been changed by a previous call to
           clSetUserEventStatus.

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

   Example
       For example, the following code sequence will result in undefined behavior of clReleaseMemObject(3clc).
       ev1 = clCreateUserEvent(ctx, NULL);
       clEnqueueWriteBuffer(cq, buf1, CL_FALSE, ..., 1, &ev1,
       NULL; clEnqueueWriteBuffer(cq, buf2, CL_FALSE,...);
       clReleaseMemObject(buf2); clSetUserEventStatus(ev1,
       CL_COMPLETE);

       The following code sequence, however, works correctly.
       ev1 = clCreateUserEvent(ctx, NULL);
       clEnqueueWriteBuffer(cq, buf1, CL_FALSE, ..., 1, &ev1,
       NULL; clEnqueueWriteBuffer(cq, buf2, CL_FALSE,...);
       clSetUserEventStatus(ev1, CL_COMPLETE);
       clReleaseMemObject(buf2);

Name

       clSetUserEventStatus - Sets the execution status of a user event object.

       cl_intclSetUserEventStatus(cl_eventevent,cl_intexecution_status);

Notes

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

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

Parameters

event
           A user event object created using clCreateUserEvent(3clc).

       execution_status
           Specifies the new execution status to be set and can be CL_COMPLETE or a negative integer value to
           indicate an error. A negative integer value causes all enqueued commands that wait on this user event
           to be terminated.  clSetUserEventStatus can only be called once to change the execution status of
           event.

See Also

clCreateUserEvent(3clc)

Specification

OpenCLSpecification[1]

See Also