829c6349e9
gcc/c-family/ * c-pragma.h (enum pragma_omp_clause): Add PRAGMA_OACC_CLAUSE_{FINALIZE,IF_PRESENT}. Remove PRAGMA_OACC_CLAUSE_PRESENT_OR_{COPY,COPYIN,COPYOUT,CREATE}. gcc/c/ * c-parser.c (c_parser_omp_clause_name): Add support for finalize and if_present. Make present_or_{copy,copyin,copyout,create} aliases to their non-present_or_* counterparts. Make 'self' an alias to PRAGMA_OACC_CLAUSE_HOST. (c_parser_oacc_data_clause): Update GOMP mappings for PRAGMA_OACC_CLAUSE_{COPY,COPYIN,COPYOUT,CREATE,DELETE}. Remove PRAGMA_OACC_CLAUSE_{SELF,PRESENT_OR_*}. (c_parser_oacc_all_clauses): Handle finalize and if_present clauses. Remove support for present_or_* clauses. (OACC_KERNELS_CLAUSE_MASK): Remove PRESENT_OR_* clauses. (OACC_PARALLEL_CLAUSE_MASK): Likewise. (OACC_DECLARE_CLAUSE_MASK): Likewise. (OACC_DATA_CLAUSE_MASK): Likewise. (OACC_ENTER_DATA_CLAUSE_MASK): Remove PRESENT_OR_* clauses. (OACC_EXIT_DATA_CLAUSE_MASK): Add FINALIZE clause. (OACC_UPDATE_CLAUSE_MASK): Remove SELF, add IF_PRESENT. (c_parser_oacc_declare): Remove PRESENT_OR_* clauses. * c-typeck.c (c_finish_omp_clauses): Handle IF_PRESENT and FINALIZE. gcc/cp/ * parser.c (cp_parser_omp_clause_name): Add support for finalize and if_present. Make present_or_{copy,copyin,copyout,create} aliases to their non-present_or_* counterparts. Make 'self' an alias to PRAGMA_OACC_CLAUSE_HOST. (cp_parser_oacc_data_clause): Update GOMP mappings for PRAGMA_OACC_CLAUSE_{COPY,COPYIN,COPYOUT,CREATE,DELETE}. Remove PRAGMA_OACC_CLAUSE_{SELF,PRESENT_OR_*}. (cp_parser_oacc_all_clauses): Handle finalize and if_present clauses. Remove support for present_or_* clauses. (OACC_KERNELS_CLAUSE_MASK): Remove PRESENT_OR_* clauses. (OACC_PARALLEL_CLAUSE_MASK): Likewise. (OACC_DECLARE_CLAUSE_MASK): Likewise. (OACC_DATA_CLAUSE_MASK): Likewise. (OACC_ENTER_DATA_CLAUSE_MASK): Remove PRESENT_OR_* clauses. (OACC_EXIT_DATA_CLAUSE_MASK): Add FINALIZE clause. (OACC_UPDATE_CLAUSE_MASK): Remove SELF, add IF_PRESENT. (cp_parser_oacc_declare): Remove PRESENT_OR_* clauses. * pt.c (tsubst_omp_clauses): Handle IF_PRESENT and FINALIZE. * semantics.c (finish_omp_clauses): Handle IF_PRESENT and FINALIZE. gcc/fortran/ * gfortran.h (gfc_omp_clauses): Add unsigned if_present, finalize bitfields. * openmp.c (enum omp_mask2): Remove OMP_CLAUSE_PRESENT_OR_*. Add OMP_CLAUSE_{IF_PRESENT,FINALIZE}. (gfc_match_omp_clauses): Update handling of copy, copyin, copyout, create, deviceptr, present_of_*. Add support for finalize and if_present. (OACC_PARALLEL_CLAUSES): Remove PRESENT_OR_* clauses. (OACC_KERNELS_CLAUSES): Likewise. (OACC_DATA_CLAUSES): Likewise. (OACC_DECLARE_CLAUSES): Likewise. (OACC_UPDATE_CLAUSES): Add IF_PRESENT clause. (OACC_ENTER_DATA_CLAUSES): Remove PRESENT_OR_* clauses. (OACC_EXIT_DATA_CLAUSES): Add FINALIZE clause. (gfc_match_oacc_declare): Update to OpenACC 2.5 semantics. * trans-openmp.c (gfc_trans_omp_clauses): Add support for IF_PRESENT and FINALIZE. gcc/ * gimplify.c (gimplify_scan_omp_clauses): Add support for OMP_CLAUSE_{IF_PRESENT,FINALIZE}. (gimplify_adjust_omp_clauses): Likewise. (gimplify_oacc_declare_1): Add support for GOMP_MAP_RELEASE, remove support for GOMP_MAP_FORCE_{ALLOC,TO,FROM,TOFROM}. (gimplify_omp_target_update): Update handling of acc update and enter/exit data. * omp-low.c (install_var_field): Remove unused parameter base_pointers_restrict. (scan_sharing_clauses): Remove base_pointers_restrict parameter. Update call to install_var_field. Handle OMP_CLAUSE_{IF_PRESENT, FINALIZE} (omp_target_base_pointers_restrict_p): Delete. (scan_omp_target): Update call to scan_sharing_clauses. * tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_{IF_PRESENT, FINALIZE}. * tree-nested.c (convert_nonlocal_omp_clauses): Handle OMP_CLAUSE_{IF_PRESENT,FINALIZE}. (convert_local_omp_clauses): Likewise. * tree-pretty-print.c (dump_omp_clause): Likewise. * tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_{IF_PRESENT, FINALIZE}. (omp_clause_code_name): Likewise. gcc/testsuite/ * c-c++-common/goacc/declare-1.c: Update test case to utilize OpenACC 2.5 data clause semantics. * c-c++-common/goacc/declare-2.c: Likewise. * c-c++-common/goacc/default-4.c: Likewise. * c-c++-common/goacc/finalize-1.c: New test. * c-c++-common/goacc/kernels-alias-2.c: Update test case to utilize OpenACC 2.5 data clause semantics. * c-c++-common/goacc/kernels-alias.c: Likewise. * c-c++-common/goacc/routine-5.c: Likewise. * c-c++-common/goacc/update-if_present-1.c: New test. * c-c++-common/goacc/update-if_present-2.c: New test. * g++.dg/goacc/template.C: Update test case to utilize OpenACC 2.5 data clause semantics. * gfortran.dg/goacc/combined-directives.f90: Likewise. * gfortran.dg/goacc/data-tree.f95: Likewise. * gfortran.dg/goacc/declare-2.f95: Likewise. * gfortran.dg/goacc/default-4.f: Likewise. * gfortran.dg/goacc/enter-exit-data.f95: Likewise. * gfortran.dg/goacc/finalize-1.f: New test. * gfortran.dg/goacc/kernels-alias-2.f95: Update test case to utilize OpenACC 2.5 data clause semantics. * gfortran.dg/goacc/kernels-alias.f95: Likewise. * gfortran.dg/goacc/kernels-tree.f95: Likewise. * gfortran.dg/goacc/nested-function-1.f90: Likewise. * gfortran.dg/goacc/parallel-tree.f95: Likewise. * gfortran.dg/goacc/reduction-promotions.f90: Likewise. * gfortran.dg/goacc/update-if_present-1.f90: New test. * gfortran.dg/goacc/update-if_present-2.f90: New test. libgomp/ * libgomp.h (struct splay_tree_key_s): Add dynamic_refcount member. (gomp_acc_remove_pointer): Update declaration. (gomp_acc_declare_allocate): Declare. (gomp_remove_var): Declare. * libgomp.map (OACC_2.5): Define. * oacc-mem.c (acc_map_data): Update refcount. (acc_unmap_data): Likewise. (present_create_copy): Likewise. (acc_create): Add FLAG_PRESENT when calling present_create_copy. (acc_copyin): Likewise. (FLAG_FINALIZE): Define. (delete_copyout): Update dynamic refcounts, add support for FINALIZE. (acc_delete_finalize): New function. (acc_delete_finalize_async): New function. (acc_copyout_finalize): New function. (acc_copyout_finalize_async): New function. (gomp_acc_insert_pointer): Update refcounts. (gomp_acc_remove_pointer): Return if data is not present on the accelerator. * oacc-parallel.c (find_pset): Rename to find_pointer. (find_pointer): Add support for GOMP_MAP_POINTER. (handle_ftn_pointers): New function. (GOACC_parallel_keyed): Update refcounts of variables. (GOACC_enter_exit_data): Add support for finalized data mappings. Add support for GOMP_MAP_{TO,ALLOC,RELESE,FROM}. Update handling of fortran arrays. (GOACC_update): Add support for GOMP_MAP_{ALWAYS_POINTER,TO,FROM}. (GOACC_declare): Add support for GOMP_MAP_RELEASE, remove support for GOMP_MAP_FORCE_FROM. * openacc.f90 (module openacc_internal): Add acc_copyout_finalize_{32_h,64_h,array_h,_l}, and acc_delete_finalize_{32_h,64_h,array_h,_l}. Add interfaces for acc_copyout_finalize and acc_delete_finalize. (acc_copyout_finalize_32_h): New subroutine. (acc_copyout_finalize_64_h): New subroutine. (acc_copyout_finalize_array_h): New subroutine. (acc_delete_finalize_32_h): New subroutine. (acc_delete_finalize_64_h): New subroutine. (acc_delete_finalize_array_h): New subroutine. * openacc.h (acc_copyout_finalize): Declare. (acc_copyout_finalize_async): Declare. (acc_delete_finalize): Declare. (acc_delete_finalize_async): Declare. * openacc_lib.h (acc_copyout_finalize): New interface. (acc_delete_finalize): New interface. * target.c (gomp_map_vars): Update dynamic_refcount. (gomp_remove_var): New function. (gomp_unmap_vars): Use it. (gomp_unload_image_from_device): Likewise. * testsuite/libgomp.oacc-c-c++-common/data-already-1.c: Update test case to utilize OpenACC 2.5 data clause semantics. * testsuite/libgomp.oacc-c-c++-common/data-already-2.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/data-already-3.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/data-already-4.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/data-already-5.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/data-already-6.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/data-already-7.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/data-already-8.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-16.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-25.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-32.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-83.c: Likewise. * testsuite/libgomp.oacc-fortran/data-5.f90: New test. * testsuite/libgomp.oacc-fortran/data-already-1.f: Update test case to utilize OpenACC 2.5 data clause semantics. * testsuite/libgomp.oacc-fortran/data-already-2.f: Likewise. * testsuite/libgomp.oacc-fortran/data-already-3.f: Likewise. * testsuite/libgomp.oacc-fortran/data-already-4.f: Likewise. * testsuite/libgomp.oacc-fortran/data-already-5.f: Likewise. * testsuite/libgomp.oacc-fortran/data-already-6.f: Likewise. * testsuite/libgomp.oacc-fortran/data-already-7.f: Likewise. * testsuite/libgomp.oacc-fortran/data-already-8.f: Likewise. * testsuite/libgomp.oacc-fortran/lib-32-1.f: Likewise. * testsuite/libgomp.oacc-fortran/lib-32-2.f: Likewise. Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com> Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com> From-SVN: r261813
1081 lines
31 KiB
Fortran
1081 lines
31 KiB
Fortran
! OpenACC Runtime Library Definitions.
|
|
|
|
! Copyright (C) 2014-2018 Free Software Foundation, Inc.
|
|
|
|
! Contributed by Tobias Burnus <burnus@net-b.de>
|
|
! and Mentor Embedded.
|
|
|
|
! This file is part of the GNU Offloading and Multi Processing Library
|
|
! (libgomp).
|
|
|
|
! Libgomp is free software; you can redistribute it and/or modify it
|
|
! under the terms of the GNU General Public License as published by
|
|
! the Free Software Foundation; either version 3, or (at your option)
|
|
! any later version.
|
|
|
|
! Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
! FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
! more details.
|
|
|
|
! Under Section 7 of GPL version 3, you are granted additional
|
|
! permissions described in the GCC Runtime Library Exception, version
|
|
! 3.1, as published by the Free Software Foundation.
|
|
|
|
! You should have received a copy of the GNU General Public License and
|
|
! a copy of the GCC Runtime Library Exception along with this program;
|
|
! see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
! <http://www.gnu.org/licenses/>.
|
|
|
|
module openacc_kinds
|
|
use iso_fortran_env, only: int32
|
|
implicit none
|
|
|
|
private :: int32
|
|
public :: acc_device_kind
|
|
|
|
integer, parameter :: acc_device_kind = int32
|
|
|
|
public :: acc_device_none, acc_device_default, acc_device_host
|
|
public :: acc_device_not_host, acc_device_nvidia
|
|
|
|
! Keep in sync with include/gomp-constants.h.
|
|
integer (acc_device_kind), parameter :: acc_device_none = 0
|
|
integer (acc_device_kind), parameter :: acc_device_default = 1
|
|
integer (acc_device_kind), parameter :: acc_device_host = 2
|
|
! integer (acc_device_kind), parameter :: acc_device_host_nonshm = 3 removed.
|
|
integer (acc_device_kind), parameter :: acc_device_not_host = 4
|
|
integer (acc_device_kind), parameter :: acc_device_nvidia = 5
|
|
|
|
public :: acc_handle_kind
|
|
|
|
integer, parameter :: acc_handle_kind = int32
|
|
|
|
public :: acc_async_noval, acc_async_sync
|
|
|
|
! Keep in sync with include/gomp-constants.h.
|
|
integer (acc_handle_kind), parameter :: acc_async_noval = -1
|
|
integer (acc_handle_kind), parameter :: acc_async_sync = -2
|
|
|
|
end module
|
|
|
|
module openacc_internal
|
|
use openacc_kinds
|
|
implicit none
|
|
|
|
interface
|
|
function acc_get_num_devices_h (d)
|
|
import
|
|
integer acc_get_num_devices_h
|
|
integer (acc_device_kind) d
|
|
end function
|
|
|
|
subroutine acc_set_device_type_h (d)
|
|
import
|
|
integer (acc_device_kind) d
|
|
end subroutine
|
|
|
|
function acc_get_device_type_h ()
|
|
import
|
|
integer (acc_device_kind) acc_get_device_type_h
|
|
end function
|
|
|
|
subroutine acc_set_device_num_h (n, d)
|
|
import
|
|
integer n
|
|
integer (acc_device_kind) d
|
|
end subroutine
|
|
|
|
function acc_get_device_num_h (d)
|
|
import
|
|
integer acc_get_device_num_h
|
|
integer (acc_device_kind) d
|
|
end function
|
|
|
|
function acc_async_test_h (a)
|
|
logical acc_async_test_h
|
|
integer a
|
|
end function
|
|
|
|
function acc_async_test_all_h ()
|
|
logical acc_async_test_all_h
|
|
end function
|
|
|
|
subroutine acc_wait_h (a)
|
|
integer a
|
|
end subroutine
|
|
|
|
subroutine acc_wait_async_h (a1, a2)
|
|
integer a1, a2
|
|
end subroutine
|
|
|
|
subroutine acc_wait_all_h ()
|
|
end subroutine
|
|
|
|
subroutine acc_wait_all_async_h (a)
|
|
integer a
|
|
end subroutine
|
|
|
|
subroutine acc_init_h (d)
|
|
import
|
|
integer (acc_device_kind) d
|
|
end subroutine
|
|
|
|
subroutine acc_shutdown_h (d)
|
|
import
|
|
integer (acc_device_kind) d
|
|
end subroutine
|
|
|
|
function acc_on_device_h (d)
|
|
import
|
|
integer (acc_device_kind) d
|
|
logical acc_on_device_h
|
|
end function
|
|
|
|
subroutine acc_copyin_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_copyin_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_copyin_array_h (a)
|
|
type (*), dimension (..), contiguous :: a
|
|
end subroutine
|
|
|
|
subroutine acc_present_or_copyin_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_present_or_copyin_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_present_or_copyin_array_h (a)
|
|
type (*), dimension (..), contiguous :: a
|
|
end subroutine
|
|
|
|
subroutine acc_create_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_create_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_create_array_h (a)
|
|
type (*), dimension (..), contiguous :: a
|
|
end subroutine
|
|
|
|
subroutine acc_present_or_create_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_present_or_create_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_present_or_create_array_h (a)
|
|
type (*), dimension (..), contiguous :: a
|
|
end subroutine
|
|
|
|
subroutine acc_copyout_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_copyout_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_copyout_array_h (a)
|
|
type (*), dimension (..), contiguous :: a
|
|
end subroutine
|
|
|
|
subroutine acc_copyout_finalize_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_copyout_finalize_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_copyout_finalize_array_h (a)
|
|
type (*), dimension (..), contiguous :: a
|
|
end subroutine
|
|
|
|
subroutine acc_delete_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_delete_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_delete_array_h (a)
|
|
type (*), dimension (..), contiguous :: a
|
|
end subroutine
|
|
|
|
subroutine acc_delete_finalize_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_delete_finalize_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_delete_finalize_array_h (a)
|
|
type (*), dimension (..), contiguous :: a
|
|
end subroutine
|
|
|
|
subroutine acc_update_device_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_update_device_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_update_device_array_h (a)
|
|
type (*), dimension (..), contiguous :: a
|
|
end subroutine
|
|
|
|
subroutine acc_update_self_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_update_self_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
end subroutine
|
|
|
|
subroutine acc_update_self_array_h (a)
|
|
type (*), dimension (..), contiguous :: a
|
|
end subroutine
|
|
|
|
function acc_is_present_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t
|
|
logical acc_is_present_32_h
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
end function
|
|
|
|
function acc_is_present_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t
|
|
logical acc_is_present_64_h
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
end function
|
|
|
|
function acc_is_present_array_h (a)
|
|
logical acc_is_present_array_h
|
|
type (*), dimension (..), contiguous :: a
|
|
end function
|
|
end interface
|
|
|
|
interface
|
|
function acc_get_num_devices_l (d) &
|
|
bind (C, name = "acc_get_num_devices")
|
|
use iso_c_binding, only: c_int
|
|
integer (c_int) :: acc_get_num_devices_l
|
|
integer (c_int), value :: d
|
|
end function
|
|
|
|
subroutine acc_set_device_type_l (d) &
|
|
bind (C, name = "acc_set_device_type")
|
|
use iso_c_binding, only: c_int
|
|
integer (c_int), value :: d
|
|
end subroutine
|
|
|
|
function acc_get_device_type_l () &
|
|
bind (C, name = "acc_get_device_type")
|
|
use iso_c_binding, only: c_int
|
|
integer (c_int) :: acc_get_device_type_l
|
|
end function
|
|
|
|
subroutine acc_set_device_num_l (n, d) &
|
|
bind (C, name = "acc_set_device_num")
|
|
use iso_c_binding, only: c_int
|
|
integer (c_int), value :: n, d
|
|
end subroutine
|
|
|
|
function acc_get_device_num_l (d) &
|
|
bind (C, name = "acc_get_device_num")
|
|
use iso_c_binding, only: c_int
|
|
integer (c_int) :: acc_get_device_num_l
|
|
integer (c_int), value :: d
|
|
end function
|
|
|
|
function acc_async_test_l (a) &
|
|
bind (C, name = "acc_async_test")
|
|
use iso_c_binding, only: c_int
|
|
integer (c_int) :: acc_async_test_l
|
|
integer (c_int), value :: a
|
|
end function
|
|
|
|
function acc_async_test_all_l () &
|
|
bind (C, name = "acc_async_test_all")
|
|
use iso_c_binding, only: c_int
|
|
integer (c_int) :: acc_async_test_all_l
|
|
end function
|
|
|
|
subroutine acc_wait_l (a) &
|
|
bind (C, name = "acc_wait")
|
|
use iso_c_binding, only: c_int
|
|
integer (c_int), value :: a
|
|
end subroutine
|
|
|
|
subroutine acc_wait_async_l (a1, a2) &
|
|
bind (C, name = "acc_wait_async")
|
|
use iso_c_binding, only: c_int
|
|
integer (c_int), value :: a1, a2
|
|
end subroutine
|
|
|
|
subroutine acc_wait_all_l () &
|
|
bind (C, name = "acc_wait_all")
|
|
use iso_c_binding, only: c_int
|
|
end subroutine
|
|
|
|
subroutine acc_wait_all_async_l (a) &
|
|
bind (C, name = "acc_wait_all_async")
|
|
use iso_c_binding, only: c_int
|
|
integer (c_int), value :: a
|
|
end subroutine
|
|
|
|
subroutine acc_init_l (d) &
|
|
bind (C, name = "acc_init")
|
|
use iso_c_binding, only: c_int
|
|
integer (c_int), value :: d
|
|
end subroutine
|
|
|
|
subroutine acc_shutdown_l (d) &
|
|
bind (C, name = "acc_shutdown")
|
|
use iso_c_binding, only: c_int
|
|
integer (c_int), value :: d
|
|
end subroutine
|
|
|
|
function acc_on_device_l (d) &
|
|
bind (C, name = "acc_on_device")
|
|
use iso_c_binding, only: c_int
|
|
integer (c_int) :: acc_on_device_l
|
|
integer (c_int), value :: d
|
|
end function
|
|
|
|
subroutine acc_copyin_l (a, len) &
|
|
bind (C, name = "acc_copyin")
|
|
use iso_c_binding, only: c_size_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_size_t), value :: len
|
|
end subroutine
|
|
|
|
subroutine acc_present_or_copyin_l (a, len) &
|
|
bind (C, name = "acc_present_or_copyin")
|
|
use iso_c_binding, only: c_size_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_size_t), value :: len
|
|
end subroutine
|
|
|
|
subroutine acc_create_l (a, len) &
|
|
bind (C, name = "acc_create")
|
|
use iso_c_binding, only: c_size_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_size_t), value :: len
|
|
end subroutine
|
|
|
|
subroutine acc_present_or_create_l (a, len) &
|
|
bind (C, name = "acc_present_or_create")
|
|
use iso_c_binding, only: c_size_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_size_t), value :: len
|
|
end subroutine
|
|
|
|
subroutine acc_copyout_l (a, len) &
|
|
bind (C, name = "acc_copyout")
|
|
use iso_c_binding, only: c_size_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_size_t), value :: len
|
|
end subroutine
|
|
|
|
subroutine acc_copyout_finalize_l (a, len) &
|
|
bind (C, name = "acc_copyout_finalize")
|
|
use iso_c_binding, only: c_size_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_size_t), value :: len
|
|
end subroutine
|
|
|
|
subroutine acc_delete_l (a, len) &
|
|
bind (C, name = "acc_delete")
|
|
use iso_c_binding, only: c_size_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_size_t), value :: len
|
|
end subroutine
|
|
|
|
subroutine acc_delete_finalize_l (a, len) &
|
|
bind (C, name = "acc_delete_finalize")
|
|
use iso_c_binding, only: c_size_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_size_t), value :: len
|
|
end subroutine
|
|
|
|
subroutine acc_update_device_l (a, len) &
|
|
bind (C, name = "acc_update_device")
|
|
use iso_c_binding, only: c_size_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_size_t), value :: len
|
|
end subroutine
|
|
|
|
subroutine acc_update_self_l (a, len) &
|
|
bind (C, name = "acc_update_self")
|
|
use iso_c_binding, only: c_size_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_size_t), value :: len
|
|
end subroutine
|
|
|
|
function acc_is_present_l (a, len) &
|
|
bind (C, name = "acc_is_present")
|
|
use iso_c_binding, only: c_int32_t, c_size_t
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
integer (c_int32_t) :: acc_is_present_l
|
|
type (*), dimension (*) :: a
|
|
integer (c_size_t), value :: len
|
|
end function
|
|
end interface
|
|
end module
|
|
|
|
module openacc
|
|
use openacc_kinds
|
|
use openacc_internal
|
|
implicit none
|
|
|
|
public :: openacc_version
|
|
|
|
public :: acc_get_num_devices, acc_set_device_type, acc_get_device_type
|
|
public :: acc_set_device_num, acc_get_device_num, acc_async_test
|
|
public :: acc_async_test_all
|
|
public :: acc_wait, acc_async_wait, acc_wait_async
|
|
public :: acc_wait_all, acc_async_wait_all, acc_wait_all_async
|
|
public :: acc_init, acc_shutdown, acc_on_device
|
|
public :: acc_copyin, acc_present_or_copyin, acc_pcopyin, acc_create
|
|
public :: acc_present_or_create, acc_pcreate, acc_copyout, acc_delete
|
|
public :: acc_update_device, acc_update_self, acc_is_present
|
|
|
|
integer, parameter :: openacc_version = 201306
|
|
|
|
interface acc_get_num_devices
|
|
procedure :: acc_get_num_devices_h
|
|
end interface
|
|
|
|
interface acc_set_device_type
|
|
procedure :: acc_set_device_type_h
|
|
end interface
|
|
|
|
interface acc_get_device_type
|
|
procedure :: acc_get_device_type_h
|
|
end interface
|
|
|
|
interface acc_set_device_num
|
|
procedure :: acc_set_device_num_h
|
|
end interface
|
|
|
|
interface acc_get_device_num
|
|
procedure :: acc_get_device_num_h
|
|
end interface
|
|
|
|
interface acc_async_test
|
|
procedure :: acc_async_test_h
|
|
end interface
|
|
|
|
interface acc_async_test_all
|
|
procedure :: acc_async_test_all_h
|
|
end interface
|
|
|
|
interface acc_wait
|
|
procedure :: acc_wait_h
|
|
end interface
|
|
|
|
! acc_async_wait is an OpenACC 1.0 compatibility name for acc_wait.
|
|
interface acc_async_wait
|
|
procedure :: acc_wait_h
|
|
end interface
|
|
|
|
interface acc_wait_async
|
|
procedure :: acc_wait_async_h
|
|
end interface
|
|
|
|
interface acc_wait_all
|
|
procedure :: acc_wait_all_h
|
|
end interface
|
|
|
|
! acc_async_wait_all is an OpenACC 1.0 compatibility name for acc_wait_all.
|
|
interface acc_async_wait_all
|
|
procedure :: acc_wait_all_h
|
|
end interface
|
|
|
|
interface acc_wait_all_async
|
|
procedure :: acc_wait_all_async_h
|
|
end interface
|
|
|
|
interface acc_init
|
|
procedure :: acc_init_h
|
|
end interface
|
|
|
|
interface acc_shutdown
|
|
procedure :: acc_shutdown_h
|
|
end interface
|
|
|
|
interface acc_on_device
|
|
procedure :: acc_on_device_h
|
|
end interface
|
|
|
|
! acc_malloc: Only available in C/C++
|
|
! acc_free: Only available in C/C++
|
|
|
|
! As vendor extension, the following code supports both 32bit and 64bit
|
|
! arguments for "size"; the OpenACC standard only permits default-kind
|
|
! integers, which are of kind 4 (i.e. 32 bits).
|
|
! Additionally, the two-argument version also takes arrays as argument.
|
|
! and the one argument version also scalars. Note that the code assumes
|
|
! that the arrays are contiguous.
|
|
|
|
interface acc_copyin
|
|
procedure :: acc_copyin_32_h
|
|
procedure :: acc_copyin_64_h
|
|
procedure :: acc_copyin_array_h
|
|
end interface
|
|
|
|
interface acc_present_or_copyin
|
|
procedure :: acc_present_or_copyin_32_h
|
|
procedure :: acc_present_or_copyin_64_h
|
|
procedure :: acc_present_or_copyin_array_h
|
|
end interface
|
|
|
|
interface acc_pcopyin
|
|
procedure :: acc_present_or_copyin_32_h
|
|
procedure :: acc_present_or_copyin_64_h
|
|
procedure :: acc_present_or_copyin_array_h
|
|
end interface
|
|
|
|
interface acc_create
|
|
procedure :: acc_create_32_h
|
|
procedure :: acc_create_64_h
|
|
procedure :: acc_create_array_h
|
|
end interface
|
|
|
|
interface acc_present_or_create
|
|
procedure :: acc_present_or_create_32_h
|
|
procedure :: acc_present_or_create_64_h
|
|
procedure :: acc_present_or_create_array_h
|
|
end interface
|
|
|
|
interface acc_pcreate
|
|
procedure :: acc_present_or_create_32_h
|
|
procedure :: acc_present_or_create_64_h
|
|
procedure :: acc_present_or_create_array_h
|
|
end interface
|
|
|
|
interface acc_copyout
|
|
procedure :: acc_copyout_32_h
|
|
procedure :: acc_copyout_64_h
|
|
procedure :: acc_copyout_array_h
|
|
end interface
|
|
|
|
interface acc_copyout_finalize
|
|
procedure :: acc_copyout_finalize_32_h
|
|
procedure :: acc_copyout_finalize_64_h
|
|
procedure :: acc_copyout_finalize_array_h
|
|
end interface
|
|
|
|
interface acc_delete
|
|
procedure :: acc_delete_32_h
|
|
procedure :: acc_delete_64_h
|
|
procedure :: acc_delete_array_h
|
|
end interface
|
|
|
|
interface acc_delete_finalize
|
|
procedure :: acc_delete_finalize_32_h
|
|
procedure :: acc_delete_finalize_64_h
|
|
procedure :: acc_delete_finalize_array_h
|
|
end interface
|
|
|
|
interface acc_update_device
|
|
procedure :: acc_update_device_32_h
|
|
procedure :: acc_update_device_64_h
|
|
procedure :: acc_update_device_array_h
|
|
end interface
|
|
|
|
interface acc_update_self
|
|
procedure :: acc_update_self_32_h
|
|
procedure :: acc_update_self_64_h
|
|
procedure :: acc_update_self_array_h
|
|
end interface
|
|
|
|
! acc_map_data: Only available in C/C++
|
|
! acc_unmap_data: Only available in C/C++
|
|
! acc_deviceptr: Only available in C/C++
|
|
! acc_hostptr: Only available in C/C++
|
|
|
|
interface acc_is_present
|
|
procedure :: acc_is_present_32_h
|
|
procedure :: acc_is_present_64_h
|
|
procedure :: acc_is_present_array_h
|
|
end interface
|
|
|
|
! acc_memcpy_to_device: Only available in C/C++
|
|
! acc_memcpy_from_device: Only available in C/C++
|
|
|
|
end module
|
|
|
|
function acc_get_num_devices_h (d)
|
|
use openacc_internal, only: acc_get_num_devices_l
|
|
use openacc_kinds
|
|
integer acc_get_num_devices_h
|
|
integer (acc_device_kind) d
|
|
acc_get_num_devices_h = acc_get_num_devices_l (d)
|
|
end function
|
|
|
|
subroutine acc_set_device_type_h (d)
|
|
use openacc_internal, only: acc_set_device_type_l
|
|
use openacc_kinds
|
|
integer (acc_device_kind) d
|
|
call acc_set_device_type_l (d)
|
|
end subroutine
|
|
|
|
function acc_get_device_type_h ()
|
|
use openacc_internal, only: acc_get_device_type_l
|
|
use openacc_kinds
|
|
integer (acc_device_kind) acc_get_device_type_h
|
|
acc_get_device_type_h = acc_get_device_type_l ()
|
|
end function
|
|
|
|
subroutine acc_set_device_num_h (n, d)
|
|
use openacc_internal, only: acc_set_device_num_l
|
|
use openacc_kinds
|
|
integer n
|
|
integer (acc_device_kind) d
|
|
call acc_set_device_num_l (n, d)
|
|
end subroutine
|
|
|
|
function acc_get_device_num_h (d)
|
|
use openacc_internal, only: acc_get_device_num_l
|
|
use openacc_kinds
|
|
integer acc_get_device_num_h
|
|
integer (acc_device_kind) d
|
|
acc_get_device_num_h = acc_get_device_num_l (d)
|
|
end function
|
|
|
|
function acc_async_test_h (a)
|
|
use openacc_internal, only: acc_async_test_l
|
|
logical acc_async_test_h
|
|
integer a
|
|
if (acc_async_test_l (a) .eq. 1) then
|
|
acc_async_test_h = .TRUE.
|
|
else
|
|
acc_async_test_h = .FALSE.
|
|
end if
|
|
end function
|
|
|
|
function acc_async_test_all_h ()
|
|
use openacc_internal, only: acc_async_test_all_l
|
|
logical acc_async_test_all_h
|
|
if (acc_async_test_all_l () .eq. 1) then
|
|
acc_async_test_all_h = .TRUE.
|
|
else
|
|
acc_async_test_all_h = .FALSE.
|
|
end if
|
|
end function
|
|
|
|
subroutine acc_wait_h (a)
|
|
use openacc_internal, only: acc_wait_l
|
|
integer a
|
|
call acc_wait_l (a)
|
|
end subroutine
|
|
|
|
subroutine acc_wait_async_h (a1, a2)
|
|
use openacc_internal, only: acc_wait_async_l
|
|
integer a1, a2
|
|
call acc_wait_async_l (a1, a2)
|
|
end subroutine
|
|
|
|
subroutine acc_wait_all_h ()
|
|
use openacc_internal, only: acc_wait_all_l
|
|
call acc_wait_all_l ()
|
|
end subroutine
|
|
|
|
subroutine acc_wait_all_async_h (a)
|
|
use openacc_internal, only: acc_wait_all_async_l
|
|
integer a
|
|
call acc_wait_all_async_l (a)
|
|
end subroutine
|
|
|
|
subroutine acc_init_h (d)
|
|
use openacc_internal, only: acc_init_l
|
|
use openacc_kinds
|
|
integer (acc_device_kind) d
|
|
call acc_init_l (d)
|
|
end subroutine
|
|
|
|
subroutine acc_shutdown_h (d)
|
|
use openacc_internal, only: acc_shutdown_l
|
|
use openacc_kinds
|
|
integer (acc_device_kind) d
|
|
call acc_shutdown_l (d)
|
|
end subroutine
|
|
|
|
function acc_on_device_h (d)
|
|
use openacc_internal, only: acc_on_device_l
|
|
use openacc_kinds
|
|
integer (acc_device_kind) d
|
|
logical acc_on_device_h
|
|
if (acc_on_device_l (d) .eq. 1) then
|
|
acc_on_device_h = .TRUE.
|
|
else
|
|
acc_on_device_h = .FALSE.
|
|
end if
|
|
end function
|
|
|
|
subroutine acc_copyin_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t, c_size_t
|
|
use openacc_internal, only: acc_copyin_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
call acc_copyin_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_copyin_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t, c_size_t
|
|
use openacc_internal, only: acc_copyin_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
call acc_copyin_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_copyin_array_h (a)
|
|
use openacc_internal, only: acc_copyin_l
|
|
type (*), dimension (..), contiguous :: a
|
|
call acc_copyin_l (a, sizeof (a))
|
|
end subroutine
|
|
|
|
subroutine acc_present_or_copyin_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t, c_size_t
|
|
use openacc_internal, only: acc_present_or_copyin_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
call acc_present_or_copyin_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_present_or_copyin_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t, c_size_t
|
|
use openacc_internal, only: acc_present_or_copyin_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
call acc_present_or_copyin_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_present_or_copyin_array_h (a)
|
|
use openacc_internal, only: acc_present_or_copyin_l
|
|
type (*), dimension (..), contiguous :: a
|
|
call acc_present_or_copyin_l (a, sizeof (a))
|
|
end subroutine
|
|
|
|
subroutine acc_create_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t, c_size_t
|
|
use openacc_internal, only: acc_create_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
call acc_create_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_create_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t, c_size_t
|
|
use openacc_internal, only: acc_create_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
call acc_create_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_create_array_h (a)
|
|
use openacc_internal, only: acc_create_l
|
|
type (*), dimension (..), contiguous :: a
|
|
call acc_create_l (a, sizeof (a))
|
|
end subroutine
|
|
|
|
subroutine acc_present_or_create_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t, c_size_t
|
|
use openacc_internal, only: acc_present_or_create_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
call acc_present_or_create_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_present_or_create_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t, c_size_t
|
|
use openacc_internal, only: acc_present_or_create_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
call acc_present_or_create_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_present_or_create_array_h (a)
|
|
use openacc_internal, only: acc_present_or_create_l
|
|
type (*), dimension (..), contiguous :: a
|
|
call acc_present_or_create_l (a, sizeof (a))
|
|
end subroutine
|
|
|
|
subroutine acc_copyout_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t, c_size_t
|
|
use openacc_internal, only: acc_copyout_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
call acc_copyout_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_copyout_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t, c_size_t
|
|
use openacc_internal, only: acc_copyout_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
call acc_copyout_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_copyout_array_h (a)
|
|
use openacc_internal, only: acc_copyout_l
|
|
type (*), dimension (..), contiguous :: a
|
|
call acc_copyout_l (a, sizeof (a))
|
|
end subroutine
|
|
|
|
subroutine acc_copyout_finalize_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t, c_size_t
|
|
use openacc_internal, only: acc_copyout_finalize_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
call acc_copyout_finalize_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_copyout_finalize_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t, c_size_t
|
|
use openacc_internal, only: acc_copyout_finalize_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
call acc_copyout_finalize_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_copyout_finalize_array_h (a)
|
|
use openacc_internal, only: acc_copyout_finalize_l
|
|
type (*), dimension (..), contiguous :: a
|
|
call acc_copyout_finalize_l (a, sizeof (a))
|
|
end subroutine
|
|
|
|
subroutine acc_delete_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t, c_size_t
|
|
use openacc_internal, only: acc_delete_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
call acc_delete_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_delete_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t, c_size_t
|
|
use openacc_internal, only: acc_delete_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
call acc_delete_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_delete_array_h (a)
|
|
use openacc_internal, only: acc_delete_l
|
|
type (*), dimension (..), contiguous :: a
|
|
call acc_delete_l (a, sizeof (a))
|
|
end subroutine
|
|
|
|
subroutine acc_delete_finalize_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t, c_size_t
|
|
use openacc_internal, only: acc_delete_finalize_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
call acc_delete_finalize_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_delete_finalize_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t, c_size_t
|
|
use openacc_internal, only: acc_delete_finalize_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
call acc_delete_finalize_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_delete_finalize_array_h (a)
|
|
use openacc_internal, only: acc_delete_finalize_l
|
|
type (*), dimension (..), contiguous :: a
|
|
call acc_delete_finalize_l (a, sizeof (a))
|
|
end subroutine
|
|
|
|
subroutine acc_update_device_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t, c_size_t
|
|
use openacc_internal, only: acc_update_device_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
call acc_update_device_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_update_device_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t, c_size_t
|
|
use openacc_internal, only: acc_update_device_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
call acc_update_device_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_update_device_array_h (a)
|
|
use openacc_internal, only: acc_update_device_l
|
|
type (*), dimension (..), contiguous :: a
|
|
call acc_update_device_l (a, sizeof (a))
|
|
end subroutine
|
|
|
|
subroutine acc_update_self_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t, c_size_t
|
|
use openacc_internal, only: acc_update_self_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
call acc_update_self_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_update_self_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t, c_size_t
|
|
use openacc_internal, only: acc_update_self_l
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
call acc_update_self_l (a, int (len, kind = c_size_t))
|
|
end subroutine
|
|
|
|
subroutine acc_update_self_array_h (a)
|
|
use openacc_internal, only: acc_update_self_l
|
|
type (*), dimension (..), contiguous :: a
|
|
call acc_update_self_l (a, sizeof (a))
|
|
end subroutine
|
|
|
|
function acc_is_present_32_h (a, len)
|
|
use iso_c_binding, only: c_int32_t, c_size_t
|
|
use openacc_internal, only: acc_is_present_l
|
|
logical acc_is_present_32_h
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int32_t) len
|
|
if (acc_is_present_l (a, int (len, kind = c_size_t)) .eq. 1) then
|
|
acc_is_present_32_h = .TRUE.
|
|
else
|
|
acc_is_present_32_h = .FALSE.
|
|
end if
|
|
end function
|
|
|
|
function acc_is_present_64_h (a, len)
|
|
use iso_c_binding, only: c_int64_t, c_size_t
|
|
use openacc_internal, only: acc_is_present_l
|
|
logical acc_is_present_64_h
|
|
!GCC$ ATTRIBUTES NO_ARG_CHECK :: a
|
|
type (*), dimension (*) :: a
|
|
integer (c_int64_t) len
|
|
if (acc_is_present_l (a, int (len, kind = c_size_t)) .eq. 1) then
|
|
acc_is_present_64_h = .TRUE.
|
|
else
|
|
acc_is_present_64_h = .FALSE.
|
|
end if
|
|
end function
|
|
|
|
function acc_is_present_array_h (a)
|
|
use openacc_internal, only: acc_is_present_l
|
|
logical acc_is_present_array_h
|
|
type (*), dimension (..), contiguous :: a
|
|
acc_is_present_array_h = acc_is_present_l (a, sizeof (a)) == 1
|
|
end function
|