]> git.ipfire.org Git - thirdparty/gcc.git/blob - libgomp/doc/openacc-runtime-library-routines/accpresentorcreate.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / libgomp / doc / openacc-runtime-library-routines / accpresentorcreate.rst
1 ..
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.
5
6 .. _acc_present_or_create:
7
8 acc_present_or_create -- If the data is not present on the device, allocate device memory and map it to host memory.
9 ********************************************************************************************************************
10
11 Description
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.
16
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.
20
21 Note that ``acc_present_or_create`` and ``acc_pcreate`` exist for
22 backward compatibility with OpenACC 2.0; use :ref:`acc_create` instead.
23
24 C/C++:
25 .. list-table::
26
27 * - *Prototype*:
28 - ``void *acc_present_or_create(h_void *a, size_t len)``
29 * - *Prototype*:
30 - ``void *acc_pcreate(h_void *a, size_t len)``
31
32 Fortran:
33 .. list-table::
34
35 * - *Interface*:
36 - ``subroutine acc_present_or_create(a)``
37 * -
38 - ``type, dimension(:[,:]...) :: a``
39 * - *Interface*:
40 - ``subroutine acc_present_or_create(a, len)``
41 * -
42 - ``type, dimension(:[,:]...) :: a``
43 * -
44 - ``integer len``
45 * - *Interface*:
46 - ``subroutine acc_pcreate(a)``
47 * -
48 - ``type, dimension(:[,:]...) :: a``
49 * - *Interface*:
50 - ``subroutine acc_pcreate(a, len)``
51 * -
52 - ``type, dimension(:[,:]...) :: a``
53 * -
54 - ``integer len``
55
56 Reference:
57 :openacc:`2.6`, section
58 3.2.21.