I am currently studying the openacc API
, and I was wondering if it is possible to create an array on the device without having any corresponding allocate array on the Host.
Let's say that I want to use my old cuda kernel
, and only handle memory management through the openacc API
. I need some arrays of 256 elements used only on the device. If I only declare my pointers on the host without allocation, they might have sequential address.
If I used a present_or_create
clause on these pointers, with my size of 256 elements, will I end with distinct arrays on the device?
Or the consecutive addresses on the host, coupled with the length of my arrays, will be considered as being part of the same array?
Here is an example: address of pointer A is 0,address of pointer B is 4.
If I do two pcreate
on A[0:256]
and B[0:256]
, since the range of data on the host will be [0 , 1024]
and [4 , 1028]
, will I end up on the device with two distinct arrays of 256 elements, or will I end up with only one array with range [0 , 1028]
?
Do I have to first allocate my two arrays on the host to be sure to have two distinct arrays, or should this method work fine?