]> git.ipfire.org Git - thirdparty/gcc.git/blob - libgomp/doc/openacc-runtime-library-routines/accpresentorcopyin.rst
sphinx: copy files from texi2rst-generated repository
[thirdparty/gcc.git] / libgomp / doc / openacc-runtime-library-routines / accpresentorcopyin.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_copyin:
7
8 acc_present_or_copyin -- If the data is not present on the device, allocate device memory and copy from 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 the host memory copied. The device address of
15 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_copyin`` and ``acc_pcopyin`` exist for
22 backward compatibility with OpenACC 2.0; use :ref:`acc_copyin` instead.
23
24 C/C++:
25 .. list-table::
26
27 * - *Prototype*:
28 - ``void *acc_present_or_copyin(h_void *a, size_t len);``
29 * - *Prototype*:
30 - ``void *acc_pcopyin(h_void *a, size_t len);``
31
32 Fortran:
33 .. list-table::
34
35 * - *Interface*:
36 - ``subroutine acc_present_or_copyin(a)``
37 * -
38 - ``type, dimension(:[,:]...) :: a``
39 * - *Interface*:
40 - ``subroutine acc_present_or_copyin(a, len)``
41 * -
42 - ``type, dimension(:[,:]...) :: a``
43 * -
44 - ``integer len``
45 * - *Interface*:
46 - ``subroutine acc_pcopyin(a)``
47 * -
48 - ``type, dimension(:[,:]...) :: a``
49 * - *Interface*:
50 - ``subroutine acc_pcopyin(a, len)``
51 * -
52 - ``type, dimension(:[,:]...) :: a``
53 * -
54 - ``integer len``
55
56 Reference:
57 :openacc:`2.6`, section
58 3.2.20.