<?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 offline/online opencl compilation difference in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/offline-online-opencl-compilation-difference/m-p/1036055#M3697</link>
    <description>&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Dear Community Members!&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I have a program, which makes some calculations with the help of the opencl kernel, which runs on the cpu. I also make these calculations &amp;nbsp;without opencl and check for errors.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;The problem is that I get errors from time to time, when I use online compilation of opencl kernel. I don't get errors, when I use offline compilation.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Could anyone, please, help me and explain, why it happens?&lt;/P&gt;

&lt;P&gt;You can find files here:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://github.com/NataAb/opencl_pr1" target="_blank"&gt;https://github.com/NataAb/opencl_pr1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;ioc64 -cmd=build -input=prog1.cl -device=cpu -ir=prog1.bc&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;for offline comilation.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="code-java" style="margin-top: 0px; margin-bottom: 0px; padding: 0px; max-height: 30em; overflow: auto; white-space: pre-wrap; word-wrap: normal; color: rgb(51, 51, 51); font-size: 12px; line-height: 15.9999990463257px; background-color: rgb(245, 245, 245);"&gt;Platform: Intel(R) OpenCL
Vendor: Intel(R) Corporation
Version: OpenCL 1.2 LINUX&lt;/PRE&gt;

&lt;P&gt;&lt;SPAN style="color: rgb(51, 51, 51); font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 12px; line-height: 15.9999990463257px; white-space: pre-wrap; background-color: rgb(245, 245, 245);"&gt;CPU: Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="color: rgb(51, 51, 51); font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 12px; line-height: 15.9999990463257px; white-space: pre-wrap; background-color: rgb(245, 245, 245);"&gt;OS: &lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Ubuntu 12.04.5 LTS&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2015 13:27:28 GMT</pubDate>
    <dc:creator>Natalia_A_</dc:creator>
    <dc:date>2015-03-05T13:27:28Z</dc:date>
    <item>
      <title>offline/online opencl compilation difference</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/offline-online-opencl-compilation-difference/m-p/1036055#M3697</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Dear Community Members!&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I have a program, which makes some calculations with the help of the opencl kernel, which runs on the cpu. I also make these calculations &amp;nbsp;without opencl and check for errors.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;The problem is that I get errors from time to time, when I use online compilation of opencl kernel. I don't get errors, when I use offline compilation.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Could anyone, please, help me and explain, why it happens?&lt;/P&gt;

&lt;P&gt;You can find files here:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://github.com/NataAb/opencl_pr1" target="_blank"&gt;https://github.com/NataAb/opencl_pr1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;ioc64 -cmd=build -input=prog1.cl -device=cpu -ir=prog1.bc&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;for offline comilation.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="code-java" style="margin-top: 0px; margin-bottom: 0px; padding: 0px; max-height: 30em; overflow: auto; white-space: pre-wrap; word-wrap: normal; color: rgb(51, 51, 51); font-size: 12px; line-height: 15.9999990463257px; background-color: rgb(245, 245, 245);"&gt;Platform: Intel(R) OpenCL
Vendor: Intel(R) Corporation
Version: OpenCL 1.2 LINUX&lt;/PRE&gt;

&lt;P&gt;&lt;SPAN style="color: rgb(51, 51, 51); font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 12px; line-height: 15.9999990463257px; white-space: pre-wrap; background-color: rgb(245, 245, 245);"&gt;CPU: Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="color: rgb(51, 51, 51); font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 12px; line-height: 15.9999990463257px; white-space: pre-wrap; background-color: rgb(245, 245, 245);"&gt;OS: &lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Ubuntu 12.04.5 LTS&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2015 13:27:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/offline-online-opencl-compilation-difference/m-p/1036055#M3697</guid>
      <dc:creator>Natalia_A_</dc:creator>
      <dc:date>2015-03-05T13:27:28Z</dc:date>
    </item>
    <item>
      <title>Hi Natalia,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/offline-online-opencl-compilation-difference/m-p/1036056#M3698</link>
      <description>&lt;P&gt;Hi Natalia,&lt;/P&gt;

&lt;P&gt;I tried your program on Windows 8.1 with the latest OpenCL driver and things consistently fail with either off-line or online compilation:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Online compilation:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;TEST &amp;nbsp;started&lt;BR /&gt;
	16 &amp;nbsp;started&lt;BR /&gt;
	i is 0 j is 2 x_1 is -0.010763 ar1 1.60594e+032&lt;BR /&gt;
	16 Compare results failed at step = 5, errors = 1&lt;/P&gt;

&lt;P&gt;TEST &amp;nbsp;started&lt;BR /&gt;
	16 &amp;nbsp;started&lt;BR /&gt;
	i is 12 j is 7 x_1 is -0.0522771 ar1 -0.042029&lt;BR /&gt;
	16 Compare results failed at step = 956, errors = 1&lt;/P&gt;

