<?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 Here is at least part of an in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045575#M3972</link>
    <description>&lt;P&gt;Here is at least part of an answer:&lt;/P&gt;

&lt;P&gt;For 5th Generation Core (Broadwell) and forward, SPIR should work as expected in 32 and 64 bit mode.&amp;nbsp; Use 32 bit SPIR with 32 bit executables and 64 bit SPIR with 64 bit executables.&amp;nbsp; Going forward this expected pattern should continue.&lt;/P&gt;

&lt;P&gt;However, for earlier platforms before full SVM support there are some exceptions:&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;For 4th Generation Core (Haswell): only 64 bit SPIR is supported&lt;/LI&gt;
	&lt;LI&gt;For Atom processors so far: only 32 bit SPIR is supported&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;CL_DEVICE_ADDRESS_BITS should be a reliable indicator of what is supported.&amp;nbsp; This will report 32 or 64 based on your system.&amp;nbsp; This should include the behavior described above.&amp;nbsp; For example, on Haswell processors&amp;nbsp;CL_DEVICE_ADDRESS_BITS should always return 64, on Broadwell and newer it will reflect how the executable was compiled.&lt;/P&gt;

&lt;P&gt;If you generate 32 and 64 bit SPIR, applications can check CL_DEVICE_ADDRESS_BITS and load the version indicated.&lt;/P&gt;

&lt;P&gt;Are you seeing any behavior that does not fit this pattern?&lt;/P&gt;</description>
    <pubDate>Fri, 02 Sep 2016 05:34:18 GMT</pubDate>
    <dc:creator>Jeffrey_M_Intel1</dc:creator>
    <dc:date>2016-09-02T05:34:18Z</dc:date>
    <item>
      <title>GPU HD4600 opencl kernel problem</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045566#M3963</link>
      <description>&lt;P&gt;Hi, i am compiling offline spir kernel.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;When i use it on HD4600 GPU i get the following when I invoke clBuildProgram&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;error: IGILTargetLowering::Call(): unhandled function call!&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Call made to: _Z13get_global_idj()&lt;BR /&gt;
	0x7c53480: i64 = GlobalAddress&amp;lt;i64 (i32)* @_Z13get_global_idj&amp;gt; 0 [ORD=1]&lt;BR /&gt;
	error: midlevel compiler failed build.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;The same kernel works fine on amd gpu and on intel cpu. Also works fine if the kernel is compiled as spir64&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;kernel void kernel_main(const global read_only uint8_t* rgb_t, global write_only uint8_t* grayscale, const image_kernel_info src, const image_kernel_info dst)&lt;BR /&gt;
	{&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; uint32_t x = get_global_id(0);&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; uint32_t y = get_global_id(1);&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; if (is_in_interior(&amp;amp;src, x, y))&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; const global rgb* rgb_ = (const global rgb*) sample_2d_clamp(rgb_t, &amp;amp;src, x, y, sizeof( rgb ) );&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; float &amp;nbsp;r = rgb_-&amp;gt;r / 255.0f;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; float &amp;nbsp;g = rgb_-&amp;gt;g / 255.0f;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; float &amp;nbsp;b = rgb_-&amp;gt;b / 255.0f;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; float &amp;nbsp;gray = 0.2989f * (r &amp;nbsp;* r) + 0.5870f * (g * &amp;nbsp;g) + 0.1140f * (b &amp;nbsp;* &amp;nbsp;b);&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; uint8_t &amp;nbsp;gray_quantized = (uint8_t ) (sqrt(gray) * 255.0f);&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; write_2d_uint8( grayscale, &amp;amp;dst, x, y, gray_quantized);&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;
	}&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Aug 2015 12:21:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045566#M3963</guid>
      <dc:creator>SDyul</dc:creator>
      <dc:date>2015-08-09T12:21:06Z</dc:date>
    </item>
    <item>
      <title>Hi Stefan,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045567#M3964</link>
      <description>&lt;P&gt;Hi Stefan,&lt;/P&gt;

