1 ! OpenACC Runtime Library Definitions.
3 ! Copyright (C) 2014-2016 Free Software Foundation, Inc.
5 ! Contributed by Tobias Burnus <burnus@net-b.de>
8 ! This file is part of the GNU Offloading and Multi Processing Library
11 ! Libgomp is free software; you can redistribute it and/or modify it
12 ! under the terms of the GNU General Public License as published by
13 ! the Free Software Foundation; either version 3, or (at your option)
16 ! Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
17 ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 ! FOR A PARTICULAR PURPOSE. See the GNU General Public License for
21 ! Under Section 7 of GPL version 3, you are granted additional
22 ! permissions described in the GCC Runtime Library Exception, version
23 ! 3.1, as published by the Free Software Foundation.
25 ! You should have received a copy of the GNU General Public License and
26 ! a copy of the GCC Runtime Library Exception along with this program;
27 ! see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
28 ! <http://www.gnu.org/licenses/>.
30 ! Wrapper functions will be built from openacc.f90. We use a separate file
31 ! here, because for using ../../openacc.f90, implementations are required for
32 ! all the functions that it wraps, which we currently don't provide, so linking
36 use iso_fortran_env
, only
: int32
40 public
:: acc_device_kind
42 integer, parameter :: acc_device_kind
= int32
44 public
:: acc_device_none
, acc_device_default
, acc_device_host
45 public
:: acc_device_not_host
, acc_device_nvidia
47 ! Keep in sync with include/gomp-constants.h.
48 integer (acc_device_kind
), parameter :: acc_device_none
= 0
49 integer (acc_device_kind
), parameter :: acc_device_default
= 1
50 integer (acc_device_kind
), parameter :: acc_device_host
= 2
51 ! integer (acc_device_kind), parameter :: acc_device_host_nonshm = 3 removed.
52 integer (acc_device_kind
), parameter :: acc_device_not_host
= 4
53 integer (acc_device_kind
), parameter :: acc_device_nvidia
= 5
57 module openacc_internal
62 function acc_on_device_h (d
)
64 integer (acc_device_kind
) d
65 logical acc_on_device_h
70 function acc_on_device_l (d
) &
71 bind (C
, name
= "acc_on_device")
72 use iso_c_binding
, only
: c_int
73 integer (c_int
) :: acc_on_device_l
74 integer (c_int
), value
:: d
84 public
:: acc_on_device
86 interface acc_on_device
87 procedure
:: acc_on_device_h
92 function acc_on_device_h (d
)
93 use openacc_internal
, only
: acc_on_device_l
95 integer (acc_device_kind
) d
96 logical acc_on_device_h
97 if (acc_on_device_l (d
) .eq
. 1) then
98 acc_on_device_h
= .TRUE
.
100 acc_on_device_h
= .FALSE
.