acc_present_or_copyin – If the data is not present on the device, allocate device memory and copy from host memory.#
- Description
This function tests if the host data specified by
aand of lengthlenis present or not. If it is not present, then device memory will be allocated and the host memory copied. The device address of the newly allocated device memory is returned.In Fortran, two (2) forms are supported. In the first form,
aspecifies a contiguous array section. The second formaspecifies a variable or array element andlenspecifies the length in bytes.Note that
acc_present_or_copyinandacc_pcopyinexist for backward compatibility with OpenACC 2.0; use acc_copyin – Allocate device memory and copy host memory to it. instead.- C/C++:
Prototype:
void *acc_present_or_copyin(h_void *a, size_t len);Prototype:
void *acc_pcopyin(h_void *a, size_t len);- Fortran:
Interface:
subroutine acc_present_or_copyin(a)type, dimension(:[,:]...) :: aInterface:
subroutine acc_present_or_copyin(a, len)type, dimension(:[,:]...) :: ainteger lenInterface:
subroutine acc_pcopyin(a)type, dimension(:[,:]...) :: aInterface:
subroutine acc_pcopyin(a, len)type, dimension(:[,:]...) :: ainteger len- Reference:
OpenACC specification v2.6, section 3.2.20.