<div>OpenCL Spec Says:</div><div><br></div><div>The life span of an OpenCL object is determined by its reference count—an internal count of the number of references to the object. When you create an object in OpenCL,</div>
<div>its reference count is set to one. Subsequent calls to the appropriate retain API (such as clRetainContext, clRetainCommandQueue) increment the reference count. Calls to</div><div>the appropriate release API (such as clReleaseContext, clReleaseCommandQueue) decrement the reference count. After the reference count reaches zero, the object’s resources are</div>
<div>deallocated by OpenCL.</div><div><br></div><div>So i think those cannot be free when process exit... </div><div><br></div><div>rightnow i just use destructor function attribute as suggested by andrea .. it solves my problem..</div>
<div><br></div><div>Also when i am using opencl profiler to profile some pixman tests, sometime my profiling results are not save.. (one possible reasons it says opencl resource are not freed properly)</div><div><br></div>
<div><br></div><div><br></div><div class="gmail_quote">On Tue, Nov 2, 2010 at 9:02 PM, Soeren Sandmann <span dir="ltr">&lt;<a href="mailto:sandmann@daimi.au.dk">sandmann@daimi.au.dk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">kb pachauri &lt;<a href="mailto:kb.pachauri@gmail.com">kb.pachauri@gmail.com</a>&gt; writes:<br>
<br>
&gt; Actually what i mean for freeing memory is .. freeing the opencl context,<br>
&gt; releasing command queue, all opencl kernels etc...<br>
&gt;<br>
&gt; sorry for not too clear in my words..<br>
&gt;<br>
&gt; I dont think this will be freed until i free the context..<br>
<br>
</div>But why do you want to free it? Don&#39;t these things get freed when the<br>
process exits?<br>
<br>
<br>
Soren<br>
</blockquote></div><br><br clear="all"><br>-- <br>Kulbhushan Pachauri<br>Lead Engineer<br>SAIT-India Lab<br>Samsung India Software Operation Pvt. Ltd.<br>Bangalore-560093<br>