'\" t .\" Title: clReleaseEvent .\" Author: The Khronos Group .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 01/14/2021 .\" Manual: OpenCL Manual .\" Source: The Khronos Group .\" Language: English .\" .TH "CLRELEASEEVENT" "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" clReleaseEvent \- Decrements the event reference count\&. .SH "" .HP \w'cl_int\ clReleaseEvent('u .BI "cl_int clReleaseEvent(cl_event\ " "event" ");" .SH "PARAMETERS" .PP \fIevent\fR .RS 4 Event object being released\&. .RE .SH "NOTES" .PP Decrements the \fIevent\fR reference count\&. .PP The event object is deleted once the reference count becomes zero, the specific command identified by this event has completed (or terminated) and there are no commands in the command\-queues of a context that require a wait for this event to complete\&. .PP Developers should be careful when releasing their last reference count on events created by \fBclCreateUserEvent\fR(3clc) that have not yet been set to status of \fBCL_COMPLETE\fR or an error\&. If the user event was used in the \fIevent_wait_list\fR argument passed to a \fBclEnqueue***\fR API or another application host thread is waiting for it in \fBclWaitForEvents\fR(3clc), those commands and host threads will continue to wait for the event status to reach \fBCL_COMPLETE\fR or error, even after the user has released the object\&. Since in this scenario the developer has released his last reference count to the user event, it would be in principle no longer valid for him to change the status of the event to unblock all the other machinery\&. As a result the waiting tasks will wait forever, and associated events, \fBcl_mem\fR objects, command queues and contexts are likely to leak\&. In\-order command queues caught up in this deadlock may cease to do any work\&. .SH "ERRORS" .PP Returns CL_SUCCESS if the function 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 event object\&. .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 .SH "SPECIFICATION" .PP \m[blue]\fBOpenCL Specification\fR\m[]\&\s-2\u[1]\d\s+2 .SH "SEE ALSO" .PP \fBclGetEventInfo\fR(3clc), \fBclRetainEvent\fR(3clc), \fBclWaitForEvents\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 185, section 5.9 - Event Objects .RE