<?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 I'm working with Developers in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/issues-with-offload-and-include-lt-string-gt/m-p/1079283#M60949</link>
    <description>&lt;P&gt;I'm working with Developers to understand this behavior, and I'm not sure whether you discovered this already, but if you include &amp;lt;string&amp;gt; within the scope of the &lt;STRONG&gt;offload_attribute push/pop &lt;/STRONG&gt;then the test case will compile/link successfully.&lt;/P&gt;</description>
    <pubDate>Mon, 22 Feb 2016 18:10:09 GMT</pubDate>
    <dc:creator>Kevin_D_Intel</dc:creator>
    <dc:date>2016-02-22T18:10:09Z</dc:date>
    <item>
      <title>issues with offload and #include &lt;string&gt;</title>
      <link>https://community.intel.com/t5/Software-Archive/issues-with-offload-and-include-lt-string-gt/m-p/1079280#M60946</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;

&lt;P&gt;I have this code:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;//#include &amp;lt;string&amp;gt; 

#pragma offload_attribute (push, target(mic)) 
#include &amp;lt;algorithm&amp;gt; 
#include &amp;lt;numeric&amp;gt; 
#pragma offload_attribute (pop) 

int main() { 
    #pragma offload target(mic) 
    { 
        int a[10] = {0,1,9,2,8,3,7,4,6,5}; 
        int b[10]; 
        std::iota(b, b+10, 0); 
        std::sort(b, b+10, [&amp;amp;](int i, int j){ return a&lt;I&gt; &amp;lt; a&lt;J&gt;; }); 
    } 
    return 0; 
}

&lt;/J&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;The code compiles ok, except when I uncomment the "#include &amp;lt;string&amp;gt;". In this case I get a ton of undefined references.&lt;/P&gt;

&lt;P&gt;Can anybody tell me why?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
	Martijn&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2016 13:28:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/issues-with-offload-and-include-lt-string-gt/m-p/1079280#M60946</guid>
      <dc:creator>MSand23</dc:creator>
      <dc:date>2016-02-19T13:28:16Z</dc:date>
    </item>
    <item>
      <title>Some extra info might be a</title>
      <link>https://community.intel.com/t5/Software-Archive/issues-with-offload-and-include-lt-string-gt/m-p/1079281#M60947</link>
      <description>&lt;P&gt;Some extra info might be a good idea.&lt;/P&gt;

&lt;P&gt;On a CentOS 7 box I'm running "icc -std=c++11 myfile.cpp -o i &amp;amp;&amp;gt; output.txt". The resulting output.txt is attached to this post.&lt;/P&gt;

&lt;P&gt;My Xeon Phi 7120 seems to be setup correctly, I get the expected results when I compile and run the examples from chapter 2 from the Jeffers/Reinders "Intel Xeon Phi Coporocessor High Performance Programming" book.&lt;/P&gt;

&lt;P&gt;"icc --version" results in "icc (ICC) 16.0.1 20151021".&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
	Martijn&lt;BR /&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>Mon, 22 Feb 2016 11:01:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/issues-with-offload-and-include-lt-string-gt/m-p/1079281#M60947</guid>
      <dc:creator>MSand23</dc:creator>
      <dc:date>2016-02-22T11:01:44Z</dc:date>
    </item>
    <item>
      <title>This is a confusing aspect of</title>
      <link>https://community.intel.com/t5/Software-Archive/issues-with-offload-and-include-lt-string-gt/m-p/1079282#M60948</link>
      <description>&lt;P&gt;This is a confusing aspect of the offload programming model and one that still confuses me.&amp;nbsp; I gave a basic explanation below but will ask our more expert C/C++ developers to chime in soon.&lt;/P&gt;

&lt;P&gt;Essentially, in the absence of the &lt;STRONG&gt;offload_attribute push/pop &lt;/STRONG&gt;pragmas, the specified includes do not have the corresponding function prototypes decorated for use in offloaded code; therefore, when those functions appear in offloaded code an instance is not available during the offload link and this results in an undefined reference (or many undefined references as in your case).&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 13:03:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/issues-with-offload-and-include-lt-string-gt/m-p/1079282#M60948</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2016-02-22T13:03:48Z</dc:date>
    </item>
    <item>
      <title>I'm working with Developers</title>
      <link>https://community.intel.com/t5/Software-Archive/issues-with-offload-and-include-lt-string-gt/m-p/1079283#M60949</link>
      <description>&lt;P&gt;I'm working with Developers to understand this behavior, and I'm not sure whether you discovered this already, but if you include &amp;lt;string&amp;gt; within the scope of the &lt;STRONG&gt;offload_attribute push/pop &lt;/STRONG&gt;then the test case will compile/link successfully.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 18:10:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/issues-with-offload-and-include-lt-string-gt/m-p/1079283#M60949</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2016-02-22T18:10:09Z</dc:date>
    </item>
    <item>
      <title>Our Developers clarified what</title>
      <link>https://community.intel.com/t5/Software-Archive/issues-with-offload-and-include-lt-string-gt/m-p/1079284#M60950</link>
      <description>&lt;P&gt;Our Developers clarified what happens in your case.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&amp;lt;string&amp;gt;&lt;/STRONG&gt; includes other header files which are needed on the target; however, header files are protected by &lt;STRONG&gt;#ifdef&lt;/STRONG&gt; to prevent multiple reads.&amp;nbsp; Thus, its inclusion before the push/pop causes some header files to not get included again even though they are included later from within the push/pop, this leads to the numerous undefined references.&lt;/P&gt;

&lt;P&gt;The proper change is to move the &amp;lt;string&amp;gt; inclusion line to after the push/pop, and then the code will compile cleanly.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 20:19:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/issues-with-offload-and-include-lt-string-gt/m-p/1079284#M60950</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2016-02-22T20:19:00Z</dc:date>
    </item>
    <item>
      <title>Aha! Now it makes perfect</title>
      <link>https://community.intel.com/t5/Software-Archive/issues-with-offload-and-include-lt-string-gt/m-p/1079285#M60951</link>
      <description>&lt;P&gt;Aha! Now it makes perfect sense.&lt;/P&gt;

&lt;P&gt;Thanks a lot for your effort Kevin!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 07:08:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/issues-with-offload-and-include-lt-string-gt/m-p/1079285#M60951</guid>
      <dc:creator>MSand23</dc:creator>
      <dc:date>2016-02-23T07:08:26Z</dc:date>
    </item>
  </channel>
</rss>

