<?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 Regrding target construct error (mic offload) in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Regrding-target-construct-error-mic-offload/m-p/1015551#M35940</link>
    <description>&lt;P&gt;i have started exploring openmp 4.0 constructs for intel xeon phi architecture by &lt;A href="http://openmp.org/wp/presos/SC12/Acc%20model%20for%20OpenMP%20BOF%20SC12%20v2.pdf"&gt;writing small code snippets&lt;/A&gt;.&lt;BR /&gt;
	So, i wrote the following code:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;int a[100],b[100],c[100],i;
#pragma omp  target device(mic0) map(a,b)  //offload target(mic:0)
{
  for(i=0;i&amp;lt;100;i++)
        {
                a&lt;I&gt;=i;b&lt;I&gt;=i;
                c&lt;I&gt;=a&lt;I&gt;+b&lt;I&gt;;

        }
        system("uname -r");
}&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;but the compilation of this code gives following error:&lt;BR /&gt;
	icc -openmp test.c&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;test.c(6): error: identifier "mic0" is undefined
 #pragma omp  target device(mic0) map(a,b)  //offload target(mic:0)

&lt;/PRE&gt;

&lt;P&gt;but if i change my code as:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#pragma offload target(mic:0)// map(a,b)  //offload target(mic:0)
{
  for(i=0;i&amp;lt;100;i++)
        {
                a&lt;I&gt;=i;b&lt;I&gt;=i;
                c&lt;I&gt;=a&lt;I&gt;+b&lt;I&gt;;

        }
        system("uname -r");
}&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;
	&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;
		the compilation succeeds.&lt;BR /&gt;
		What is the reason for this behaviour ? is the &lt;A href="http://openmp.org/wp/presos/SC12/Acc%20model%20for%20OpenMP%20BOF%20SC12%20v2.pdf"&gt;#pragma omp target device incorrect&amp;nbsp; for icc?&lt;/A&gt;&lt;BR /&gt;
		Eagerly awaiting your reply&lt;BR /&gt;
		&lt;BR /&gt;
		&lt;BR /&gt;
		Regards,&lt;BR /&gt;
		Puneet Singh&lt;BR /&gt;
		&lt;BR /&gt;
		PS: i can login to my mic0 card using ssh mic0 (passwordless ssh)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 26 May 2015 05:40:56 GMT</pubDate>
    <dc:creator>psing51</dc:creator>
    <dc:date>2015-05-26T05:40:56Z</dc:date>
    <item>
      <title>Regrding target construct error (mic offload)</title>
      <link>https://community.intel.com/t5/Software-Archive/Regrding-target-construct-error-mic-offload/m-p/1015551#M35940</link>
      <description>&lt;P&gt;i have started exploring openmp 4.0 constructs for intel xeon phi architecture by &lt;A href="http://openmp.org/wp/presos/SC12/Acc%20model%20for%20OpenMP%20BOF%20SC12%20v2.pdf"&gt;writing small code snippets&lt;/A&gt;.&lt;BR /&gt;
	So, i wrote the following code:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;int a[100],b[100],c[100],i;
#pragma omp  target device(mic0) map(a,b)  //offload target(mic:0)
{
  for(i=0;i&amp;lt;100;i++)
        {
                a&lt;I&gt;=i;b&lt;I&gt;=i;
                c&lt;I&gt;=a&lt;I&gt;+b&lt;I&gt;;

        }
        system("uname -r");
}&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;but the compilation of this code gives following error:&lt;BR /&gt;
	icc -openmp test.c&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;test.c(6): error: identifier "mic0" is undefined
 #pragma omp  target device(mic0) map(a,b)  //offload target(mic:0)

&lt;/PRE&gt;

&lt;P&gt;but if i change my code as:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#pragma offload target(mic:0)// map(a,b)  //offload target(mic:0)
{
  for(i=0;i&amp;lt;100;i++)
        {
                a&lt;I&gt;=i;b&lt;I&gt;=i;
                c&lt;I&gt;=a&lt;I&gt;+b&lt;I&gt;;

        }
        system("uname -r");
}&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;
	&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;
		the compilation succeeds.&lt;BR /&gt;
		What is the reason for this behaviour ? is the &lt;A href="http://openmp.org/wp/presos/SC12/Acc%20model%20for%20OpenMP%20BOF%20SC12%20v2.pdf"&gt;#pragma omp target device incorrect&amp;nbsp; for icc?&lt;/A&gt;&lt;BR /&gt;
		Eagerly awaiting your reply&lt;BR /&gt;
		&lt;BR /&gt;
		&lt;BR /&gt;
		Regards,&lt;BR /&gt;
		Puneet Singh&lt;BR /&gt;
		&lt;BR /&gt;
		PS: i can login to my mic0 card using ssh mic0 (passwordless ssh)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2015 05:40:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Regrding-target-construct-error-mic-offload/m-p/1015551#M35940</guid>
      <dc:creator>psing51</dc:creator>
      <dc:date>2015-05-26T05:40:56Z</dc:date>
    </item>
    <item>
      <title>'#pragma omp  target device()</title>
      <link>https://community.intel.com/t5/Software-Archive/Regrding-target-construct-error-mic-offload/m-p/1015552#M35941</link>
      <description>&lt;P&gt;'&lt;FONT face="Courier New"&gt;#pragma omp&amp;nbsp; target device()' and '#pragma offload target()' are different offload directives and have different syntax.&amp;nbsp; For the 'omp' flavor, the argument for 'device' has to be an integer expression, eg:&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; int d = f ? omp_get_num_devices () : omp_get_default_device ();&lt;BR /&gt;
	&amp;nbsp; #pragma omp target device (d)&lt;/P&gt;

&lt;P&gt;For the non-omp flavor, the argument to 'device' is considerably more rich: &lt;SPAN class="keyword"&gt;target&lt;/SPAN&gt; ( &lt;VAR&gt;target-name&lt;/VAR&gt; [ :&lt;VAR&gt;target-number&lt;/VAR&gt; ] ); &lt;EM&gt;target-name&lt;/EM&gt; could be 'mic' or 'gfx', and &lt;EM&gt;target-number&lt;/EM&gt; takes&amp;nbsp;various&amp;nbsp;integer values, eg, -1 lets the runtime system decide the target, as described in the compiler User and Reference Guide.&lt;/P&gt;

&lt;P&gt;Patrick&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2015 14:34:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Regrding-target-construct-error-mic-offload/m-p/1015552#M35941</guid>
      <dc:creator>pbkenned1</dc:creator>
      <dc:date>2015-05-26T14:34:41Z</dc:date>
    </item>
  </channel>
</rss>

