<?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 after reading these in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/MIC-macro-does-not-work/m-p/1061432#M54259</link>
    <description>&lt;P&gt;after reading these information, we get this conclusion:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;"&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;Do not use the&amp;nbsp;&lt;/SPAN&gt;&lt;CODE style="font-size: 13.0080003738403px; font-family: 'Courier New', Courier, monospace; line-height: 19.5120010375977px;"&gt;__MIC__&lt;/CODE&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;&amp;nbsp;macro inside the statement following a&amp;nbsp;&lt;/SPAN&gt;&lt;CODE style="font-size: 13.0080003738403px; font-family: 'Courier New', Courier, monospace; line-height: 19.5120010375977px;"&gt;#pragma offload&lt;/CODE&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;&amp;nbsp;statement."&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;thanks your link, it's really useful !&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Kevin Davis (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Use of &lt;STRONG&gt;__MIC__&lt;/STRONG&gt; inside the pragma offload is not supported. The compiler does not enforce this restriction so the programmer needs to be aware of and avoid this,&amp;nbsp; otherwise it can lead to problems with what the compiler sees for the host and target compilations. For more info see:&lt;STRONG&gt; &lt;/STRONG&gt;&lt;A href="https://software.intel.com/en-us/node/522493"&gt;&lt;STRONG&gt;Restrictions on Offloaded Code Using a Pragma&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;In this case, there are some missing/mis-placed curly-braces within the &lt;STRONG&gt;#ifdef/else/endif&lt;/STRONG&gt; construction that lead to the unexpected results. As written the &lt;STRONG&gt;#ifdef/endif&lt;/STRONG&gt; is not completely enclosed inside the pragma offload construct which leads the unexpected results.&lt;/P&gt;

&lt;P&gt;The function f1 should be modified as shown below.&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;void point::f1()
{
#pragma offload target(mic:0)
{
#ifdef __MIC__
        for(int i = 0; i &amp;lt; 20; i++)
        {                                                 // Add this missing curly brace to for loop
             printf("I'm mic\n");
             fflush(0);
        }
#else
//}                                                       // this curly brace is mis-placed - it should appear after the #endif below
        printf("I'm CPU\n");
#endif
}                                                         // place curly brace here to enclose ifdef block in offload construct
}&lt;/PRE&gt;

&lt;P&gt;With those changes the program runs as expected. Also, just a note, the &lt;STRONG&gt;__declspec(target(mic:0)) &lt;/STRONG&gt;syntax does not include the target id, so this only needs to be: &lt;STRONG&gt;__declspec(target(mic))&lt;/STRONG&gt;&amp;nbsp; For more info, see: &lt;A href="https://software.intel.com/en-us/node/522487"&gt;&lt;STRONG&gt;Placing Variables and Functions on the Coprocessor&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope that helps.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Feb 2015 12:03:00 GMT</pubDate>
    <dc:creator>wang_p_1</dc:creator>
    <dc:date>2015-02-02T12:03:00Z</dc:date>
    <item>
      <title>__MIC__ macro does not work</title>
      <link>https://community.intel.com/t5/Software-Archive/MIC-macro-does-not-work/m-p/1061427#M54254</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;To solve problems like this: &amp;nbsp;&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;&lt;STRONG&gt;undefined reference to `_mm512_xxx_xxx()&lt;/STRONG&gt;, I have added&lt;STRONG&gt; __MIC__ &lt;/STRONG&gt;macro into my code.(&lt;/SPAN&gt;&lt;A href="https://software.intel.com/en-us/comment/1726413#comment-1726413)" target="_blank"&gt;https://software.intel.com/en-us/comment/1726413#comment-1726413)&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; But, these code between the&lt;/P&gt;

&lt;P&gt;#ifdef __MIC__ &amp;nbsp;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;xxxx&lt;/P&gt;

&lt;P&gt;xxxx&lt;/P&gt;

&lt;P&gt;#endif&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;never won't be executed. &amp;nbsp;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_________________________________________________________________________________&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; as the picture showing , the printf() fucntion never won't be executed.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="QQ图片20150202112142.jpg"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/7264iC0C3E09876AA7D18/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="QQ图片20150202112142.jpg" alt="QQ图片20150202112142.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2015 03:40:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/MIC-macro-does-not-work/m-p/1061427#M54254</guid>
      <dc:creator>wang_p_1</dc:creator>
      <dc:date>2015-02-02T03:40:16Z</dc:date>
    </item>
    <item>
      <title>In order to simplify this</title>
      <link>https://community.intel.com/t5/Software-Archive/MIC-macro-does-not-work/m-p/1061428#M54255</link>
      <description>&lt;P&gt;&lt;STRONG&gt;In order to simplify this problem, I have simulated the runtime environment.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;#head.h&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;class point{
	public:
	point(){}
	void f1();
	void f2();
		
};&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;#head.cpp&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include"head.h"
#include"stdio.h"
__declspec(target(mic:0)) __forceinline void print()
{
#ifdef __MIC__
	printf("I'm monkey\n");
	fflush(0);
#else
	printf("I'm dog\n");
	fflush(0);
#endif
}

