<?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 Offload from dynamic link library in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Offload-from-dynamic-link-library/m-p/1101315#M68786</link>
    <description>&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;Hello,&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;I am new to programming for the Xeon Phi, and I am having trouble getting explicit offload to work when the offload is done in a dynamic-link library. The code fails at run time at the offload location, with a messages:&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;"offload error: Cannot find host executable&lt;BR /&gt;
	offload error: cannot start process on the device 0 (error code 6)"&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;&lt;SPAN style="line-height: 1.5;"&gt;If I am setting&amp;nbsp;&lt;/SPAN&gt;environment variable OFFLOAD_INIT=on_start I get the next message:&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;"[Offload] [MIC 0] [File] &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c:\temp\init_xeon.cpp&lt;BR /&gt;
	[Offload] [MIC 0] [Line] &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;28&lt;BR /&gt;
	[Offload] [MIC 0] [Tag] &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Tag 0&lt;BR /&gt;
	offload error: cannot create pipeline on the device 0 (error code 14)"&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;I am using C++ on &amp;nbsp;Windows Server 2012R2, using Parallel Studio XE 2015 Update 6 Cluster Edition, MPSS version 3.6.1.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;A simple example of what I'm trying to do is below :&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;A basic main program which loads the dynamic library and calls the function in it :&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;int _tmain(int argc, _TCHAR* argv[])
{
	HINSTANCE hInstLib = LoadLibraryA("TestXeonDll.dll");
 
	_StartDllXeonInit	StartDllXeonInit	= (_StartDllXeonInit)	GetProcAddress(hInstLib, "StartDllXeonInit");
 
 	StartDllXeonInit();
 
 	FreeLibrary(hInstLib);
	
	return 0;
}&lt;/PRE&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;And the contents of dynamic library:&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;void StartDllXeonInit()
{
	init_xeon();
}


void init_xeon()
{
	uint32_t  a = 0;

#pragma offload target(mic) inout(a)
	{
		a += 1;
	}
}&lt;/PRE&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;If I do the offload in the main program, it works fine. Any clues as to what I'm doing wrong ?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Fedor.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jun 2016 10:35:43 GMT</pubDate>
    <dc:creator>Fedor_Z_</dc:creator>
    <dc:date>2016-06-20T10:35:43Z</dc:date>
    <item>
      <title>Offload from dynamic link library</title>
      <link>https://community.intel.com/t5/Software-Archive/Offload-from-dynamic-link-library/m-p/1101315#M68786</link>
      <description>&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;Hello,&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;I am new to programming for the Xeon Phi, and I am having trouble getting explicit offload to work when the offload is done in a dynamic-link library. The code fails at run time at the offload location, with a messages:&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;"offload error: Cannot find host executable&lt;BR /&gt;
	offload error: cannot start process on the device 0 (error code 6)"&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;&lt;SPAN style="line-height: 1.5;"&gt;If I am setting&amp;nbsp;&lt;/SPAN&gt;environment variable OFFLOAD_INIT=on_start I get the next message:&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;"[Offload] [MIC 0] [File] &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c:\temp\init_xeon.cpp&lt;BR /&gt;
	[Offload] [MIC 0] [Line] &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;28&lt;BR /&gt;
	[Offload] [MIC 0] [Tag] &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Tag 0&lt;BR /&gt;
	offload error: cannot create pipeline on the device 0 (error code 14)"&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;I am using C++ on &amp;nbsp;Windows Server 2012R2, using Parallel Studio XE 2015 Update 6 Cluster Edition, MPSS version 3.6.1.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;A simple example of what I'm trying to do is below :&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;A basic main program which loads the dynamic library and calls the function in it :&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;int _tmain(int argc, _TCHAR* argv[])
{
	HINSTANCE hInstLib = LoadLibraryA("TestXeonDll.dll");
 
	_StartDllXeonInit	StartDllXeonInit	= (_StartDllXeonInit)	GetProcAddress(hInstLib, "StartDllXeonInit");
 
 	StartDllXeonInit();
 
 	FreeLibrary(hInstLib);
	
	return 0;
}&lt;/PRE&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;And the contents of dynamic library:&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;void StartDllXeonInit()
{
	init_xeon();
}


void init_xeon()
{
	uint32_t  a = 0;

#pragma offload target(mic) inout(a)
	{
		a += 1;
	}
}&lt;/PRE&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;If I do the offload in the main program, it works fine. Any clues as to what I'm doing wrong ?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Fedor.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2016 10:35:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Offload-from-dynamic-link-library/m-p/1101315#M68786</guid>
      <dc:creator>Fedor_Z_</dc:creator>
      <dc:date>2016-06-20T10:35:43Z</dc:date>
    </item>
    <item>
      <title> Hi,Fedor Z !  </title>
      <link>https://community.intel.com/t5/Software-Archive/Offload-from-dynamic-link-library/m-p/1101316#M68787</link>
      <description>&lt;P&gt;&amp;nbsp;Hi,&lt;A href="https://software.intel.com/en-us/user/1427072" style="font-size: 11px; line-height: 13.2px; background-color: rgb(238, 238, 238);"&gt;Fedor Z&lt;/A&gt;&amp;nbsp;! &amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Nowadays, &amp;nbsp;I have the same problem with you, have you solved this problem? &amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;I'm &amp;nbsp;nearly crazy about this problem, so I very looking forward your help.&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Thanks !&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2017 07:51:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Offload-from-dynamic-link-library/m-p/1101316#M68787</guid>
      <dc:creator>Linm_F_</dc:creator>
      <dc:date>2017-10-03T07:51:15Z</dc:date>
    </item>
  </channel>
</rss>

