Quantcast
Channel: Intel® Many Integrated Core Architecture
Viewing all articles
Browse latest Browse all 1347

How to

$
0
0

for example, I have

#pragma offload nocopy(a)
{
  a = malloc(sizeof(double)*ny*nx);
}

And now I want to initialize its first k lines from the data from Host

I can do something like:

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));
}

Is there any way to avoid the temporary pointer `inout' ?

Thanks

 


Viewing all articles
Browse latest Browse all 1347

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>