<?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 cannot reproduce the same in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/problems-using-stl-in-implicit-model/m-p/961409#M21882</link>
    <description>&lt;P&gt;I cannot reproduce the same errors despite trying to fill in for the missing definitions so it would be difficult to understand the errors without have the complete code.&lt;/P&gt;

&lt;P&gt;Could you try attaching a file containing the complete source that includes the definitions for the missing functions and that produces the errors you showed?&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jan 2014 20:04:23 GMT</pubDate>
    <dc:creator>Kevin_D_Intel</dc:creator>
    <dc:date>2014-01-17T20:04:23Z</dc:date>
    <item>
      <title>problems using stl in implicit model</title>
      <link>https://community.intel.com/t5/Software-Archive/problems-using-stl-in-implicit-model/m-p/961407#M21880</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am writing this very simple program using implicit offload model. wherein I make use of cilk_plus lib. I run into trouble when I do the following, my code doesn't run, can anyone please help me understand what I am doing incorrect here,&lt;/P&gt;

&lt;P&gt;I am not including the definitions because when I do so somehow my message gets spammed. but if you look at the class body it is very straightforward.&lt;/P&gt;

&lt;P&gt;#include &amp;lt;iostream&amp;gt;&lt;BR /&gt;
	#include &amp;lt;cilk/cilk.h&amp;gt;&lt;/P&gt;

&lt;P&gt;#pragma offload_attribute(push,_Cilk_shared)&lt;BR /&gt;
	#include &amp;lt;vector&amp;gt;&lt;BR /&gt;
	#include "offload.h"&lt;BR /&gt;
	#pragma offload_attribute(pop)&lt;/P&gt;

&lt;P&gt;#include "omp.h"&lt;/P&gt;