&lt;P&gt;Could you please provide the whole file, not just the kernel? You have a number of things used within the kernel that are not defined.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 16:57:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045567#M3964</guid>
      <dc:creator>Robert_I_Intel</dc:creator>
      <dc:date>2015-08-10T16:57:23Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045568#M3965</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have uploaded the project here:&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&lt;A href="https://github.com/kingofthebongo2008/dare12_opencl/tree/master/src/opencl" target="_blank"&gt;https://github.com/kingofthebongo2008/dare12_opencl/tree/master/src/opencl&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;You can check it out.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Also the kernel works fine if i do not use&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 12px;"&gt;get_global_id&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Seems to me it just cannot find the symbols for 32bit spirs. Seems to me that spir32 bit code, generates function signatures for spir64.&lt;/P&gt;

&lt;P&gt;The problem most probably is in the spir clang version.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2015 06:08:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045568#M3965</guid>
      <dc:creator>SDyul</dc:creator>
      <dc:date>2015-08-11T06:08:11Z</dc:date>
    </item>
    <item>
      <title>Hi Stefan,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045569#M3966</link>
      <description>&lt;P&gt;Hi Stefan,&lt;/P&gt;

&lt;P&gt;I think I realized what is going on: you are probably trying to feed SPIR32 binary to run it on the Intel GPU. Please read my article on SPIR &lt;FONT size="2"&gt;&lt;A href="https://software.intel.com/en-us/articles/using-spir-for-fun-and-profit-with-intel-opencl-code-builder"&gt;https://software.intel.com/en-us/articles/using-spir-for-fun-and-profit-with-intel-opencl-code-builder&lt;/A&gt; - it will explain what you need to do. Basically, if you have a 32-bit program, you will need SPIR32 binary to run on CPU OpenCL and SPIR64 binary to run on the GPU OpenCL. Feeding SPIR32 binary to GPU will produce the error you describe.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2015 17:19:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045569#M3966</guid>
      <dc:creator>Robert_I_Intel</dc:creator>
      <dc:date>2015-08-11T17:19:17Z</dc:date>
    </item>
    <item>
      <title>I thought these things were</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045570#M3967</link>
      <description>&lt;P&gt;I thought these things were supported 32 host / 32 device.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;thanks for your help. I moved to 64bit everything and now seems to be fine on intel.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2015 20:16:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045570#M3967</guid>
      <dc:creator>SDyul</dc:creator>
      <dc:date>2015-08-11T20:16:22Z</dc:date>
    </item>
    <item>
      <title>Hi Robert,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045571#M3968</link>
      <description>&lt;P&gt;Hi Robert,&lt;/P&gt;

