<?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 How to  in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/How-to/m-p/996568#M28386</link>
    <description>&lt;P&gt;for example, I have&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#pragma offload nocopy(a)
{
  a = malloc(sizeof(double)*ny*nx);
}&lt;/PRE&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;And now I want to initialize its first k lines from the data from Host&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;I can do something like:&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;inout = malloc(sizeof(double)*k*nx);
memcpy(inout, a, k*nx*sizeof(double));
#pragma offload in(inout: length(k*nx) alloc_if(1) free_if(1)) nocopy(a) in(nx, k)
{
 memcpy(a, inout, k * nx * sizeof(double));
}&lt;/PRE&gt;

&lt;P&gt;Is there any way to avoid the temporary pointer `inout' ?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 19 Apr 2014 14:26:26 GMT</pubDate>
    <dc:creator>SKAL_H_</dc:creator>
    <dc:date>2014-04-19T14:26:26Z</dc:date>
    <item>
      <title>How to</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to/m-p/996568#M28386</link>
      <description>&lt;P&gt;for example, I have&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#pragma offload nocopy(a)
{
  a = malloc(sizeof(double)*ny*nx);
}&lt;/PRE&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;And now I want to initialize its first k lines from the data from Host&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;I can do something like:&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;inout = malloc(sizeof(double)*k*nx);
memcpy(inout, a, k*nx*sizeof(double));
#pragma offload in(inout: length(k*nx) alloc_if(1) free_if(1)) nocopy(a) in(nx, k)
{
 memcpy(a, inout, k * nx * sizeof(double));
}&lt;/PRE&gt;

&lt;P&gt;Is there any way to avoid the temporary pointer `inout' ?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Apr 2014 14:26:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to/m-p/996568#M28386</guid>
      <dc:creator>SKAL_H_</dc:creator>
      <dc:date>2014-04-19T14:26:26Z</dc:date>
    </item>
    <item>
      <title>This is probably easier done</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to/m-p/996569#M28387</link>
      <description>&lt;P&gt;This is probably easier done using INTO and having the offload manage the memory allocation. There is an outline of an example that demonstrates your interest under the topic &lt;STRONG&gt;Minimize Coprocessor Memory Allocation Overhead&lt;/STRONG&gt; on the &lt;A href="https://software.intel.com/en-us/articles/effective-use-of-the-intel-compilers-offload-features" target="_blank"&gt;&lt;STRONG&gt;Effective Use of the Intel Compilers Offload Features&lt;/STRONG&gt;&lt;/A&gt; page.&lt;BR /&gt;
	Let me know whether this helps.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Apr 2014 11:09:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to/m-p/996569#M28387</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2014-04-20T11:09:15Z</dc:date>
    </item>
  </channel>
</rss>