void point::f1()
{
#pragma offload target(mic:0)
{
#ifdef __MIC__
	for(int i = 0; i &amp;lt; 20; i++)
	printf("I'm mic\n");
	fflush(0);
}
#else
}
	printf("I'm CPU\n");
#endif
}

void point::f2()
{
#pragma offload target(mic:0)
{
	print();
}
}
&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;#main.cpp&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include"head.h"
int main()
{
	point p;
	p.f1();//output "I'm CPU". but without "I'm mic"
	p.f2();//output "I'm monkey".It's ok,mic print this.But why??
return 0 ;
}
&lt;/PRE&gt;

&lt;P&gt;$icpc -V&amp;nbsp;&lt;/P&gt;

&lt;P&gt;//14.0&lt;/P&gt;

&lt;P&gt;$icpc head.cpp main.cpp -o main&lt;/P&gt;

&lt;P&gt;$./main&lt;/P&gt;

&lt;P&gt;//I'm cpu&lt;/P&gt;

&lt;P&gt;//I'm monkey&lt;/P&gt;

&lt;P&gt;__________________________________________________________________________________&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;but why class point member fucntion f1 can not print out "I'm mic" ??&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;this is an interesting topic, isn't it? &amp;nbsp;^.^&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;thank u !&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2015 09:41:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/MIC-macro-does-not-work/m-p/1061428#M54255</guid>
      <dc:creator>wang_p_1</dc:creator>
      <dc:date>2015-02-02T09:41:09Z</dc:date>
    </item>
    <item>
      <title>Use of __MIC__ inside the</title>
      <link>https://community.intel.com/t5/Software-Archive/MIC-macro-does-not-work/m-p/1061429#M54256</link>
      <description>&lt;P&gt;Use of &lt;STRONG&gt;__MIC__&lt;/STRONG&gt; inside the pragma offload is not supported. The compiler does not enforce this restriction so the programmer needs to be aware of and avoid this,&amp;nbsp; otherwise it can lead to problems with what the compiler sees for the host and target compilations. For more info see:&lt;STRONG&gt; &lt;/STRONG&gt;&lt;A href="https://software.intel.com/en-us/node/522493" target="_blank"&gt;&lt;STRONG&gt;Restrictions on Offloaded Code Using a Pragma&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;In this case, there are some missing/mis-placed curly-braces within the &lt;STRONG&gt;#ifdef/else/endif&lt;/STRONG&gt; construction that lead to the unexpected results. As written the &lt;STRONG&gt;#ifdef/endif&lt;/STRONG&gt; is not completely enclosed inside the pragma offload construct which leads the unexpected results.&lt;/P&gt;

&lt;P&gt;The function f1 should be modified as shown below.&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;void point::f1()
{
#pragma offload target(mic:0)
{
#ifdef __MIC__
        for(int i = 0; i &amp;lt; 20; i++)
        {                                                 // Add this missing curly brace to for loop
             printf("I'm mic\n");
             fflush(0);
        }
#else
//}                                                       // this curly brace is mis-placed - it should appear after the #endif below
        printf("I'm CPU\n");
#endif
}                                                         // place curly brace here to enclose ifdef block in offload construct
}&lt;/PRE&gt;

