<?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 Unable to compile openCL kernel for Xeon Phi: LLVM ERROR in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/Unable-to-compile-openCL-kernel-for-Xeon-Phi-LLVM-ERROR/m-p/1066827#M4332</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;When trying to compile a very simple OpenCL kernel.cl on a MIC device, I get the following error: &lt;STRONG&gt;LLVM ERROR: Non implemented constant type&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Apparently, the source of the problem is the static array:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;__constant _Complex double lookupTable_ipow_pos[4] = { 1, I, -1,-I };&lt;/PRE&gt;

&lt;P&gt;The compilation of the same kernel and the execution on a CPU Xeon device works perfectly.&lt;BR /&gt;
	If I use double or int instead of _Complex double, it also compiles and runs fine, so this LLVM error is triggered exclusively by the&lt;STRONG&gt; _Complex double&lt;/STRONG&gt; and the &lt;STRONG&gt;MIC device&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;This is the &lt;STRONG&gt;kernel.cl&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;complex.h&amp;gt;
#include "ipown.h"
void kernel simple_add(global const _Complex double * A, global const _Complex double* B, global _Complex double* C){   
      C[get_global_id(0)]=A[get_global_id(0)]+B[get_global_id(0)] + ipown(get_global_id(0));                
}                                                                           &lt;/PRE&gt;

&lt;P&gt;And this is &lt;STRONG&gt;ipown.h&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;__constant _Complex double lookupTable_ipow_pos[4] = { 1, I, -1,-I };

inline _Complex double ipown( int n )
{
    return lookupTable_ipow_pos[ n % 4 ];
}
&lt;/PRE&gt;

&lt;P&gt;Anyone is familiar with this issue?&lt;BR /&gt;
	Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Oct 2016 22:53:57 GMT</pubDate>
    <dc:creator>antón_r_</dc:creator>
    <dc:date>2016-10-26T22:53:57Z</dc:date>
    <item>
      <title>Unable to compile openCL kernel for Xeon Phi: LLVM ERROR</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Unable-to-compile-openCL-kernel-for-Xeon-Phi-LLVM-ERROR/m-p/1066827#M4332</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;When trying to compile a very simple OpenCL kernel.cl on a MIC device, I get the following error: &lt;STRONG&gt;LLVM ERROR: Non implemented constant type&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Apparently, the source of the problem is the static array:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;__constant _Complex double lookupTable_ipow_pos[4] = { 1, I, -1,-I };&lt;/PRE&gt;

&lt;P&gt;The compilation of the same kernel and the execution on a CPU Xeon device works perfectly.&lt;BR /&gt;
	If I use double or int instead of _Complex double, it also compiles and runs fine, so this LLVM error is triggered exclusively by the&lt;STRONG&gt; _Complex double&lt;/STRONG&gt; and the &lt;STRONG&gt;MIC device&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;This is the &lt;STRONG&gt;kernel.cl&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;complex.h&amp;gt;
#include "ipown.h"
void kernel simple_add(global const _Complex double * A, global const _Complex double* B, global _Complex double* C){   
      C[get_global_id(0)]=A[get_global_id(0)]+B[get_global_id(0)] + ipown(get_global_id(0));                
}                                                                           &lt;/PRE&gt;

&lt;P&gt;And this is &lt;STRONG&gt;ipown.h&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;__constant _Complex double lookupTable_ipow_pos[4] = { 1, I, -1,-I };

inline _Complex double ipown( int n )
{
    return lookupTable_ipow_pos[ n % 4 ];
}
&lt;/PRE&gt;

&lt;P&gt;Anyone is familiar with this issue?&lt;BR /&gt;
	Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 22:53:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Unable-to-compile-openCL-kernel-for-Xeon-Phi-LLVM-ERROR/m-p/1066827#M4332</guid>
      <dc:creator>antón_r_</dc:creator>
      <dc:date>2016-10-26T22:53:57Z</dc:date>
    </item>
    <item>
      <title>Which version of runtime are</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Unable-to-compile-openCL-kernel-for-Xeon-Phi-LLVM-ERROR/m-p/1066828#M4333</link>
      <description>&lt;P&gt;Which version of runtime are you using, and which Xeon Phi family?&lt;/P&gt;

&lt;P&gt;Xeon Phi is only supported in the deprecated 14.2 runtime package (more info on the OpenCL driver page &lt;A href="https://software.intel.com/en-us/articles/opencl-drivers"&gt;here&lt;/A&gt;).&amp;nbsp;&amp;nbsp; This runtime package only supports the &lt;SPAN class="baec5a81-e4d6-4674-97f3-e9220f0136c1" style="white-space: nowrap;"&gt;x100&lt;/SPAN&gt; family (Knights Corner).&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 06:11:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Unable-to-compile-openCL-kernel-for-Xeon-Phi-LLVM-ERROR/m-p/1066828#M4333</guid>
      <dc:creator>Jeffrey_M_Intel1</dc:creator>
      <dc:date>2016-10-27T06:11:38Z</dc:date>
    </item>
    <item>
      <title>If I understand correctly, no</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Unable-to-compile-openCL-kernel-for-Xeon-Phi-LLVM-ERROR/m-p/1066829#M4334</link>
      <description>&lt;P&gt;If I understand correctly, no OpenCL Phi support anymore?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2017 21:19:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Unable-to-compile-openCL-kernel-for-Xeon-Phi-LLVM-ERROR/m-p/1066829#M4334</guid>
      <dc:creator>SvanS</dc:creator>
      <dc:date>2017-01-19T21:19:36Z</dc:date>
    </item>
    <item>
      <title>Yes, Xeon Phi OpenCL support</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Unable-to-compile-openCL-kernel-for-Xeon-Phi-LLVM-ERROR/m-p/1066830#M4335</link>
      <description>&lt;P&gt;Yes, Xeon Phi OpenCL support is deprecated. &amp;nbsp;You can still download the runtime package but it is no longer maintained/updated and it doesn't support newer Xeon Phi hardware.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 02:21:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Unable-to-compile-openCL-kernel-for-Xeon-Phi-LLVM-ERROR/m-p/1066830#M4335</guid>
      <dc:creator>Jeffrey_M_Intel1</dc:creator>
      <dc:date>2017-01-20T02:21:11Z</dc:date>
    </item>
  </channel>
</rss>

