<?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 Simple OpenCL program fails eventually due to memory leak in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Simple-OpenCL-program-fails-eventually-due-to-memory-leak/m-p/393784#M57554</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using imx6 quad, running Windows Embedded Compact 7 (aka WEC7, Windows CE 7, CE7). The BSP came from Adeneo.&lt;/P&gt;&lt;P&gt;I have found what I believe is a memory leak in the OpenCL software stack. A very simple Vector_Add program runs in a loop ~8000 times and fails with CL error -6.&lt;/P&gt;&lt;P&gt;This file is attached. The .cl file is also attached. &lt;/P&gt;&lt;P&gt;If anyone is an expert in OpenCL and can spot a fault with the Vector_Add program, let me know.&lt;/P&gt;&lt;P&gt;Otherwise, if the problem looks to be in the OpenCL software stack, what is the support model? &lt;BR /&gt;How do I get this fixed?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;andyp&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-336949"&gt;vector_add_kernel.cl.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-336949"&gt;Vector_Add1.cpp.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Apr 2015 17:05:33 GMT</pubDate>
    <dc:creator>andyp</dc:creator>
    <dc:date>2015-04-30T17:05:33Z</dc:date>
    <item>
      <title>Simple OpenCL program fails eventually due to memory leak</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Simple-OpenCL-program-fails-eventually-due-to-memory-leak/m-p/393784#M57554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using imx6 quad, running Windows Embedded Compact 7 (aka WEC7, Windows CE 7, CE7). The BSP came from Adeneo.&lt;/P&gt;&lt;P&gt;I have found what I believe is a memory leak in the OpenCL software stack. A very simple Vector_Add program runs in a loop ~8000 times and fails with CL error -6.&lt;/P&gt;&lt;P&gt;This file is attached. The .cl file is also attached. &lt;/P&gt;&lt;P&gt;If anyone is an expert in OpenCL and can spot a fault with the Vector_Add program, let me know.&lt;/P&gt;&lt;P&gt;Otherwise, if the problem looks to be in the OpenCL software stack, what is the support model? &lt;BR /&gt;How do I get this fixed?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;andyp&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-336949"&gt;vector_add_kernel.cl.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-336949"&gt;Vector_Add1.cpp.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2015 17:05:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Simple-OpenCL-program-fails-eventually-due-to-memory-leak/m-p/393784#M57554</guid>
      <dc:creator>andyp</dc:creator>
      <dc:date>2015-04-30T17:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Simple OpenCL program fails eventually due to memory leak</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Simple-OpenCL-program-fails-eventually-due-to-memory-leak/m-p/393785#M57555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Deactivated user, could you please comment?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2015 14:26:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Simple-OpenCL-program-fails-eventually-due-to-memory-leak/m-p/393785#M57555</guid>
      <dc:creator>CarlosCasillas</dc:creator>
      <dc:date>2015-05-04T14:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: Simple OpenCL program fails eventually due to memory leak</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Simple-OpenCL-program-fails-eventually-due-to-memory-leak/m-p/393786#M57556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I added some more checking to my simple OpenCL program.&lt;/P&gt;&lt;P&gt;The checking looked at the reference count for all the OpenCL data structures created with the clCreate* API's. This includes the context, kernel, program, memory buffers, etc.&lt;/P&gt;&lt;P&gt;I found a surprising reference count = 2 for both the kernel object and the program object.&lt;/P&gt;&lt;P&gt;Could there be an implicit increment of the ref count for these 2 objects? &lt;/P&gt;&lt;P&gt;I modified the program to do 2 clReleaseProgram(...) calls and do 2 clReleaseKernel(...) calls each time through the loop. &lt;/P&gt;&lt;P&gt;Now I am retesting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2015 16:13:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Simple-OpenCL-program-fails-eventually-due-to-memory-leak/m-p/393786#M57556</guid>
      <dc:creator>andyp</dc:creator>
      <dc:date>2015-05-04T16:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: Simple OpenCL program fails eventually due to memory leak</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Simple-OpenCL-program-fails-eventually-due-to-memory-leak/m-p/393787#M57557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Program still eventually fails. Still feels like something wrong with the OpenCL software stack.&lt;/P&gt;&lt;P&gt;I will try to add an attachment for the modified OpenCL program.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2015 16:25:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Simple-OpenCL-program-fails-eventually-due-to-memory-leak/m-p/393787#M57557</guid>
      <dc:creator>andyp</dc:creator>
      <dc:date>2015-05-04T16:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Simple OpenCL program fails eventually due to memory leak</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Simple-OpenCL-program-fails-eventually-due-to-memory-leak/m-p/393788#M57558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;More investigation and characterization of the OpenCL memory leak bug reveals that if clCreateContext() is called once, and clReleaseContext() is never called, then the program runs correctly without a memory leak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My conclusion is that the problem is with clReleaseContext().&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Jun 2015 17:21:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Simple-OpenCL-program-fails-eventually-due-to-memory-leak/m-p/393788#M57558</guid>
      <dc:creator>andyp</dc:creator>
      <dc:date>2015-06-17T17:21:33Z</dc:date>
    </item>
  </channel>
</rss>

