]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran/OpenMP: Add memory routines existing for C/C++
authorTobias Burnus <tobias@codesourcery.com>
Wed, 18 Aug 2021 09:14:05 +0000 (11:14 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Wed, 18 Aug 2021 09:15:47 +0000 (11:15 +0200)
commit76bb3c50dd43a5f87d4f949cf0d0979144562e6c
tree8d3557f862c38bdb634b9936e6d1d0a7e41b4596
parent5079b7781a2c506dcdfb241347d74c7891268225
Fortran/OpenMP: Add memory routines existing for C/C++

This patch adds the Fortran interface for omp_alloc/omp_free
and the omp_target_* memory routines, which were added in
OpenMP 5.0 for C/C++ but only OpenMP 5.1 added them for Fortran.

Those functions use BIND(C), i.e. on the libgomp side, the same
interface as for C/C++ is used.

Note: By using BIND(C) in omp_lib.h, files including this file
no longer compiler with -std=f95 but require at least -std=f2003.

libgomp/ChangeLog:

* omp_lib.f90.in (omp_alloc, omp_free, omp_target_alloc,
omp_target_free. omp_target_is_present, omp_target_memcpy,
omp_target_memcpy_rect, omp_target_associate_ptr,
omp_target_disassociate_ptr): Add interface.
* omp_lib.h.in (omp_alloc, omp_free, omp_target_alloc,
omp_target_free. omp_target_is_present, omp_target_memcpy,
omp_target_memcpy_rect, omp_target_associate_ptr,
omp_target_disassociate_ptr): Add interface.
* testsuite/libgomp.fortran/alloc-1.F90: Remove local
interface block for omp_alloc + omp_free.
* testsuite/libgomp.fortran/alloc-4.f90: Likewise.
* testsuite/libgomp.fortran/refcount-1.f90: New test.
* testsuite/libgomp.fortran/target-12.f90: New test.
libgomp/omp_lib.f90.in
libgomp/omp_lib.h.in
libgomp/testsuite/libgomp.fortran/alloc-1.F90
libgomp/testsuite/libgomp.fortran/alloc-4.f90
libgomp/testsuite/libgomp.fortran/refcount-1.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/target-12.f90 [new file with mode: 0644]