Home | History | Annotate | Line # | Download | only in libgomp
openacc.f90 revision 1.1.1.10
      1 !  OpenACC Runtime Library Definitions.
      2 
      3 !  Copyright (C) 2014-2024 Free Software Foundation, Inc.
      4 
      5 !  Contributed by Tobias Burnus <burnus@net-b.de>
      6 !              and Mentor Embedded.
      7 
      8 !  This file is part of the GNU Offloading and Multi Processing Library
      9 !  (libgomp).
     10 
     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)
     14 !  any later version.
     15 
     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
     19 !  more details.
     20 
     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.
     24 
     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/>.
     29 
     30 ! Keep in sync with config/accel/openacc.f90 and openacc_lib.h.
     31 
     32 module openacc_kinds
     33   use iso_fortran_env, only: int32
     34   implicit none
     35 
     36   public
     37   private :: int32
     38 
     39   ! When adding items, also update 'public' setting in 'module openacc' below.
     40 
     41   integer, parameter :: acc_device_kind = int32
     42 
     43   ! Keep in sync with include/gomp-constants.h.
     44   integer (acc_device_kind), parameter :: acc_device_current = -1
     45   integer (acc_device_kind), parameter :: acc_device_none = 0
     46   integer (acc_device_kind), parameter :: acc_device_default = 1
     47   integer (acc_device_kind), parameter :: acc_device_host = 2
     48   ! integer (acc_device_kind), parameter :: acc_device_host_nonshm = 3 removed.
     49   integer (acc_device_kind), parameter :: acc_device_not_host = 4
     50   integer (acc_device_kind), parameter :: acc_device_nvidia = 5
     51   integer (acc_device_kind), parameter :: acc_device_radeon = 8
     52 
     53   integer, parameter :: acc_device_property_kind = int32
     54   ! OpenACC 2.6/2.7/3.0 used acc_device_property; in a spec update the
     55   ! missing '_kind' was added for consistency.  For backward compatibility, keep:
     56   integer, parameter :: acc_device_property = acc_device_property_kind
     57 
     58   ! Keep in sync with 'libgomp/libgomp-plugin.h:goacc_property'.
     59   integer (acc_device_property_kind), parameter :: acc_property_memory = 1
     60   integer (acc_device_property_kind), parameter :: acc_property_free_memory = 2
     61   integer (acc_device_property_kind), parameter :: acc_property_name = int(Z'10001')
     62   integer (acc_device_property_kind), parameter :: acc_property_vendor = int(Z'10002')
     63   integer (acc_device_property_kind), parameter :: acc_property_driver = int(Z'10003')
     64 
     65   integer, parameter :: acc_handle_kind = int32
     66 
     67   ! Keep in sync with include/gomp-constants.h.
     68   integer (acc_handle_kind), parameter :: acc_async_noval = -1
     69   integer (acc_handle_kind), parameter :: acc_async_sync = -2
     70 end module openacc_kinds
     71 
     72 module openacc_internal
     73   use openacc_kinds
     74   implicit none
     75 
     76   interface
     77     function acc_get_num_devices_h (devicetype)
     78       import
     79       integer acc_get_num_devices_h
     80       integer (acc_device_kind) devicetype
     81     end function
     82 
     83     subroutine acc_set_device_type_h (devicetype)
     84       import
     85       integer (acc_device_kind) devicetype
     86     end subroutine
     87 
     88     function acc_get_device_type_h ()
     89       import
     90       integer (acc_device_kind) acc_get_device_type_h
     91     end function
     92 
     93     subroutine acc_set_device_num_h (devicenum, devicetype)
     94       import
     95       integer devicenum
     96       integer (acc_device_kind) devicetype
     97     end subroutine
     98 
     99     function acc_get_device_num_h (devicetype)
    100       import
    101       integer acc_get_device_num_h
    102       integer (acc_device_kind) devicetype
    103     end function
    104 
    105     function acc_get_property_h (devicenum, devicetype, property)
    106       use iso_c_binding, only: c_size_t
    107       import
    108       implicit none (type, external)
    109       integer (c_size_t) :: acc_get_property_h
    110       integer, value :: devicenum
    111       integer (acc_device_kind), value :: devicetype
    112       integer (acc_device_property_kind), value :: property
    113     end function
    114 
    115     subroutine acc_get_property_string_h (devicenum, devicetype, property, string)
    116       import
    117       implicit none (type, external)
    118       integer, value :: devicenum
    119       integer (acc_device_kind), value :: devicetype
    120       integer (acc_device_property_kind), value :: property
    121       character (*) :: string
    122     end subroutine
    123 
    124     function acc_async_test_h (arg)
    125       logical acc_async_test_h
    126       integer arg
    127     end function
    128 
    129     function acc_async_test_all_h ()
    130       logical acc_async_test_all_h
    131     end function
    132 
    133     subroutine acc_wait_h (arg)
    134       integer arg
    135     end subroutine
    136 
    137     subroutine acc_wait_async_h (arg, async)
    138       integer arg, async
    139     end subroutine
    140 
    141     subroutine acc_wait_all_h ()
    142     end subroutine
    143 
    144     subroutine acc_wait_all_async_h (async)
    145       integer async
    146     end subroutine
    147 
    148     subroutine acc_init_h (devicetype)
    149       import
    150       integer (acc_device_kind) devicetype
    151     end subroutine
    152 
    153     subroutine acc_shutdown_h (devicetype)
    154       import
    155       integer (acc_device_kind) devicetype
    156     end subroutine
    157 
    158     function acc_on_device_h (devicetype)
    159       import
    160       integer (acc_device_kind) devicetype
    161       logical acc_on_device_h
    162     end function
    163 
    164     subroutine acc_copyin_32_h (a, len)
    165       use iso_c_binding, only: c_int32_t
    166       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    167       type (*), dimension (*) :: a
    168       integer (c_int32_t) len
    169     end subroutine
    170 
    171     subroutine acc_copyin_64_h (a, len)
    172       use iso_c_binding, only: c_int64_t
    173       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    174       type (*), dimension (*) :: a
    175       integer (c_int64_t) len
    176     end subroutine
    177 
    178     subroutine acc_copyin_array_h (a)
    179       type (*), dimension (..), contiguous :: a
    180     end subroutine
    181 
    182     subroutine acc_present_or_copyin_32_h (a, len)
    183       use iso_c_binding, only: c_int32_t
    184       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    185       type (*), dimension (*) :: a
    186       integer (c_int32_t) len
    187     end subroutine
    188 
    189     subroutine acc_present_or_copyin_64_h (a, len)
    190       use iso_c_binding, only: c_int64_t
    191       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    192       type (*), dimension (*) :: a
    193       integer (c_int64_t) len
    194     end subroutine
    195 
    196     subroutine acc_present_or_copyin_array_h (a)
    197       type (*), dimension (..), contiguous :: a
    198     end subroutine
    199 
    200     subroutine acc_create_32_h (a, len)
    201       use iso_c_binding, only: c_int32_t
    202       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    203       type (*), dimension (*) :: a
    204       integer (c_int32_t) len
    205     end subroutine
    206 
    207     subroutine acc_create_64_h (a, len)
    208       use iso_c_binding, only: c_int64_t
    209       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    210       type (*), dimension (*) :: a
    211       integer (c_int64_t) len
    212     end subroutine
    213 
    214     subroutine acc_create_array_h (a)
    215       type (*), dimension (..), contiguous :: a
    216     end subroutine
    217 
    218     subroutine acc_present_or_create_32_h (a, len)
    219       use iso_c_binding, only: c_int32_t
    220       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    221       type (*), dimension (*) :: a
    222       integer (c_int32_t) len
    223     end subroutine
    224 
    225     subroutine acc_present_or_create_64_h (a, len)
    226       use iso_c_binding, only: c_int64_t
    227       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    228       type (*), dimension (*) :: a
    229       integer (c_int64_t) len
    230     end subroutine
    231 
    232     subroutine acc_present_or_create_array_h (a)
    233       type (*), dimension (..), contiguous :: a
    234     end subroutine
    235 
    236     subroutine acc_copyout_32_h (a, len)
    237       use iso_c_binding, only: c_int32_t
    238       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    239       type (*), dimension (*) :: a
    240       integer (c_int32_t) len
    241     end subroutine
    242 
    243     subroutine acc_copyout_64_h (a, len)
    244       use iso_c_binding, only: c_int64_t
    245       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    246       type (*), dimension (*) :: a
    247       integer (c_int64_t) len
    248     end subroutine
    249 
    250     subroutine acc_copyout_array_h (a)
    251       type (*), dimension (..), contiguous :: a
    252     end subroutine
    253 
    254     subroutine acc_copyout_finalize_32_h (a, len)
    255       use iso_c_binding, only: c_int32_t
    256       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    257       type (*), dimension (*) :: a
    258       integer (c_int32_t) len
    259     end subroutine
    260 
    261     subroutine acc_copyout_finalize_64_h (a, len)
    262       use iso_c_binding, only: c_int64_t
    263       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    264       type (*), dimension (*) :: a
    265       integer (c_int64_t) len
    266     end subroutine
    267 
    268     subroutine acc_copyout_finalize_array_h (a)
    269       type (*), dimension (..), contiguous :: a
    270     end subroutine
    271 
    272     subroutine acc_delete_32_h (a, len)
    273       use iso_c_binding, only: c_int32_t
    274       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    275       type (*), dimension (*) :: a
    276       integer (c_int32_t) len
    277     end subroutine
    278 
    279     subroutine acc_delete_64_h (a, len)
    280       use iso_c_binding, only: c_int64_t
    281       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    282       type (*), dimension (*) :: a
    283       integer (c_int64_t) len
    284     end subroutine
    285 
    286     subroutine acc_delete_array_h (a)
    287       type (*), dimension (..), contiguous :: a
    288     end subroutine
    289 
    290     subroutine acc_delete_finalize_32_h (a, len)
    291       use iso_c_binding, only: c_int32_t
    292       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    293       type (*), dimension (*) :: a
    294       integer (c_int32_t) len
    295     end subroutine
    296 
    297     subroutine acc_delete_finalize_64_h (a, len)
    298       use iso_c_binding, only: c_int64_t
    299       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    300       type (*), dimension (*) :: a
    301       integer (c_int64_t) len
    302     end subroutine
    303 
    304     subroutine acc_delete_finalize_array_h (a)
    305       type (*), dimension (..), contiguous :: a
    306     end subroutine
    307 
    308     subroutine acc_update_device_32_h (a, len)
    309       use iso_c_binding, only: c_int32_t
    310       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    311       type (*), dimension (*) :: a
    312       integer (c_int32_t) len
    313     end subroutine
    314 
    315     subroutine acc_update_device_64_h (a, len)
    316       use iso_c_binding, only: c_int64_t
    317       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    318       type (*), dimension (*) :: a
    319       integer (c_int64_t) len
    320     end subroutine
    321 
    322     subroutine acc_update_device_array_h (a)
    323       type (*), dimension (..), contiguous :: a
    324     end subroutine
    325 
    326     subroutine acc_update_self_32_h (a, len)
    327       use iso_c_binding, only: c_int32_t
    328       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    329       type (*), dimension (*) :: a
    330       integer (c_int32_t) len
    331     end subroutine
    332 
    333     subroutine acc_update_self_64_h (a, len)
    334       use iso_c_binding, only: c_int64_t
    335       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    336       type (*), dimension (*) :: a
    337       integer (c_int64_t) len
    338     end subroutine
    339 
    340     subroutine acc_update_self_array_h (a)
    341       type (*), dimension (..), contiguous :: a
    342     end subroutine
    343 
    344     function acc_is_present_32_h (a, len)
    345       use iso_c_binding, only: c_int32_t
    346       logical acc_is_present_32_h
    347       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    348       type (*), dimension (*) :: a
    349       integer (c_int32_t) len
    350     end function
    351 
    352     function acc_is_present_64_h (a, len)
    353       use iso_c_binding, only: c_int64_t
    354       logical acc_is_present_64_h
    355       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    356       type (*), dimension (*) :: a
    357       integer (c_int64_t) len
    358     end function
    359 
    360     function acc_is_present_array_h (a)
    361       logical acc_is_present_array_h
    362       type (*), dimension (..), contiguous :: a
    363     end function
    364 
    365     subroutine acc_copyin_async_32_h (a, len, async)
    366       use iso_c_binding, only: c_int32_t
    367       use openacc_kinds, only: acc_handle_kind
    368       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    369       type (*), dimension (*) :: a
    370       integer (c_int32_t) len
    371       integer (acc_handle_kind) async
    372     end subroutine
    373 
    374     subroutine acc_copyin_async_64_h (a, len, async)
    375       use iso_c_binding, only: c_int64_t
    376       use openacc_kinds, only: acc_handle_kind
    377       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    378       type (*), dimension (*) :: a
    379       integer (c_int64_t) len
    380       integer (acc_handle_kind) async
    381     end subroutine
    382 
    383     subroutine acc_copyin_async_array_h (a, async)
    384       use openacc_kinds, only: acc_handle_kind
    385       type (*), dimension (..), contiguous :: a
    386       integer (acc_handle_kind) async
    387     end subroutine
    388 
    389     subroutine acc_create_async_32_h (a, len, async)
    390       use iso_c_binding, only: c_int32_t
    391       use openacc_kinds, only: acc_handle_kind
    392       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    393       type (*), dimension (*) :: a
    394       integer (c_int32_t) len
    395       integer (acc_handle_kind) async
    396     end subroutine
    397 
    398     subroutine acc_create_async_64_h (a, len, async)
    399       use iso_c_binding, only: c_int64_t
    400       use openacc_kinds, only: acc_handle_kind
    401       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    402       type (*), dimension (*) :: a
    403       integer (c_int64_t) len
    404       integer (acc_handle_kind) async
    405     end subroutine
    406 
    407     subroutine acc_create_async_array_h (a, async)
    408       use openacc_kinds, only: acc_handle_kind
    409       type (*), dimension (..), contiguous :: a
    410       integer (acc_handle_kind) async
    411     end subroutine
    412 
    413     subroutine acc_copyout_async_32_h (a, len, async)
    414       use iso_c_binding, only: c_int32_t
    415       use openacc_kinds, only: acc_handle_kind
    416       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    417       type (*), dimension (*) :: a
    418       integer (c_int32_t) len
    419       integer (acc_handle_kind) async
    420     end subroutine
    421 
    422     subroutine acc_copyout_async_64_h (a, len, async)
    423       use iso_c_binding, only: c_int64_t
    424       use openacc_kinds, only: acc_handle_kind
    425       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    426       type (*), dimension (*) :: a
    427       integer (c_int64_t) len
    428       integer (acc_handle_kind) async
    429     end subroutine
    430 
    431     subroutine acc_copyout_async_array_h (a, async)
    432       use openacc_kinds, only: acc_handle_kind
    433       type (*), dimension (..), contiguous :: a
    434       integer (acc_handle_kind) async
    435     end subroutine
    436 
    437     subroutine acc_delete_async_32_h (a, len, async)
    438       use iso_c_binding, only: c_int32_t
    439       use openacc_kinds, only: acc_handle_kind
    440       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    441       type (*), dimension (*) :: a
    442       integer (c_int32_t) len
    443       integer (acc_handle_kind) async
    444     end subroutine
    445 
    446     subroutine acc_delete_async_64_h (a, len, async)
    447       use iso_c_binding, only: c_int64_t
    448       use openacc_kinds, only: acc_handle_kind
    449       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    450       type (*), dimension (*) :: a
    451       integer (c_int64_t) len
    452       integer (acc_handle_kind) async
    453     end subroutine
    454 
    455     subroutine acc_delete_async_array_h (a, async)
    456       use openacc_kinds, only: acc_handle_kind
    457       type (*), dimension (..), contiguous :: a
    458       integer (acc_handle_kind) async
    459     end subroutine
    460 
    461     subroutine acc_update_device_async_32_h (a, len, async)
    462       use iso_c_binding, only: c_int32_t
    463       use openacc_kinds, only: acc_handle_kind
    464       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    465       type (*), dimension (*) :: a
    466       integer (c_int32_t) len
    467       integer (acc_handle_kind) async
    468     end subroutine
    469 
    470     subroutine acc_update_device_async_64_h (a, len, async)
    471       use iso_c_binding, only: c_int64_t
    472       use openacc_kinds, only: acc_handle_kind
    473       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    474       type (*), dimension (*) :: a
    475       integer (c_int64_t) len
    476       integer (acc_handle_kind) async
    477     end subroutine
    478 
    479     subroutine acc_update_device_async_array_h (a, async)
    480       use openacc_kinds, only: acc_handle_kind
    481       type (*), dimension (..), contiguous :: a
    482       integer (acc_handle_kind) async
    483     end subroutine
    484 
    485     subroutine acc_update_self_async_32_h (a, len, async)
    486       use iso_c_binding, only: c_int32_t
    487       use openacc_kinds, only: acc_handle_kind
    488       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    489       type (*), dimension (*) :: a
    490       integer (c_int32_t) len
    491       integer (acc_handle_kind) async
    492     end subroutine
    493 
    494     subroutine acc_update_self_async_64_h (a, len, async)
    495       use iso_c_binding, only: c_int64_t
    496       use openacc_kinds, only: acc_handle_kind
    497       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    498       type (*), dimension (*) :: a
    499       integer (c_int64_t) len
    500       integer (acc_handle_kind) async
    501     end subroutine
    502 
    503     subroutine acc_update_self_async_array_h (a, async)
    504       use openacc_kinds, only: acc_handle_kind
    505       type (*), dimension (..), contiguous :: a
    506       integer (acc_handle_kind) async
    507     end subroutine
    508   end interface
    509 
    510   interface
    511     function acc_get_num_devices_l (devicetype) &
    512         bind (C, name = "acc_get_num_devices")
    513       use iso_c_binding, only: c_int
    514       integer (c_int) :: acc_get_num_devices_l
    515       integer (c_int), value :: devicetype
    516     end function
    517 
    518     subroutine acc_set_device_type_l (devicetype) &
    519         bind (C, name = "acc_set_device_type")
    520       use iso_c_binding, only: c_int
    521       integer (c_int), value :: devicetype
    522     end subroutine
    523 
    524     function acc_get_device_type_l () &
    525         bind (C, name = "acc_get_device_type")
    526       use iso_c_binding, only: c_int
    527       integer (c_int) :: acc_get_device_type_l
    528     end function
    529 
    530     subroutine acc_set_device_num_l (devicenum, devicetype) &
    531         bind (C, name = "acc_set_device_num")
    532       use iso_c_binding, only: c_int
    533       integer (c_int), value :: devicenum, devicetype
    534     end subroutine
    535 
    536     function acc_get_device_num_l (devicetype) &
    537         bind (C, name = "acc_get_device_num")
    538       use iso_c_binding, only: c_int
    539       integer (c_int) :: acc_get_device_num_l
    540       integer (c_int), value :: devicetype
    541     end function
    542 
    543     function acc_get_property_l (devicenum, devicetype, property) &
    544         bind (C, name = "acc_get_property")
    545       use iso_c_binding, only: c_int, c_size_t
    546       implicit none (type, external)
    547       integer (c_size_t) :: acc_get_property_l
    548       integer (c_int), value :: devicenum
    549       integer (c_int), value :: devicetype
    550       integer (c_int), value :: property
    551     end function
    552 
    553     function acc_get_property_string_l (devicenum, devicetype, property) &
    554         bind (C, name = "acc_get_property_string")
    555       use iso_c_binding, only: c_int, c_ptr
    556       implicit none (type, external)
    557       type (c_ptr) :: acc_get_property_string_l
    558       integer (c_int), value :: devicenum
    559       integer (c_int), value :: devicetype
    560       integer (c_int), value :: property
    561     end function
    562 
    563     function acc_async_test_l (a) &
    564         bind (C, name = "acc_async_test")
    565       use iso_c_binding, only: c_int
    566       integer (c_int) :: acc_async_test_l
    567       integer (c_int), value :: a
    568     end function
    569 
    570     function acc_async_test_all_l () &
    571         bind (C, name = "acc_async_test_all")
    572       use iso_c_binding, only: c_int
    573       integer (c_int) :: acc_async_test_all_l
    574     end function
    575 
    576     subroutine acc_wait_l (a) &
    577         bind (C, name = "acc_wait")
    578       use iso_c_binding, only: c_int
    579       integer (c_int), value :: a
    580     end subroutine
    581 
    582     subroutine acc_wait_async_l (arg, async) &
    583         bind (C, name = "acc_wait_async")
    584       use iso_c_binding, only: c_int
    585       integer (c_int), value :: arg, async
    586     end subroutine
    587 
    588     subroutine acc_wait_all_l () &
    589         bind (C, name = "acc_wait_all")
    590       use iso_c_binding, only: c_int
    591     end subroutine
    592 
    593     subroutine acc_wait_all_async_l (async) &
    594         bind (C, name = "acc_wait_all_async")
    595       use iso_c_binding, only: c_int
    596       integer (c_int), value :: async
    597     end subroutine
    598 
    599     subroutine acc_init_l (devicetype) &
    600         bind (C, name = "acc_init")
    601       use iso_c_binding, only: c_int
    602       integer (c_int), value :: devicetype
    603     end subroutine
    604 
    605     subroutine acc_shutdown_l (devicetype) &
    606         bind (C, name = "acc_shutdown")
    607       use iso_c_binding, only: c_int
    608       integer (c_int), value :: devicetype
    609     end subroutine
    610 
    611     function acc_on_device_l (devicetype) &
    612         bind (C, name = "acc_on_device")
    613       use iso_c_binding, only: c_int
    614       integer (c_int) :: acc_on_device_l
    615       integer (c_int), value :: devicetype
    616     end function
    617 
    618     subroutine acc_copyin_l (a, len) &
    619         bind (C, name = "acc_copyin")
    620       use iso_c_binding, only: c_size_t
    621       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    622       type (*), dimension (*) :: a
    623       integer (c_size_t), value :: len
    624     end subroutine
    625 
    626     subroutine acc_present_or_copyin_l (a, len) &
    627         bind (C, name = "acc_present_or_copyin")
    628       use iso_c_binding, only: c_size_t
    629       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    630       type (*), dimension (*) :: a
    631       integer (c_size_t), value :: len
    632     end subroutine
    633 
    634     subroutine acc_create_l (a, len) &
    635         bind (C, name = "acc_create")
    636       use iso_c_binding, only: c_size_t
    637       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    638       type (*), dimension (*) :: a
    639       integer (c_size_t), value :: len
    640     end subroutine
    641 
    642     subroutine acc_present_or_create_l (a, len) &
    643         bind (C, name = "acc_present_or_create")
    644       use iso_c_binding, only: c_size_t
    645       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    646       type (*), dimension (*) :: a
    647       integer (c_size_t), value :: len
    648     end subroutine
    649 
    650     subroutine acc_copyout_l (a, len) &
    651         bind (C, name = "acc_copyout")
    652       use iso_c_binding, only: c_size_t
    653       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    654       type (*), dimension (*) :: a
    655       integer (c_size_t), value :: len
    656     end subroutine
    657 
    658     subroutine acc_copyout_finalize_l (a, len) &
    659         bind (C, name = "acc_copyout_finalize")
    660       use iso_c_binding, only: c_size_t
    661       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    662       type (*), dimension (*) :: a
    663       integer (c_size_t), value :: len
    664     end subroutine
    665 
    666     subroutine acc_delete_l (a, len) &
    667         bind (C, name = "acc_delete")
    668       use iso_c_binding, only: c_size_t
    669       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    670       type (*), dimension (*) :: a
    671       integer (c_size_t), value :: len
    672     end subroutine
    673 
    674     subroutine acc_delete_finalize_l (a, len) &
    675         bind (C, name = "acc_delete_finalize")
    676       use iso_c_binding, only: c_size_t
    677       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    678       type (*), dimension (*) :: a
    679       integer (c_size_t), value :: len
    680     end subroutine
    681 
    682     subroutine acc_update_device_l (a, len) &
    683         bind (C, name = "acc_update_device")
    684       use iso_c_binding, only: c_size_t
    685       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    686       type (*), dimension (*) :: a
    687       integer (c_size_t), value :: len
    688     end subroutine
    689 
    690     subroutine acc_update_self_l (a, len) &
    691         bind (C, name = "acc_update_self")
    692       use iso_c_binding, only: c_size_t
    693       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    694       type (*), dimension (*) :: a
    695       integer (c_size_t), value :: len
    696     end subroutine
    697 
    698     function acc_is_present_l (a, len) &
    699         bind (C, name = "acc_is_present")
    700       use iso_c_binding, only: c_int32_t, c_size_t
    701       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    702       integer (c_int32_t) :: acc_is_present_l
    703       type (*), dimension (*) :: a
    704       integer (c_size_t), value :: len
    705     end function
    706 
    707     subroutine acc_copyin_async_l (a, len, async) &
    708         bind (C, name = "acc_copyin_async")
    709       use iso_c_binding, only: c_size_t, c_int
    710       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    711       type (*), dimension (*) :: a
    712       integer (c_size_t), value :: len
    713       integer (c_int), value :: async
    714     end subroutine
    715 
    716     subroutine acc_create_async_l (a, len, async) &
    717         bind (C, name = "acc_create_async")
    718       use iso_c_binding, only: c_size_t, c_int
    719       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    720       type (*), dimension (*) :: a
    721       integer (c_size_t), value :: len
    722       integer (c_int), value :: async
    723     end subroutine
    724 
    725     subroutine acc_copyout_async_l (a, len, async) &
    726         bind (C, name = "acc_copyout_async")
    727       use iso_c_binding, only: c_size_t, c_int
    728       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    729       type (*), dimension (*) :: a
    730       integer (c_size_t), value :: len
    731       integer (c_int), value :: async
    732     end subroutine
    733 
    734     subroutine acc_delete_async_l (a, len, async) &
    735         bind (C, name = "acc_delete_async")
    736       use iso_c_binding, only: c_size_t, c_int
    737       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    738       type (*), dimension (*) :: a
    739       integer (c_size_t), value :: len
    740       integer (c_int), value :: async
    741     end subroutine
    742 
    743     subroutine acc_update_device_async_l (a, len, async) &
    744         bind (C, name = "acc_update_device_async")
    745       use iso_c_binding, only: c_size_t, c_int
    746       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    747       type (*), dimension (*) :: a
    748       integer (c_size_t), value :: len
    749       integer (c_int), value :: async
    750     end subroutine
    751 
    752     subroutine acc_update_self_async_l (a, len, async) &
    753         bind (C, name = "acc_update_self_async")
    754       use iso_c_binding, only: c_size_t, c_int
    755       !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
    756       type (*), dimension (*) :: a
    757       integer (c_size_t), value :: len
    758       integer (c_int), value :: async
    759     end subroutine
    760   end interface
    761 end module openacc_internal
    762 
    763 module openacc
    764   use openacc_kinds
    765   use openacc_internal
    766   implicit none
    767 
    768   private
    769 
    770   ! From openacc_kinds
    771   public :: acc_device_kind
    772   public :: acc_device_none, acc_device_default, acc_device_host
    773   public :: acc_device_not_host, acc_device_nvidia, acc_device_radeon
    774 
    775   public :: acc_device_property_kind, acc_device_property
    776   public :: acc_property_memory, acc_property_free_memory
    777   public :: acc_property_name, acc_property_vendor, acc_property_driver
    778 
    779   public :: acc_handle_kind
    780   public :: acc_async_noval, acc_async_sync
    781 
    782   public :: openacc_version
    783 
    784   public :: acc_get_num_devices, acc_set_device_type, acc_get_device_type
    785   public :: acc_set_device_num, acc_get_device_num
    786   public :: acc_get_property, acc_get_property_string
    787   public :: acc_async_test, acc_async_test_all
    788   public :: acc_wait, acc_async_wait, acc_wait_async
    789   public :: acc_wait_all, acc_async_wait_all, acc_wait_all_async
    790   public :: acc_init, acc_shutdown, acc_on_device, acc_malloc, acc_free
    791   public :: acc_copyin, acc_present_or_copyin, acc_pcopyin, acc_create
    792   public :: acc_present_or_create, acc_pcreate, acc_copyout, acc_delete
    793   public :: acc_update_device, acc_update_self, acc_map_data, acc_unmap_data
    794   public :: acc_deviceptr, acc_hostptr, acc_is_present
    795   public :: acc_copyin_async, acc_create_async, acc_copyout_async
    796   public :: acc_delete_async, acc_update_device_async, acc_update_self_async
    797   public :: acc_copyout_finalize, acc_delete_finalize
    798   public :: acc_memcpy_to_device, acc_memcpy_to_device_async
    799   public :: acc_memcpy_from_device, acc_memcpy_from_device_async
    800 
    801   integer, parameter :: openacc_version = 201711
    802 
    803   interface acc_get_num_devices
    804     procedure :: acc_get_num_devices_h
    805   end interface
    806 
    807   interface acc_set_device_type
    808     procedure :: acc_set_device_type_h
    809   end interface
    810 
    811   interface acc_get_device_type
    812     procedure :: acc_get_device_type_h
    813   end interface
    814 
    815   interface acc_set_device_num
    816     procedure :: acc_set_device_num_h
    817   end interface
    818 
    819   interface acc_get_device_num
    820     procedure :: acc_get_device_num_h
    821   end interface
    822 
    823   interface acc_get_property
    824     procedure :: acc_get_property_h
    825   end interface
    826 
    827   interface acc_get_property_string
    828     procedure :: acc_get_property_string_h
    829   end interface
    830 
    831   interface acc_async_test
    832     procedure :: acc_async_test_h
    833   end interface
    834 
    835   interface acc_async_test_all
    836     procedure :: acc_async_test_all_h
    837   end interface
    838 
    839   interface acc_wait
    840     procedure :: acc_wait_h
    841   end interface
    842 
    843   ! acc_async_wait is an OpenACC 1.0 compatibility name for acc_wait.
    844   interface acc_async_wait
    845     procedure :: acc_wait_h
    846   end interface
    847 
    848   interface acc_wait_async
    849     procedure :: acc_wait_async_h
    850   end interface
    851 
    852   interface acc_wait_all
    853     procedure :: acc_wait_all_h
    854   end interface
    855 
    856   ! acc_async_wait_all is an OpenACC 1.0 compatibility name for acc_wait_all.
    857   interface acc_async_wait_all
    858     procedure :: acc_wait_all_h
    859   end interface
    860 
    861   interface acc_wait_all_async
    862     procedure :: acc_wait_all_async_h
    863   end interface
    864 
    865   interface acc_init
    866     procedure :: acc_init_h
    867   end interface
    868 
    869   interface acc_shutdown
    870     procedure :: acc_shutdown_h
    871   end interface
    872 
    873   interface acc_on_device
    874     procedure :: acc_on_device_h
    875   end interface
    876 
    877   interface
    878     type(c_ptr) function acc_malloc (bytes) bind(C)
    879       use iso_c_binding, only: c_ptr, c_size_t
    880       integer(c_size_t), value :: bytes
    881     end function
    882   end interface
    883 
    884   interface
    885     subroutine acc_free (data_dev) bind(C)
    886       use iso_c_binding, only: c_ptr
    887       type(c_ptr), value :: data_dev
    888     end subroutine
    889   end interface
    890 
    891   ! As vendor extension, the following code supports both 32bit and 64bit
    892   ! arguments for "size"; the OpenACC standard only permits default-kind
    893   ! integers, which are of kind 4 (i.e. 32 bits).
    894   ! Additionally, the two-argument version also takes arrays as argument.
    895   ! and the one argument version also scalars. Note that the code assumes
    896   ! that the arrays are contiguous.
    897 
    898   interface acc_copyin
    899     procedure :: acc_copyin_32_h
    900     procedure :: acc_copyin_64_h
    901     procedure :: acc_copyin_array_h
    902   end interface
    903 
    904   interface acc_present_or_copyin
    905     procedure :: acc_present_or_copyin_32_h
    906     procedure :: acc_present_or_copyin_64_h
    907     procedure :: acc_present_or_copyin_array_h
    908   end interface
    909 
    910   interface acc_pcopyin
    911     procedure :: acc_present_or_copyin_32_h
    912     procedure :: acc_present_or_copyin_64_h
    913     procedure :: acc_present_or_copyin_array_h
    914   end interface
    915 
    916   interface acc_create
    917     procedure :: acc_create_32_h
    918     procedure :: acc_create_64_h
    919     procedure :: acc_create_array_h
    920   end interface
    921 
    922   interface acc_present_or_create
    923     procedure :: acc_present_or_create_32_h
    924     procedure :: acc_present_or_create_64_h
    925     procedure :: acc_present_or_create_array_h
    926   end interface
    927 
    928   interface acc_pcreate
    929     procedure :: acc_present_or_create_32_h
    930     procedure :: acc_present_or_create_64_h
    931     procedure :: acc_present_or_create_array_h
    932   end interface
    933 
    934   interface acc_copyout
    935     procedure :: acc_copyout_32_h
    936     procedure :: acc_copyout_64_h
    937     procedure :: acc_copyout_array_h
    938   end interface
    939 
    940   interface acc_copyout_finalize
    941     procedure :: acc_copyout_finalize_32_h
    942     procedure :: acc_copyout_finalize_64_h
    943     procedure :: acc_copyout_finalize_array_h
    944   end interface
    945 
    946   interface acc_delete
    947     procedure :: acc_delete_32_h
    948     procedure :: acc_delete_64_h
    949     procedure :: acc_delete_array_h
    950   end interface
    951 
    952   interface acc_delete_finalize
    953     procedure :: acc_delete_finalize_32_h
    954     procedure :: acc_delete_finalize_64_h
    955     procedure :: acc_delete_finalize_array_h
    956   end interface
    957 
    958   interface acc_update_device
    959     procedure :: acc_update_device_32_h
    960     procedure :: acc_update_device_64_h
    961     procedure :: acc_update_device_array_h
    962   end interface
    963 
    964   interface acc_update_self
    965     procedure :: acc_update_self_32_h
    966     procedure :: acc_update_self_64_h
    967     procedure :: acc_update_self_array_h
    968   end interface
    969 
    970   interface
    971     subroutine acc_map_data (data_arg, data_dev, bytes) bind(C)
    972       use iso_c_binding, only: c_ptr, c_size_t
    973       type(*), dimension(*) :: data_arg
    974       type(c_ptr), value :: data_dev
    975       integer(c_size_t), value :: bytes
    976     end subroutine
    977   end interface
    978 
    979   interface
    980     subroutine acc_unmap_data (data_arg) bind(C)
    981       type(*), dimension(*) :: data_arg
    982     end subroutine
    983   end interface
    984 
    985   interface
    986     type(c_ptr) function acc_deviceptr (data_arg) bind(C)
    987       use iso_c_binding, only: c_ptr
    988       type(*), dimension(*) :: data_arg
    989     end function
    990   end interface
    991 
    992   interface
    993     type(c_ptr) function acc_hostptr (data_dev) bind(C)
    994       use iso_c_binding, only: c_ptr
    995       type(c_ptr), value :: data_dev
    996     end function
    997   end interface
    998 
    999   interface acc_is_present
   1000     procedure :: acc_is_present_32_h
   1001     procedure :: acc_is_present_64_h
   1002     procedure :: acc_is_present_array_h
   1003   end interface
   1004 
   1005   interface
   1006     subroutine acc_memcpy_to_device (data_dev_dest, data_host_src,  &
   1007                                      bytes) bind(C)
   1008       use iso_c_binding, only: c_ptr, c_size_t
   1009       type(c_ptr), value :: data_dev_dest
   1010       type(*),dimension(*) :: data_host_src
   1011       integer(c_size_t), value :: bytes
   1012     end subroutine
   1013   end interface
   1014 
   1015   interface
   1016     subroutine acc_memcpy_to_device_async (data_dev_dest, data_host_src,  &
   1017                                            bytes, async_arg) bind(C)
   1018       use iso_c_binding, only: c_ptr, c_size_t
   1019       import :: acc_handle_kind
   1020       type(c_ptr), value :: data_dev_dest
   1021       type(*),dimension(*) :: data_host_src
   1022       integer(c_size_t), value :: bytes
   1023       integer(acc_handle_kind), value :: async_arg
   1024     end subroutine
   1025   end interface
   1026 
   1027   interface
   1028     subroutine acc_memcpy_from_device (data_host_dest, data_dev_src,  &
   1029                                        bytes) bind(C)
   1030       use iso_c_binding, only: c_ptr, c_size_t
   1031       type(*),dimension(*) :: data_host_dest
   1032       type(c_ptr), value :: data_dev_src
   1033       integer(c_size_t), value :: bytes
   1034     end subroutine
   1035   end interface
   1036 
   1037   interface
   1038     subroutine acc_memcpy_from_device_async (data_host_dest, data_dev_src,  &
   1039                                              bytes, async_arg) bind(C)
   1040       use iso_c_binding, only: c_ptr, c_size_t
   1041       import :: acc_handle_kind
   1042       type(*),dimension(*) :: data_host_dest
   1043       type(c_ptr), value :: data_dev_src
   1044       integer(c_size_t), value :: bytes
   1045       integer(acc_handle_kind), value :: async_arg
   1046     end subroutine
   1047   end interface
   1048 
   1049   interface acc_copyin_async
   1050     procedure :: acc_copyin_async_32_h
   1051     procedure :: acc_copyin_async_64_h
   1052     procedure :: acc_copyin_async_array_h
   1053   end interface
   1054 
   1055   interface acc_create_async
   1056     procedure :: acc_create_async_32_h
   1057     procedure :: acc_create_async_64_h
   1058     procedure :: acc_create_async_array_h
   1059   end interface
   1060 
   1061   interface acc_copyout_async
   1062     procedure :: acc_copyout_async_32_h
   1063     procedure :: acc_copyout_async_64_h
   1064     procedure :: acc_copyout_async_array_h
   1065   end interface
   1066 
   1067   interface acc_delete_async
   1068     procedure :: acc_delete_async_32_h
   1069     procedure :: acc_delete_async_64_h
   1070     procedure :: acc_delete_async_array_h
   1071   end interface
   1072 
   1073   interface acc_update_device_async
   1074     procedure :: acc_update_device_async_32_h
   1075     procedure :: acc_update_device_async_64_h
   1076     procedure :: acc_update_device_async_array_h
   1077   end interface
   1078 
   1079   interface acc_update_self_async
   1080     procedure :: acc_update_self_async_32_h
   1081     procedure :: acc_update_self_async_64_h
   1082     procedure :: acc_update_self_async_array_h
   1083   end interface
   1084 
   1085 end module openacc
   1086 
   1087 function acc_get_num_devices_h (devicetype)
   1088   use openacc_internal, only: acc_get_num_devices_l
   1089   use openacc_kinds
   1090   integer acc_get_num_devices_h
   1091   integer (acc_device_kind) devicetype
   1092   acc_get_num_devices_h = acc_get_num_devices_l (devicetype)
   1093 end function
   1094 
   1095 subroutine acc_set_device_type_h (devicetype)
   1096   use openacc_internal, only: acc_set_device_type_l
   1097   use openacc_kinds
   1098   integer (acc_device_kind) devicetype
   1099   call acc_set_device_type_l (devicetype)
   1100 end subroutine
   1101 
   1102 function acc_get_device_type_h ()
   1103   use openacc_internal, only: acc_get_device_type_l
   1104   use openacc_kinds
   1105   integer (acc_device_kind) acc_get_device_type_h
   1106   acc_get_device_type_h = acc_get_device_type_l ()
   1107 end function
   1108 
   1109 subroutine acc_set_device_num_h (devicenum, devicetype)
   1110   use openacc_internal, only: acc_set_device_num_l
   1111   use openacc_kinds
   1112   integer devicenum
   1113   integer (acc_device_kind) devicetype
   1114   call acc_set_device_num_l (devicenum, devicetype)
   1115 end subroutine
   1116 
   1117 function acc_get_device_num_h (devicetype)
   1118   use openacc_internal, only: acc_get_device_num_l
   1119   use openacc_kinds
   1120   integer acc_get_device_num_h
   1121   integer (acc_device_kind) devicetype
   1122   acc_get_device_num_h = acc_get_device_num_l (devicetype)
   1123 end function
   1124 
   1125 function acc_get_property_h (devicenum, devicetype, property)
   1126   use iso_c_binding, only: c_size_t
   1127   use openacc_internal, only: acc_get_property_l
   1128   use openacc_kinds
   1129   implicit none (type, external)
   1130   integer (c_size_t) :: acc_get_property_h
   1131   integer, value :: devicenum
   1132   integer (acc_device_kind), value :: devicetype
   1133   integer (acc_device_property_kind), value :: property
   1134   acc_get_property_h = acc_get_property_l (devicenum, devicetype, property)
   1135 end function
   1136 
   1137 subroutine acc_get_property_string_h (devicenum, devicetype, property, string)
   1138   use iso_c_binding, only: c_char, c_size_t, c_ptr, c_f_pointer, c_associated
   1139   use openacc_internal, only: acc_get_property_string_l
   1140   use openacc_kinds
   1141   implicit none (type, external)
   1142   integer, value :: devicenum
   1143   integer (acc_device_kind), value :: devicetype
   1144   integer (acc_device_property_kind), value :: property
   1145   character (*) :: string
   1146 
   1147   type (c_ptr) :: cptr
   1148   integer(c_size_t) :: clen, slen, i
   1149   character (kind=c_char, len=1), pointer, contiguous :: sptr (:)
   1150 
   1151   interface
   1152      function strlen (s) bind (C, name = "strlen")
   1153        use iso_c_binding, only: c_ptr, c_size_t
   1154        type (c_ptr), intent(in), value :: s
   1155        integer (c_size_t) :: strlen
   1156      end function strlen
   1157   end interface
   1158 
   1159   cptr = acc_get_property_string_l (devicenum, devicetype, property)
   1160   string = ""
   1161   if (.not. c_associated (cptr)) then
   1162      return
   1163   end if
   1164 
   1165   clen = strlen (cptr)
   1166   call c_f_pointer (cptr, sptr, [clen])
   1167 
   1168   slen = min (clen, len (string, kind=c_size_t))
   1169   do i = 1, slen
   1170     string (i:i) = sptr (i)
   1171   end do
   1172 end subroutine
   1173 
   1174 function acc_async_test_h (arg)
   1175   use openacc_internal, only: acc_async_test_l
   1176   logical acc_async_test_h
   1177   integer arg
   1178   acc_async_test_h = acc_async_test_l (arg) /= 0
   1179 end function
   1180 
   1181 function acc_async_test_all_h ()
   1182   use openacc_internal, only: acc_async_test_all_l
   1183   logical acc_async_test_all_h
   1184   acc_async_test_all_h = acc_async_test_all_l () /= 0
   1185 end function
   1186 
   1187 subroutine acc_wait_h (arg)
   1188   use openacc_internal, only: acc_wait_l
   1189   integer arg
   1190   call acc_wait_l (arg)
   1191 end subroutine
   1192 
   1193 subroutine acc_wait_async_h (arg, async)
   1194   use openacc_internal, only: acc_wait_async_l
   1195   integer arg, async
   1196   call acc_wait_async_l (arg, async)
   1197 end subroutine
   1198 
   1199 subroutine acc_wait_all_h ()
   1200   use openacc_internal, only: acc_wait_all_l
   1201   call acc_wait_all_l ()
   1202 end subroutine
   1203 
   1204 subroutine acc_wait_all_async_h (async)
   1205   use openacc_internal, only: acc_wait_all_async_l
   1206   integer async
   1207   call acc_wait_all_async_l (async)
   1208 end subroutine
   1209 
   1210 subroutine acc_init_h (devicetype)
   1211   use openacc_internal, only: acc_init_l
   1212   use openacc_kinds
   1213   integer (acc_device_kind) devicetype
   1214   call acc_init_l (devicetype)
   1215 end subroutine
   1216 
   1217 subroutine acc_shutdown_h (devicetype)
   1218   use openacc_internal, only: acc_shutdown_l
   1219   use openacc_kinds
   1220   integer (acc_device_kind) devicetype
   1221   call acc_shutdown_l (devicetype)
   1222 end subroutine
   1223 
   1224 function acc_on_device_h (devicetype)
   1225   use openacc_internal, only: acc_on_device_l
   1226   use openacc_kinds
   1227   integer (acc_device_kind) devicetype
   1228   logical acc_on_device_h
   1229   acc_on_device_h = acc_on_device_l (devicetype) /= 0
   1230 end function
   1231 
   1232 subroutine acc_copyin_32_h (a, len)
   1233   use iso_c_binding, only: c_int32_t, c_size_t
   1234   use openacc_internal, only: acc_copyin_l
   1235   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1236   type (*), dimension (*) :: a
   1237   integer (c_int32_t) len
   1238   call acc_copyin_l (a, int (len, kind = c_size_t))
   1239 end subroutine
   1240 
   1241 subroutine acc_copyin_64_h (a, len)
   1242   use iso_c_binding, only: c_int64_t, c_size_t
   1243   use openacc_internal, only: acc_copyin_l
   1244   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1245   type (*), dimension (*) :: a
   1246   integer (c_int64_t) len
   1247   call acc_copyin_l (a, int (len, kind = c_size_t))
   1248 end subroutine
   1249 
   1250 subroutine acc_copyin_array_h (a)
   1251   use openacc_internal, only: acc_copyin_l
   1252   type (*), dimension (..), contiguous :: a
   1253   call acc_copyin_l (a, sizeof (a))
   1254 end subroutine
   1255 
   1256 subroutine acc_present_or_copyin_32_h (a, len)
   1257   use iso_c_binding, only: c_int32_t, c_size_t
   1258   use openacc_internal, only: acc_present_or_copyin_l
   1259   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1260   type (*), dimension (*) :: a
   1261   integer (c_int32_t) len
   1262   call acc_present_or_copyin_l (a, int (len, kind = c_size_t))
   1263 end subroutine
   1264 
   1265 subroutine acc_present_or_copyin_64_h (a, len)
   1266   use iso_c_binding, only: c_int64_t, c_size_t
   1267   use openacc_internal, only: acc_present_or_copyin_l
   1268   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1269   type (*), dimension (*) :: a
   1270   integer (c_int64_t) len
   1271   call acc_present_or_copyin_l (a, int (len, kind = c_size_t))
   1272 end subroutine
   1273 
   1274 subroutine acc_present_or_copyin_array_h (a)
   1275   use openacc_internal, only: acc_present_or_copyin_l
   1276   type (*), dimension (..), contiguous :: a
   1277   call acc_present_or_copyin_l (a, sizeof (a))
   1278 end subroutine
   1279 
   1280 subroutine acc_create_32_h (a, len)
   1281   use iso_c_binding, only: c_int32_t, c_size_t
   1282   use openacc_internal, only: acc_create_l
   1283   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1284   type (*), dimension (*) :: a
   1285   integer (c_int32_t) len
   1286   call acc_create_l (a, int (len, kind = c_size_t))
   1287 end subroutine
   1288 
   1289 subroutine acc_create_64_h (a, len)
   1290   use iso_c_binding, only: c_int64_t, c_size_t
   1291   use openacc_internal, only: acc_create_l
   1292   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1293   type (*), dimension (*) :: a
   1294   integer (c_int64_t) len
   1295   call acc_create_l (a, int (len, kind = c_size_t))
   1296 end subroutine
   1297 
   1298 subroutine acc_create_array_h (a)
   1299   use openacc_internal, only: acc_create_l
   1300   type (*), dimension (..), contiguous :: a
   1301   call acc_create_l (a, sizeof (a))
   1302 end subroutine
   1303 
   1304 subroutine acc_present_or_create_32_h (a, len)
   1305   use iso_c_binding, only: c_int32_t, c_size_t
   1306   use openacc_internal, only: acc_present_or_create_l
   1307   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1308   type (*), dimension (*) :: a
   1309   integer (c_int32_t) len
   1310   call acc_present_or_create_l (a, int (len, kind = c_size_t))
   1311 end subroutine
   1312 
   1313 subroutine acc_present_or_create_64_h (a, len)
   1314   use iso_c_binding, only: c_int64_t, c_size_t
   1315   use openacc_internal, only: acc_present_or_create_l
   1316   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1317   type (*), dimension (*) :: a
   1318   integer (c_int64_t) len
   1319   call acc_present_or_create_l (a, int (len, kind = c_size_t))
   1320 end subroutine
   1321 
   1322 subroutine acc_present_or_create_array_h (a)
   1323   use openacc_internal, only: acc_present_or_create_l
   1324   type (*), dimension (..), contiguous :: a
   1325   call acc_present_or_create_l (a, sizeof (a))
   1326 end subroutine
   1327 
   1328 subroutine acc_copyout_32_h (a, len)
   1329   use iso_c_binding, only: c_int32_t, c_size_t
   1330   use openacc_internal, only: acc_copyout_l
   1331   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1332   type (*), dimension (*) :: a
   1333   integer (c_int32_t) len
   1334   call acc_copyout_l (a, int (len, kind = c_size_t))
   1335 end subroutine
   1336 
   1337 subroutine acc_copyout_64_h (a, len)
   1338   use iso_c_binding, only: c_int64_t, c_size_t
   1339   use openacc_internal, only: acc_copyout_l
   1340   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1341   type (*), dimension (*) :: a
   1342   integer (c_int64_t) len
   1343   call acc_copyout_l (a, int (len, kind = c_size_t))
   1344 end subroutine
   1345 
   1346 subroutine acc_copyout_array_h (a)
   1347   use openacc_internal, only: acc_copyout_l
   1348   type (*), dimension (..), contiguous :: a
   1349   call acc_copyout_l (a, sizeof (a))
   1350 end subroutine
   1351 
   1352 subroutine acc_copyout_finalize_32_h (a, len)
   1353   use iso_c_binding, only: c_int32_t, c_size_t
   1354   use openacc_internal, only: acc_copyout_finalize_l
   1355   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1356   type (*), dimension (*) :: a
   1357   integer (c_int32_t) len
   1358   call acc_copyout_finalize_l (a, int (len, kind = c_size_t))
   1359 end subroutine
   1360 
   1361 subroutine acc_copyout_finalize_64_h (a, len)
   1362   use iso_c_binding, only: c_int64_t, c_size_t
   1363   use openacc_internal, only: acc_copyout_finalize_l
   1364   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1365   type (*), dimension (*) :: a
   1366   integer (c_int64_t) len
   1367   call acc_copyout_finalize_l (a, int (len, kind = c_size_t))
   1368 end subroutine
   1369 
   1370 subroutine acc_copyout_finalize_array_h (a)
   1371   use openacc_internal, only: acc_copyout_finalize_l
   1372   type (*), dimension (..), contiguous :: a
   1373   call acc_copyout_finalize_l (a, sizeof (a))
   1374 end subroutine
   1375 
   1376 subroutine acc_delete_32_h (a, len)
   1377   use iso_c_binding, only: c_int32_t, c_size_t
   1378   use openacc_internal, only: acc_delete_l
   1379   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1380   type (*), dimension (*) :: a
   1381   integer (c_int32_t) len
   1382   call acc_delete_l (a, int (len, kind = c_size_t))
   1383 end subroutine
   1384 
   1385 subroutine acc_delete_64_h (a, len)
   1386   use iso_c_binding, only: c_int64_t, c_size_t
   1387   use openacc_internal, only: acc_delete_l
   1388   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1389   type (*), dimension (*) :: a
   1390   integer (c_int64_t) len
   1391   call acc_delete_l (a, int (len, kind = c_size_t))
   1392 end subroutine
   1393 
   1394 subroutine acc_delete_array_h (a)
   1395   use openacc_internal, only: acc_delete_l
   1396   type (*), dimension (..), contiguous :: a
   1397   call acc_delete_l (a, sizeof (a))
   1398 end subroutine
   1399 
   1400 subroutine acc_delete_finalize_32_h (a, len)
   1401   use iso_c_binding, only: c_int32_t, c_size_t
   1402   use openacc_internal, only: acc_delete_finalize_l
   1403   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1404   type (*), dimension (*) :: a
   1405   integer (c_int32_t) len
   1406   call acc_delete_finalize_l (a, int (len, kind = c_size_t))
   1407 end subroutine
   1408 
   1409 subroutine acc_delete_finalize_64_h (a, len)
   1410   use iso_c_binding, only: c_int64_t, c_size_t
   1411   use openacc_internal, only: acc_delete_finalize_l
   1412   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1413   type (*), dimension (*) :: a
   1414   integer (c_int64_t) len
   1415   call acc_delete_finalize_l (a, int (len, kind = c_size_t))
   1416 end subroutine
   1417 
   1418 subroutine acc_delete_finalize_array_h (a)
   1419   use openacc_internal, only: acc_delete_finalize_l
   1420   type (*), dimension (..), contiguous :: a
   1421   call acc_delete_finalize_l (a, sizeof (a))
   1422 end subroutine
   1423 
   1424 subroutine acc_update_device_32_h (a, len)
   1425   use iso_c_binding, only: c_int32_t, c_size_t
   1426   use openacc_internal, only: acc_update_device_l
   1427   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1428   type (*), dimension (*) :: a
   1429   integer (c_int32_t) len
   1430   call acc_update_device_l (a, int (len, kind = c_size_t))
   1431 end subroutine
   1432 
   1433 subroutine acc_update_device_64_h (a, len)
   1434   use iso_c_binding, only: c_int64_t, c_size_t
   1435   use openacc_internal, only: acc_update_device_l
   1436   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1437   type (*), dimension (*) :: a
   1438   integer (c_int64_t) len
   1439   call acc_update_device_l (a, int (len, kind = c_size_t))
   1440 end subroutine
   1441 
   1442 subroutine acc_update_device_array_h (a)
   1443   use openacc_internal, only: acc_update_device_l
   1444   type (*), dimension (..), contiguous :: a
   1445   call acc_update_device_l (a, sizeof (a))
   1446 end subroutine
   1447 
   1448 subroutine acc_update_self_32_h (a, len)
   1449   use iso_c_binding, only: c_int32_t, c_size_t
   1450   use openacc_internal, only: acc_update_self_l
   1451   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1452   type (*), dimension (*) :: a
   1453   integer (c_int32_t) len
   1454   call acc_update_self_l (a, int (len, kind = c_size_t))
   1455 end subroutine
   1456 
   1457 subroutine acc_update_self_64_h (a, len)
   1458   use iso_c_binding, only: c_int64_t, c_size_t
   1459   use openacc_internal, only: acc_update_self_l
   1460   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1461   type (*), dimension (*) :: a
   1462   integer (c_int64_t) len
   1463   call acc_update_self_l (a, int (len, kind = c_size_t))
   1464 end subroutine
   1465 
   1466 subroutine acc_update_self_array_h (a)
   1467   use openacc_internal, only: acc_update_self_l
   1468   type (*), dimension (..), contiguous :: a
   1469   call acc_update_self_l (a, sizeof (a))
   1470 end subroutine
   1471 
   1472 function acc_is_present_32_h (a, len)
   1473   use iso_c_binding, only: c_int32_t, c_size_t
   1474   use openacc_internal, only: acc_is_present_l
   1475   logical acc_is_present_32_h
   1476   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1477   type (*), dimension (*) :: a
   1478   integer (c_int32_t) len
   1479   acc_is_present_32_h = acc_is_present_l (a, int (len, kind = c_size_t)) /= 0
   1480 end function
   1481 
   1482 function acc_is_present_64_h (a, len)
   1483   use iso_c_binding, only: c_int64_t, c_size_t
   1484   use openacc_internal, only: acc_is_present_l
   1485   logical acc_is_present_64_h
   1486   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1487   type (*), dimension (*) :: a
   1488   integer (c_int64_t) len
   1489   acc_is_present_64_h = acc_is_present_l (a, int (len, kind = c_size_t)) /= 0
   1490 end function
   1491 
   1492 function acc_is_present_array_h (a)
   1493   use openacc_internal, only: acc_is_present_l
   1494   logical acc_is_present_array_h
   1495   type (*), dimension (..), contiguous :: a
   1496   acc_is_present_array_h = acc_is_present_l (a, sizeof (a)) /= 0
   1497 end function
   1498 
   1499 subroutine acc_copyin_async_32_h (a, len, async)
   1500   use iso_c_binding, only: c_int32_t, c_size_t, c_int
   1501   use openacc_internal, only: acc_copyin_async_l
   1502   use openacc_kinds, only: acc_handle_kind
   1503   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1504   type (*), dimension (*) :: a
   1505   integer (c_int32_t) len
   1506   integer (acc_handle_kind) async
   1507   call acc_copyin_async_l (a, int (len, kind = c_size_t), int (async, kind = c_int))
   1508 end subroutine
   1509 
   1510 subroutine acc_copyin_async_64_h (a, len, async)
   1511   use iso_c_binding, only: c_int64_t, c_size_t, c_int
   1512   use openacc_internal, only: acc_copyin_async_l
   1513   use openacc_kinds, only: acc_handle_kind
   1514   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1515   type (*), dimension (*) :: a
   1516   integer (c_int64_t) len
   1517   integer (acc_handle_kind) async
   1518   call acc_copyin_async_l (a, int (len, kind = c_size_t), int (async, kind = c_int))
   1519 end subroutine
   1520 
   1521 subroutine acc_copyin_async_array_h (a, async)
   1522   use iso_c_binding, only: c_int
   1523   use openacc_internal, only: acc_copyin_async_l
   1524   use openacc_kinds, only: acc_handle_kind
   1525   type (*), dimension (..), contiguous :: a
   1526   integer (acc_handle_kind) async
   1527   call acc_copyin_async_l (a, sizeof (a), int (async, kind = c_int))
   1528 end subroutine
   1529 
   1530 subroutine acc_create_async_32_h (a, len, async)
   1531   use iso_c_binding, only: c_int32_t, c_size_t, c_int
   1532   use openacc_internal, only: acc_create_async_l
   1533   use openacc_kinds, only: acc_handle_kind
   1534   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1535   type (*), dimension (*) :: a
   1536   integer (c_int32_t) len
   1537   integer (acc_handle_kind) async
   1538   call acc_create_async_l (a, int (len, kind = c_size_t), int (async, kind = c_int))
   1539 end subroutine
   1540 
   1541 subroutine acc_create_async_64_h (a, len, async)
   1542   use iso_c_binding, only: c_int64_t, c_size_t, c_int
   1543   use openacc_internal, only: acc_create_async_l
   1544   use openacc_kinds, only: acc_handle_kind
   1545   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1546   type (*), dimension (*) :: a
   1547   integer (c_int64_t) len
   1548   integer (acc_handle_kind) async
   1549   call acc_create_async_l (a, int (len, kind = c_size_t), int (async, kind = c_int))
   1550 end subroutine
   1551 
   1552 subroutine acc_create_async_array_h (a, async)
   1553   use iso_c_binding, only: c_int
   1554   use openacc_internal, only: acc_create_async_l
   1555   use openacc_kinds, only: acc_handle_kind
   1556   type (*), dimension (..), contiguous :: a
   1557   integer (acc_handle_kind) async
   1558   call acc_create_async_l (a, sizeof (a), int (async, kind = c_int))
   1559 end subroutine
   1560 
   1561 subroutine acc_copyout_async_32_h (a, len, async)
   1562   use iso_c_binding, only: c_int32_t, c_size_t, c_int
   1563   use openacc_internal, only: acc_copyout_async_l
   1564   use openacc_kinds, only: acc_handle_kind
   1565   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1566   type (*), dimension (*) :: a
   1567   integer (c_int32_t) len
   1568   integer (acc_handle_kind) async
   1569   call acc_copyout_async_l (a, int (len, kind = c_size_t), int (async, kind = c_int))
   1570 end subroutine
   1571 
   1572 subroutine acc_copyout_async_64_h (a, len, async)
   1573   use iso_c_binding, only: c_int64_t, c_size_t, c_int
   1574   use openacc_internal, only: acc_copyout_async_l
   1575   use openacc_kinds, only: acc_handle_kind
   1576   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1577   type (*), dimension (*) :: a
   1578   integer (c_int64_t) len
   1579   integer (acc_handle_kind) async
   1580   call acc_copyout_async_l (a, int (len, kind = c_size_t), int (async, kind = c_int))
   1581 end subroutine
   1582 
   1583 subroutine acc_copyout_async_array_h (a, async)
   1584   use iso_c_binding, only: c_int
   1585   use openacc_internal, only: acc_copyout_async_l
   1586   use openacc_kinds, only: acc_handle_kind
   1587   type (*), dimension (..), contiguous :: a
   1588   integer (acc_handle_kind) async
   1589   call acc_copyout_async_l (a, sizeof (a), int (async, kind = c_int))
   1590 end subroutine
   1591 
   1592 subroutine acc_delete_async_32_h (a, len, async)
   1593   use iso_c_binding, only: c_int32_t, c_size_t, c_int
   1594   use openacc_internal, only: acc_delete_async_l
   1595   use openacc_kinds, only: acc_handle_kind
   1596   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1597   type (*), dimension (*) :: a
   1598   integer (c_int32_t) len
   1599   integer (acc_handle_kind) async
   1600   call acc_delete_async_l (a, int (len, kind = c_size_t), int (async, kind = c_int))
   1601 end subroutine
   1602 
   1603 subroutine acc_delete_async_64_h (a, len, async)
   1604   use iso_c_binding, only: c_int64_t, c_size_t, c_int
   1605   use openacc_internal, only: acc_delete_async_l
   1606   use openacc_kinds, only: acc_handle_kind
   1607   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1608   type (*), dimension (*) :: a
   1609   integer (c_int64_t) len
   1610   integer (acc_handle_kind) async
   1611   call acc_delete_async_l (a, int (len, kind = c_size_t), int (async, kind = c_int))
   1612 end subroutine
   1613 
   1614 subroutine acc_delete_async_array_h (a, async)
   1615   use iso_c_binding, only: c_int
   1616   use openacc_internal, only: acc_delete_async_l
   1617   use openacc_kinds, only: acc_handle_kind
   1618   type (*), dimension (..), contiguous :: a
   1619   integer (acc_handle_kind) async
   1620   call acc_delete_async_l (a, sizeof (a), int (async, kind = c_int))
   1621 end subroutine
   1622 
   1623 subroutine acc_update_device_async_32_h (a, len, async)
   1624   use iso_c_binding, only: c_int32_t, c_size_t, c_int
   1625   use openacc_internal, only: acc_update_device_async_l
   1626   use openacc_kinds, only: acc_handle_kind
   1627   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1628   type (*), dimension (*) :: a
   1629   integer (c_int32_t) len
   1630   integer (acc_handle_kind) async
   1631   call acc_update_device_async_l (a, int (len, kind = c_size_t), int (async, kind = c_int))
   1632 end subroutine
   1633 
   1634 subroutine acc_update_device_async_64_h (a, len, async)
   1635   use iso_c_binding, only: c_int64_t, c_size_t, c_int
   1636   use openacc_internal, only: acc_update_device_async_l
   1637   use openacc_kinds, only: acc_handle_kind
   1638   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1639   type (*), dimension (*) :: a
   1640   integer (c_int64_t) len
   1641   integer (acc_handle_kind) async
   1642   call acc_update_device_async_l (a, int (len, kind = c_size_t), int (async, kind = c_int))
   1643 end subroutine
   1644 
   1645 subroutine acc_update_device_async_array_h (a, async)
   1646   use iso_c_binding, only: c_int
   1647   use openacc_internal, only: acc_update_device_async_l
   1648   use openacc_kinds, only: acc_handle_kind
   1649   type (*), dimension (..), contiguous :: a
   1650   integer (acc_handle_kind) async
   1651   call acc_update_device_async_l (a, sizeof (a), int (async, kind = c_int))
   1652 end subroutine
   1653 
   1654 subroutine acc_update_self_async_32_h (a, len, async)
   1655   use iso_c_binding, only: c_int32_t, c_size_t, c_int
   1656   use openacc_internal, only: acc_update_self_async_l
   1657   use openacc_kinds, only: acc_handle_kind
   1658   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1659   type (*), dimension (*) :: a
   1660   integer (c_int32_t) len
   1661   integer (acc_handle_kind) async
   1662   call acc_update_self_async_l (a, int (len, kind = c_size_t), int (async, kind = c_int))
   1663 end subroutine
   1664 
   1665 subroutine acc_update_self_async_64_h (a, len, async)
   1666   use iso_c_binding, only: c_int64_t, c_size_t, c_int
   1667   use openacc_internal, only: acc_update_self_async_l
   1668   use openacc_kinds, only: acc_handle_kind
   1669   !GCC$ ATTRIBUTES NO_ARG_CHECK :: a
   1670   type (*), dimension (*) :: a
   1671   integer (c_int64_t) len
   1672   integer (acc_handle_kind) async
   1673   call acc_update_self_async_l (a, int (len, kind = c_size_t), int (async, kind = c_int))
   1674 end subroutine
   1675 
   1676 subroutine acc_update_self_async_array_h (a, async)
   1677   use iso_c_binding, only: c_int
   1678   use openacc_internal, only: acc_update_self_async_l
   1679   use openacc_kinds, only: acc_handle_kind
   1680   type (*), dimension (..), contiguous :: a
   1681   integer (acc_handle_kind) async
   1682   call acc_update_self_async_l (a, sizeof (a), int (async, kind = c_int))
   1683 end subroutine
   1684