<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic chapter 5.4.1 OpenCL 1.2: in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/clSetMemObjectDestructorCallback-calls-callback-with-invalid-mem/m-p/982985#M2598</link>
    <description>&lt;P&gt;chapter 5.4.1 OpenCL 1.2:&lt;/P&gt;
&lt;P&gt;"memobj &lt;I&gt;is the memory object being deleted. When the user callback is called by the &lt;/I&gt;implementation, this memory object is not longer valid.&lt;I&gt;memobj &lt;/I&gt;is only provided for reference purposes."&lt;/P&gt;
&lt;P&gt;Implementation calls the callback AFTER releasing all internal resources in order to allow user to free the memory used for data. The memobj handle is provided solely for easing lookup process in user data structure in case user used this handle as a key.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 25 Aug 2013 07:53:25 GMT</pubDate>
    <dc:creator>Dmitry_K_Intel</dc:creator>
    <dc:date>2013-08-25T07:53:25Z</dc:date>
    <item>
      <title>clSetMemObjectDestructorCallback calls callback with invalid mem_obj</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/clSetMemObjectDestructorCallback-calls-callback-with-invalid-mem/m-p/982983#M2596</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I wrote a little wrapper for clMemoryObjects in which I set a callback for buffer/memory destruction via clSetMemObjectDestructorCallback (actually it's the C++ wrapper equivalent).&lt;/P&gt;
&lt;P&gt;When the callback is called, however, and I want to query the cl_mem, which is passed to the callback by the API, I sometimes get an error code Of "-38" -&amp;gt; CL_INVALID_MEM_OBJECT. The application is basically single threaded, so I don't see, where the object should have been destroyed elswhere.&lt;/P&gt;
&lt;P&gt;I am also using other OpenCL platforms, in which the code workd properly, so I'm wondering where to look next for my bug.&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Matthias&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2013 02:01:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/clSetMemObjectDestructorCallback-calls-callback-with-invalid-mem/m-p/982983#M2596</guid>
      <dc:creator>Matthias_H_4</dc:creator>
      <dc:date>2013-08-25T02:01:56Z</dc:date>
    </item>
    <item>
      <title>Please see end of chapter 5.4</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/clSetMemObjectDestructorCallback-calls-callback-with-invalid-mem/m-p/982984#M2597</link>
      <description>&lt;P&gt;Please see end of chapter 5.4.1 at OpenCL 1.2 specification; it says:&lt;/P&gt;
&lt;P&gt;"&amp;nbsp;The user callback function may not call OpenCL APIs with the memory object for which the&amp;nbsp;callback function is invoked and for such cases the behavior of OpenCL APIs is considered to be&amp;nbsp;undefined."&lt;/P&gt;
&lt;P&gt;So i conclude that the behaviour your are getting is expected. Callback registration is mainly for releasing resources that have been used for the memory object creation and been provided to the OpenCL framework; and this callback hints that it's fine now to release them.&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2013 05:46:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/clSetMemObjectDestructorCallback-calls-callback-with-invalid-mem/m-p/982984#M2597</guid>
      <dc:creator>Rami_J_Intel</dc:creator>
      <dc:date>2013-08-25T05:46:47Z</dc:date>
    </item>
    <item>
      <title>chapter 5.4.1 OpenCL 1.2:</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/clSetMemObjectDestructorCallback-calls-callback-with-invalid-mem/m-p/982985#M2598</link>
      <description>&lt;P&gt;chapter 5.4.1 OpenCL 1.2:&lt;/P&gt;
&lt;P&gt;"memobj &lt;I&gt;is the memory object being deleted. When the user callback is called by the &lt;/I&gt;implementation, this memory object is not longer valid.&lt;I&gt;memobj &lt;/I&gt;is only provided for reference purposes."&lt;/P&gt;
&lt;P&gt;Implementation calls the callback AFTER releasing all internal resources in order to allow user to free the memory used for data. The memobj handle is provided solely for easing lookup process in user data structure in case user used this handle as a key.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2013 07:53:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/clSetMemObjectDestructorCallback-calls-callback-with-invalid-mem/m-p/982985#M2598</guid>
      <dc:creator>Dmitry_K_Intel</dc:creator>
      <dc:date>2013-08-25T07:53:25Z</dc:date>
    </item>
    <item>
      <title>Classical case of "Read first</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/clSetMemObjectDestructorCallback-calls-callback-with-invalid-mem/m-p/982986#M2599</link>
      <description>&lt;P&gt;Classical case of "Read first - then ask" ...&lt;/P&gt;
&lt;P&gt;Thank you for the quick and profound answers!&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2013 08:57:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/clSetMemObjectDestructorCallback-calls-callback-with-invalid-mem/m-p/982986#M2599</guid>
      <dc:creator>Matthias_H_4</dc:creator>
      <dc:date>2013-08-25T08:57:14Z</dc:date>
    </item>
  </channel>
</rss>