&lt;P&gt;Got the exact error on HD4600. The same code works fine on HD530. I'm using SPIR32 and -device=gpu. SPIR64 doesn't work with HD530 (clBuildProgram failed with error code CL_INVALID_BINARY).&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Aug 2016 02:20:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045571#M3968</guid>
      <dc:creator>Oleg_G_</dc:creator>
      <dc:date>2016-08-20T02:20:51Z</dc:date>
    </item>
    <item>
      <title>Hi Robert,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045572#M3969</link>
      <description>&lt;P&gt;Hi Robert,&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Robert I. (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I think I realized what is going on: you are probably trying to feed SPIR32 binary to run it on the Intel GPU. Please read my article on SPIR &lt;A href="https://software.intel.com/en-us/articles/using-spir-for-fun-and-profit-with-intel-opencl-code-builder"&gt;https://software.intel.com/en-us/articles/using-spir-for-fun-and-profit-with-intel-opencl-code-builder&lt;/A&gt; - it will explain what you need to do. Basically, if you have a 32-bit program, you will need SPIR32 binary to run on CPU OpenCL and SPIR64 binary to run on the GPU OpenCL. Feeding SPIR32 binary to GPU will produce the error you describe.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;It seems to me that rules have changed. Or maybe this is a bug? It is possible to run win32 application on HD 530 only if opencl binary was made with SPIR32 flag. In case of SPIR64 clBuildProgram fails with error code CL_INVALID_BINARY.&lt;/P&gt;

&lt;P&gt;At the same time on HD 4600 win32 application works only with SPIR64 binary. SPIR32 produce error as described in first message of this thread.&lt;/P&gt;

&lt;P&gt;It is very inconvenient. How should i select SPIR binary according to GPU adapter? Besides, AMD can utilize both SPIR32 and SPIR64 no matter for what platform application was written for. Why Intel can't do the same?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2016 08:47:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045572#M3969</guid>
      <dc:creator>Oleg_G_</dc:creator>
      <dc:date>2016-08-25T08:47:00Z</dc:date>
    </item>
    <item>
      <title>Hello Intel,</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045573#M3970</link>
      <description>&lt;P&gt;Hello Intel,&lt;/P&gt;

&lt;P&gt;Is that really so:&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Intel monitors this forum Monday – Friday, 09:00 – 17:00 Pacific Time (GMT –7:00). Depending on the amount of research we need to do to track down the answer, it may &lt;STRONG&gt;take a day or two&lt;/STRONG&gt; for us to respond.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Desperately need the answer to my question.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 02:43:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045573#M3970</guid>
      <dc:creator>Oleg_G_</dc:creator>
      <dc:date>2016-09-01T02:43:58Z</dc:date>
    </item>
    <item>
      <title>Sorry for the delay.  It can</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045574#M3971</link>
      <description>&lt;P&gt;Sorry for the delay. &amp;nbsp;It can be easier to see when answers are needed for new threads than continuations of old ones. &amp;nbsp;Definitely understand that inconsistent behavior would be frustrating. &amp;nbsp;I hope to have more details tomorrow.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 05:16:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045574#M3971</guid>
      <dc:creator>Jeffrey_M_Intel1</dc:creator>
      <dc:date>2016-09-01T05:16:47Z</dc:date>
    </item>
    <item>
      <title>Here is at least part of an</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045575#M3972</link>
      <description>&lt;P&gt;Here is at least part of an answer:&lt;/P&gt;

&lt;P&gt;For 5th Generation Core (Broadwell) and forward, SPIR should work as expected in 32 and 64 bit mode.&amp;nbsp; Use 32 bit SPIR with 32 bit executables and 64 bit SPIR with 64 bit executables.&amp;nbsp; Going forward this expected pattern should continue.&lt;/P&gt;

&lt;P&gt;However, for earlier platforms before full SVM support there are some exceptions:&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;For 4th Generation Core (Haswell): only 64 bit SPIR is supported&lt;/LI&gt;
	&lt;LI&gt;For Atom processors so far: only 32 bit SPIR is supported&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;CL_DEVICE_ADDRESS_BITS should be a reliable indicator of what is supported.&amp;nbsp; This will report 32 or 64 based on your system.&amp;nbsp; This should include the behavior described above.&amp;nbsp; For example, on Haswell processors&amp;nbsp;CL_DEVICE_ADDRESS_BITS should always return 64, on Broadwell and newer it will reflect how the executable was compiled.&lt;/P&gt;

&lt;P&gt;If you generate 32 and 64 bit SPIR, applications can check CL_DEVICE_ADDRESS_BITS and load the version indicated.&lt;/P&gt;

&lt;P&gt;Are you seeing any behavior that does not fit this pattern?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 05:34:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045575#M3972</guid>
      <dc:creator>Jeffrey_M_Intel1</dc:creator>
      <dc:date>2016-09-02T05:34:18Z</dc:date>
    </item>
    <item>
      <title>Quote:Jeffrey M. (Intel)</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045576#M3973</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Jeffrey M. (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Are you seeing any behavior that does not fit this pattern?&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;It works fine for me. But I tried it only on 530 and 4600. I hope that proposed method is universal. Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 12:52:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/GPU-HD4600-opencl-kernel-problem/m-p/1045576#M3973</guid>
      <dc:creator>Oleg_G_</dc:creator>
      <dc:date>2016-09-02T12:52:16Z</dc:date>
    </item>
  </channel>
</rss>

