'\" t .\" Title: clSetUserEventStatus .\" Author: The Khronos Group .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 01/14/2021 .\" Manual: OpenCL Manual .\" Source: The Khronos Group .\" Language: English .\" .TH "CLSETUSEREVENTSTATUS" "3clc" "01/14/2021" "The Khronos Group" "OpenCL Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" clSetUserEventStatus \- Sets the execution status of a user event object\&. .SH "" .HP \w'cl_int\ clSetUserEventStatus('u .BI "cl_int clSetUserEventStatus(cl_event\ " "event" ", cl_int\ " "execution_status" ");" .SH "PARAMETERS" .PP \fIevent\fR .RS 4 A user event object created using \fBclCreateUserEvent\fR(3clc)\&. .RE .PP \fIexecution_status\fR .RS 4 Specifies the new execution status to be set and can be \fBCL_COMPLETE\fR 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\&. \fBclSetUserEventStatus\fR can only be called once to change the execution status of \fIevent\fR\&. .RE .SH "NOTES" .PP Enqueued commands that specify user events in the \fIevent_wait_list\fR argument of \fBclEnqueue***\fR commands must ensure that the status of these user events being waited on are set using \fBclSetUserEventStatus\fR before any OpenCL APIs that release OpenCL objects except for event objects are called; otherwise the behavior is undefined\&. .SH "ERRORS" .PP Returns CL_SUCCESS if the function was executed successfully\&. Otherwise, it returns one of the following errors .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_EVENT if \fIevent\fR is not a valid user event\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_VALUE if the \fIexecution_status\fR is not \fBCL_COMPLETE\fR or a negative integer value\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_OPERATION if the \fIexecution_status\fR for \fIevent\fR has already been changed by a previous call to \fBclSetUserEventStatus\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host\&. .RE .SS "Example" .PP For example, the following code sequence will result in undefined behavior of \fBclReleaseMemObject\fR(3clc)\&. .TS tab(:); l. T{ ev1 = clCreateUserEvent(ctx, NULL); clEnqueueWriteBuffer(cq, buf1, CL_FALSE, \&.\&.\&., 1, &ev1, NULL; clEnqueueWriteBuffer(cq, buf2, CL_FALSE,\&.\&.\&.); clReleaseMemObject(buf2); clSetUserEventStatus(ev1, CL_COMPLETE); T} .TE .sp 1 .PP The following code sequence, however, works correctly\&. .TS tab(:); l. T{ ev1 = clCreateUserEvent(ctx, NULL); clEnqueueWriteBuffer(cq, buf1, CL_FALSE, \&.\&.\&., 1, &ev1, NULL; clEnqueueWriteBuffer(cq, buf2, CL_FALSE,\&.\&.\&.); clSetUserEventStatus(ev1, CL_COMPLETE); clReleaseMemObject(buf2); T} .TE .sp 1 .SH "SPECIFICATION" .PP \m[blue]\fBOpenCL Specification\fR\m[]\&\s-2\u[1]\d\s+2 .SH "SEE ALSO" .PP \fBclCreateUserEvent\fR(3clc) .SH "AUTHORS" .PP \fBThe Khronos Group\fR .SH "COPYRIGHT" .br Copyright \(co 2007-2011 The Khronos Group Inc. .br 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. .sp .SH "NOTES" .IP " 1." 4 OpenCL Specification .RS 4 \%page 178, section 5.9 - Event Objects .RE