2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. _acc_present_or_create:
8 acc_present_or_create -- If the data is not present on the device, allocate device memory and map it to host memory.
9 ********************************************************************************************************************
12 This function tests if the host data specified by :samp:`{a}` and of length
13 :samp:`{len}` is present or not. If it is not present, then device memory
14 will be allocated and mapped to host memory. In C/C++, the device address
15 of the newly allocated device memory is returned.
17 In Fortran, two (2) forms are supported. In the first form, :samp:`{a}` specifies
18 a contiguous array section. The second form :samp:`{a}` specifies a variable or
19 array element and :samp:`{len}` specifies the length in bytes.
21 Note that ``acc_present_or_create`` and ``acc_pcreate`` exist for
22 backward compatibility with OpenACC 2.0; use :ref:`acc_create` instead.
28 - ``void *acc_present_or_create(h_void *a, size_t len)``
30 - ``void *acc_pcreate(h_void *a, size_t len)``
36 - ``subroutine acc_present_or_create(a)``
38 - ``type, dimension(:[,:]...) :: a``
40 - ``subroutine acc_present_or_create(a, len)``
42 - ``type, dimension(:[,:]...) :: a``
46 - ``subroutine acc_pcreate(a)``
48 - ``type, dimension(:[,:]...) :: a``
50 - ``subroutine acc_pcreate(a, len)``
52 - ``type, dimension(:[,:]...) :: a``
57 :openacc:`2.6`, section