&lt;P&gt;With those changes the program runs as expected. Also, just a note, the &lt;STRONG&gt;__declspec(target(mic:0)) &lt;/STRONG&gt;syntax does not include the target id, so this only needs to be: &lt;STRONG&gt;__declspec(target(mic))&lt;/STRONG&gt;&amp;nbsp; For more info, see: &lt;A href="https://software.intel.com/en-us/node/522487" target="_blank"&gt;&lt;STRONG&gt;Placing Variables and Functions on the Coprocessor&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2015 10:59:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/MIC-macro-does-not-work/m-p/1061429#M54256</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-02-02T10:59:32Z</dc:date>
    </item>
    <item>
      <title>It does work well. </title>
      <link>https://community.intel.com/t5/Software-Archive/MIC-macro-does-not-work/m-p/1061430#M54257</link>
      <description>&lt;P&gt;It does work well.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;thanks very much.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Kevin Davis (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Use of &lt;STRONG&gt;__MIC__&lt;/STRONG&gt; inside the pragma offload is not supported. The compiler does not enforce this restriction so the programmer needs to be aware of and avoid this,&amp;nbsp; otherwise it can lead to problems with what the compiler sees for the host and target compilations. For more info see:&lt;STRONG&gt; &lt;/STRONG&gt;&lt;A href="https://software.intel.com/en-us/node/522493"&gt;&lt;STRONG&gt;Restrictions on Offloaded Code Using a Pragma&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;In this case, there are some missing/mis-placed curly-braces within the &lt;STRONG&gt;#ifdef/else/endif&lt;/STRONG&gt; construction that lead to the unexpected results. As written the &lt;STRONG&gt;#ifdef/endif&lt;/STRONG&gt; is not completely enclosed inside the pragma offload construct which leads the unexpected results.&lt;/P&gt;

&lt;P&gt;The function f1 should be modified as shown below.&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;void point::f1()
{
#pragma offload target(mic:0)
{
#ifdef __MIC__
        for(int i = 0; i &amp;lt; 20; i++)
        {                                                 // Add this missing curly brace to for loop
             printf("I'm mic\n");
             fflush(0);
        }
#else
//}                                                       // this curly brace is mis-placed - it should appear after the #endif below
        printf("I'm CPU\n");
#endif
}                                                         // place curly brace here to enclose ifdef block in offload construct
}&lt;/PRE&gt;

&lt;P&gt;With those changes the program runs as expected. Also, just a note, the &lt;STRONG&gt;__declspec(target(mic:0)) &lt;/STRONG&gt;syntax does not include the target id, so this only needs to be: &lt;STRONG&gt;__declspec(target(mic))&lt;/STRONG&gt;&amp;nbsp; For more info, see: &lt;A href="https://software.intel.com/en-us/node/522487"&gt;&lt;STRONG&gt;Placing Variables and Functions on the Coprocessor&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope that helps.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2015 11:30:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/MIC-macro-does-not-work/m-p/1061430#M54257</guid>
      <dc:creator>wang_p_1</dc:creator>
      <dc:date>2015-02-02T11:30:48Z</dc:date>
    </item>
    <item>
      <title>Great. You're welcome.</title>
      <link>https://community.intel.com/t5/Software-Archive/MIC-macro-does-not-work/m-p/1061431#M54258</link>
      <description>&lt;P&gt;Great. You're welcome.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2015 11:58:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/MIC-macro-does-not-work/m-p/1061431#M54258</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-02-02T11:58:30Z</dc:date>
    </item>
    <item>
      <title>after reading these</title>
      <link>https://community.intel.com/t5/Software-Archive/MIC-macro-does-not-work/m-p/1061432#M54259</link>
      <description>&lt;P&gt;after reading these information, we get this conclusion:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;"&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;Do not use the&amp;nbsp;&lt;/SPAN&gt;&lt;CODE style="font-size: 13.0080003738403px; font-family: 'Courier New', Courier, monospace; line-height: 19.5120010375977px;"&gt;__MIC__&lt;/CODE&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;&amp;nbsp;macro inside the statement following a&amp;nbsp;&lt;/SPAN&gt;&lt;CODE style="font-size: 13.0080003738403px; font-family: 'Courier New', Courier, monospace; line-height: 19.5120010375977px;"&gt;#pragma offload&lt;/CODE&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;&amp;nbsp;statement."&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;thanks your link, it's really useful !&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Kevin Davis (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Use of &lt;STRONG&gt;__MIC__&lt;/STRONG&gt; inside the pragma offload is not supported. The compiler does not enforce this restriction so the programmer needs to be aware of and avoid this,&amp;nbsp; otherwise it can lead to problems with what the compiler sees for the host and target compilations. For more info see:&lt;STRONG&gt; &lt;/STRONG&gt;&lt;A href="https://software.intel.com/en-us/node/522493"&gt;&lt;STRONG&gt;Restrictions on Offloaded Code Using a Pragma&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;In this case, there are some missing/mis-placed curly-braces within the &lt;STRONG&gt;#ifdef/else/endif&lt;/STRONG&gt; construction that lead to the unexpected results. As written the &lt;STRONG&gt;#ifdef/endif&lt;/STRONG&gt; is not completely enclosed inside the pragma offload construct which leads the unexpected results.&lt;/P&gt;

&lt;P&gt;The function f1 should be modified as shown below.&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;void point::f1()
{
#pragma offload target(mic:0)
{
#ifdef __MIC__
        for(int i = 0; i &amp;lt; 20; i++)
        {                                                 // Add this missing curly brace to for loop
             printf("I'm mic\n");
             fflush(0);
        }
#else
//}                                                       // this curly brace is mis-placed - it should appear after the #endif below
        printf("I'm CPU\n");
#endif
}                                                         // place curly brace here to enclose ifdef block in offload construct
}&lt;/PRE&gt;

&lt;P&gt;With those changes the program runs as expected. Also, just a note, the &lt;STRONG&gt;__declspec(target(mic:0)) &lt;/STRONG&gt;syntax does not include the target id, so this only needs to be: &lt;STRONG&gt;__declspec(target(mic))&lt;/STRONG&gt;&amp;nbsp; For more info, see: &lt;A href="https://software.intel.com/en-us/node/522487"&gt;&lt;STRONG&gt;Placing Variables and Functions on the Coprocessor&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope that helps.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Feb 2015 12:03:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/MIC-macro-does-not-work/m-p/1061432#M54259</guid>
      <dc:creator>wang_p_1</dc:creator>
      <dc:date>2015-02-02T12:03:00Z</dc:date>
    </item>
  </channel>
</rss>