&lt;P&gt;class _Cilk_shared Test&lt;BR /&gt;
	{&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;public:&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Test();&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;~Test();&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;unsigned long long GetNumElems();&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;vector&amp;lt;int&amp;gt;&amp;amp; GetVec();&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;unsigned long long PerformAdd();&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;unsigned long long m_res;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;void SimulateData();&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;protected:&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//void SimulateData();&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;vector&amp;lt;int&amp;gt; m_vec;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	};&lt;/P&gt;

&lt;P&gt;Test* _Cilk_shared tt1;&lt;/P&gt;

&lt;P&gt;int main()&lt;BR /&gt;
	{&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;tt1 = new _Cilk_shared Test();&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;_Cilk_offload_to(0) tt1-&amp;gt;SimulateData();&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;tt1-&amp;gt;m_res = _Cilk_offload_to(0) tt1-&amp;gt;PerformAdd();&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; tt1-&amp;gt;m_res &amp;lt;&amp;lt; endl;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;// auto clean up on MIC I presume !!&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;return 0;&amp;nbsp;&lt;BR /&gt;
	}&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Following is what I get when I compile&lt;/P&gt;

&lt;P&gt;&amp;nbsp;icc -openmp &amp;nbsp;-offload-option,mic,compiler,"-z defs" cpSimple.cpp -o cpOO&lt;BR /&gt;
	/tmp/iccgh0xCb.o: In function `Test::Test()':&lt;BR /&gt;
	cpSimple.cpp:(.text+0x82): undefined reference to `std::vector&amp;lt;int, std::allocator&amp;lt;int&amp;gt; &amp;gt;::vector()'&lt;BR /&gt;
	/tmp/iccgh0xCb.o: In function `Test::SimulateData()':&lt;BR /&gt;
	cpSimple.cpp:(.text+0xf5): undefined reference to `std::vector&amp;lt;int, std::allocator&amp;lt;int&amp;gt; &amp;gt;::push_back(int const&amp;amp;)'&lt;BR /&gt;
	/tmp/iccgh0xCb.o: In function `Test::PerformAdd()':&lt;BR /&gt;
	cpSimple.cpp:(.text+0x37b): undefined reference to `std::vector&amp;lt;int, std::allocator&amp;lt;int&amp;gt; &amp;gt;::operator[](unsigned long)'&lt;BR /&gt;
	/tmp/iccgh0xCb.o: In function `Test::~Test()':&lt;BR /&gt;
	cpSimple.cpp:(.text+0x532): undefined reference to `std::vector&amp;lt;int, std::allocator&amp;lt;int&amp;gt; &amp;gt;::~vector()'&lt;BR /&gt;
	/tmp/iccgh0xCb.o: In function `Test::GetNumElems()':&lt;BR /&gt;
	cpSimple.cpp:(.text+0x587): undefined reference to `std::vector&amp;lt;int, std::allocator&amp;lt;int&amp;gt; &amp;gt;::size() const'&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;

&lt;P&gt;Sincerely,&lt;/P&gt;

&lt;P&gt;AM&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2014 23:52:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/problems-using-stl-in-implicit-model/m-p/961407#M21880</guid>
      <dc:creator>ankit_m_</dc:creator>
      <dc:date>2014-01-16T23:52:24Z</dc:date>
    </item>
    <item>
      <title>Why not use icpc to link?</title>
      <link>https://community.intel.com/t5/Software-Archive/problems-using-stl-in-implicit-model/m-p/961408#M21881</link>
      <description>&lt;P&gt;Why not use icpc to link? This isn't MIcrosoft Windows; icc is a real C compiler driver, not C++.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2014 11:50:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/problems-using-stl-in-implicit-model/m-p/961408#M21881</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-01-17T11:50:00Z</dc:date>
    </item>
    <item>
      <title>I cannot reproduce the same</title>
      <link>https://community.intel.com/t5/Software-Archive/problems-using-stl-in-implicit-model/m-p/961409#M21882</link>
      <description>&lt;P&gt;I cannot reproduce the same errors despite trying to fill in for the missing definitions so it would be difficult to understand the errors without have the complete code.&lt;/P&gt;

&lt;P&gt;Could you try attaching a file containing the complete source that includes the definitions for the missing functions and that produces the errors you showed?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2014 20:04:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/problems-using-stl-in-implicit-model/m-p/961409#M21882</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2014-01-17T20:04:23Z</dc:date>
    </item>
    <item>
      <title>Hello Kevin, </title>
      <link>https://community.intel.com/t5/Software-Archive/problems-using-stl-in-implicit-model/m-p/961410#M21883</link>
      <description>&lt;P&gt;Hello Kevin,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thank you for all your help in troubleshooting this. Attached is the src file.&lt;/P&gt;

&lt;P&gt;I am running into troubles with stl and generally unsure of what headers need to go in my scr file at the time of offload.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;e.g. should I use offload.h or &amp;lt;new&amp;gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;#pragma offload_attribute(push,_Cilk_shared)&lt;BR /&gt;
	#include &amp;lt;vector&amp;gt;&lt;BR /&gt;
	#include "offload.h"&lt;BR /&gt;
	#pragma offload_attribute(pop)&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Also, following is what I do to compile my program&lt;/P&gt;

&lt;P&gt;&amp;nbsp;icpc -openmp &amp;nbsp;-offload-option,mic,compiler,"-z defs" cpSimple2.cpp -o ss2++&lt;/P&gt;

&lt;P&gt;I have included -offload-option to understand what is happening at the MIC side but when I use this trigger I see a lot more error messages than mentioned in my earlier post. &amp;nbsp;&lt;/P&gt;

&lt;P&gt;I really appreciate all your help here.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Sincerely,&lt;/P&gt;

&lt;P&gt;AM&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2014 21:18:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/problems-using-stl-in-implicit-model/m-p/961410#M21883</guid>
      <dc:creator>ankit_m_</dc:creator>
      <dc:date>2014-01-17T21:18:41Z</dc:date>
    </item>
    <item>
      <title>Thank you AM. The attached</title>
      <link>https://community.intel.com/t5/Software-Archive/problems-using-stl-in-implicit-model/m-p/961411#M21884</link>
      <description>&lt;P&gt;Thank you AM. The attached test case&amp;nbsp;does not compile&amp;nbsp;"as is" but&amp;nbsp;we understand your interest and with some small changes can reproduce the link errors mentioned. Developers are looking into this case now and a run-time failure that has surfaced with it so I'll update again when I know more.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2014 18:43:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/problems-using-stl-in-implicit-model/m-p/961411#M21884</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2014-01-20T18:43:26Z</dc:date>
    </item>
  </channel>
</rss>