&lt;P&gt;TEST &amp;nbsp;started&lt;BR /&gt;
	16 &amp;nbsp;started&lt;BR /&gt;
	i is 12 j is 7 x_1 is -0.0513037 ar1 -0.0410118&lt;BR /&gt;
	16 Compare results failed at step = 958, errors = 1&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&lt;STRONG&gt;Offline compilation&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;TEST &amp;nbsp;started&lt;BR /&gt;
	allowed workgroup size is 4096&lt;BR /&gt;
	16 &amp;nbsp;started&lt;BR /&gt;
	i is 12 j is 7 x_1 is -0.0522771 ar1 -0.0421079&lt;BR /&gt;
	16 Compare results failed at step = 956, errors = 1&lt;/P&gt;

&lt;P&gt;TEST &amp;nbsp;started&lt;BR /&gt;
	allowed workgroup size is 4096&lt;BR /&gt;
	16 &amp;nbsp;started&lt;BR /&gt;
	i is 12 j is 7 x_1 is -0.0513037 ar1 -0.0410526&lt;BR /&gt;
	16 Compare results failed at step = 958, errors = 1&lt;/P&gt;

&lt;P&gt;TEST &amp;nbsp;started&lt;BR /&gt;
	allowed workgroup size is 4096&lt;BR /&gt;
	16 &amp;nbsp;started&lt;BR /&gt;
	i is 0 j is 2 x_1 is -0.000729849 ar1 1.60594e+032&lt;BR /&gt;
	16 Compare results failed at step = 0, errors = 1&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;So I guess the problem is with the code itself.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2015 19:31:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/offline-online-opencl-compilation-difference/m-p/1036056#M3698</guid>
      <dc:creator>Robert_I_Intel</dc:creator>
      <dc:date>2015-03-05T19:31:47Z</dc:date>
    </item>
    <item>
      <title>Dear Robert,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/offline-online-opencl-compilation-difference/m-p/1036057#M3699</link>
      <description>&lt;P&gt;Dear Robert,&lt;/P&gt;

&lt;P&gt;thank you for you quick answer!&lt;/P&gt;

&lt;P&gt;As you can see, the test fails on some random step, which means, that the kernel works correct in some cases. &amp;nbsp;May incorrect use of&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN class="pl-s3" style="box-sizing: border-box; color: rgb(0, 134, 179); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 11.9999990463257px; line-height: 18.6666660308838px; white-space: pre;"&gt;barrier&lt;/SPAN&gt;&lt;SPAN style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 11.9999990463257px; line-height: 18.6666660308838px; white-space: pre;"&gt;( CLK_LOCAL_MEM_FENCE| CLK_GLOBAL_MEM_FENCE); &lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="color: rgb(51, 51, 51); font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 11.9999990463257px; line-height: 18.6666660308838px; white-space: pre;"&gt;cause such strange behaviour?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2015 21:31:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/offline-online-opencl-compilation-difference/m-p/1036057#M3699</guid>
      <dc:creator>Natalia_A_</dc:creator>
      <dc:date>2015-03-05T21:31:00Z</dc:date>
    </item>
    <item>
      <title>Dear Natalia,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/offline-online-opencl-compilation-difference/m-p/1036058#M3700</link>
      <description>&lt;P&gt;Dear Natalia,&lt;/P&gt;

&lt;P&gt;By cursory look at your kernel, looks like barriers are in the right places. Unfortunately, with complex code like this the only option is to use printf all over the place and carefully compare results of intermediate calculations with what you are expecting. The errors don't appear quite so random to me, for example they frequently occur at i = 12, j = 7 and i = 0, j = 2. Also, you get two types of dicrepancies: one looks like an overflow, which always occurs at i=0, j=2, the other looks like an accumulation of error issue. Also note, that the issues are at i=0 and i=12, which are boundaries, so I would carefully check the boundaries of your local arrays and see that you are initializing everything properly.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2015 22:16:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/offline-online-opencl-compilation-difference/m-p/1036058#M3700</guid>
      <dc:creator>Robert_I_Intel</dc:creator>
      <dc:date>2015-03-05T22:16:45Z</dc:date>
    </item>
    <item>
      <title>Dear Robert, I think, I have</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/offline-online-opencl-compilation-difference/m-p/1036059#M3701</link>
      <description>&lt;P&gt;Dear Robert, I think, I have found the answer. The &amp;nbsp;error occured due to the following reason: &amp;nbsp;I did not initialized part of local memory with zeroes.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thank you for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 15:58:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/offline-online-opencl-compilation-difference/m-p/1036059#M3701</guid>
      <dc:creator>Natalia_A_</dc:creator>
      <dc:date>2015-03-11T15:58:20Z</dc:date>
    </item>
  </channel>
</rss>

