Hi Thomas,
updated version committed (r279456) – which adds 'acc_device_gcn' to
openacc_lib.h – besides the other cleanup.
On 12/16/19 9:41 PM, Thomas Schwinge wrote
I'll point out there also exists 'libgomp/config/accel/openacc.f90',
I have now updated that file in the same way – and added a cross-ref
comment to both libgomp/openacc.f90 and libgomp/openacc_lib.h.
Ouch. Ah, no: you said "the default was already 'public'" -- so
there's no need to backport that to gcc-9-branch
Yes, before, it was just a stylistic problem.
so that 'acc_copyout_finalize', 'acc_delete_finalize' will be
available for OpenACC Fortran users. (These functions are, what would
you expect, no covered by any test case in 'libgomp.oacc-fortran/'...)
They are also not documented in libgomp.texi – nor are some of the
_async_ ones. They are at least tested in C/C++ [via
libgomp.oacc-c-c++-common/lib-32.c (both) and
libgomp.oacc-c-c++-common/pr92843-1.c (acc_copyout_finalize, only)].
This isn't "'module openmp'". ;-)
Is it not? ;-)
Some vertical space before the "From openacc_kinds" comment, and
before the 'acc_async_*' ones
I added one before – but not after to make is visually belong to that block.
public :: acc_update_device, acc_update_self, acc_is_present
public :: acc_copyin_async, acc_create_async, acc_copyout_async
public :: acc_delete_async, acc_update_device_async, acc_update_self_async
+ public :: acc_copyout_finalize, acc_delete_finalize
Put these into the place where they really belong, after 'acc_copyout,
and 'acc_delete', respectively?
I left them there, for now. The <name>_async variants are also in one
block and not sorted after their respective <name> variants.
Thanks for the suggestions & hints!
Cheers,
Tobias
commit 3e1b818b7a653e1f12194ef1c75edf7594794b43
Author: burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue Dec 17 11:19:32 2019 +0000
libgomp/openacc.f90 – clean-up public/private attributes
* config/accel/openacc.f90 (module openacc_kinds): Use 'PUBLIC' to mark
all symbols as public except for the 'use …, only' imported symbol,
which is private.
(module openacc): Default to 'PRIVATE' to exclude openacc_internal; mark
all symbols from module openacc_kinds as PUBLIC
* openacc.f90: Add comment with crossref to that file and openmp_lib.h;
fix comment typo.
* openacc_lib.h (acc_device_gcn): Add this PARAMETER.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@279456 138bc75d-0d04-0410-961f-82ee72b054a4
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 6b16bf34b17..b46a68255df 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,14 @@
+2019-12-17 Tobias Burnus <tob...@codesourcery.com>
+
+ * config/accel/openacc.f90 (module openacc_kinds): Use 'PUBLIC' to mark
+ all symbols as public except for the 'use …, only' imported symbol,
+ which is private.
+ (module openacc): Default to 'PRIVATE' to exclude openacc_internal; mark
+ all symbols from module openacc_kinds as PUBLIC
+ * openacc.f90: Add comment with crossref to that file and openmp_lib.h;
+ fix comment typo.
+ * openacc_lib.h (acc_device_gcn): Add this PARAMETER.
+
2019-12-13 Julian Brown <jul...@codesourcery.com>
PR libgomp/92881
diff --git a/libgomp/config/accel/openacc.f90 b/libgomp/config/accel/openacc.f90
index 6a8c5e9cb3d..badf5e176dd 100644
--- a/libgomp/config/accel/openacc.f90
+++ b/libgomp/config/accel/openacc.f90
@@ -36,13 +36,12 @@ module openacc_kinds
use iso_fortran_env, only: int32
implicit none
+ public
private :: int32
- public :: acc_device_kind
- integer, parameter :: acc_device_kind = int32
+ ! When adding items, also update 'public' setting in 'module openacc' below.
- public :: acc_device_none, acc_device_default, acc_device_host
- public :: acc_device_not_host, acc_device_nvidia
+ integer, parameter :: acc_device_kind = int32
! Keep in sync with include/gomp-constants.h.
integer (acc_device_kind), parameter :: acc_device_none = 0
@@ -53,7 +52,7 @@ module openacc_kinds
integer (acc_device_kind), parameter :: acc_device_nvidia = 5
integer (acc_device_kind), parameter :: acc_device_gcn = 8
-end module
+end module openacc_kinds
module openacc_internal
use openacc_kinds
@@ -75,13 +74,20 @@ module openacc_internal
integer (c_int), value :: d
end function
end interface
-end module
+end module openacc_internal
module openacc
use openacc_kinds
use openacc_internal
implicit none
+ private
+
+ ! From openacc_kinds
+ public :: acc_device_kind
+ public :: acc_device_none, acc_device_default, acc_device_host
+ public :: acc_device_not_host, acc_device_nvidia, acc_device_gcn
+
public :: acc_on_device
interface acc_on_device
diff --git a/libgomp/openacc.f90 b/libgomp/openacc.f90
index b37f1872d50..fb7fc6e6d77 100644
--- a/libgomp/openacc.f90
+++ b/libgomp/openacc.f90
@@ -27,6 +27,8 @@
! see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
! <http://www.gnu.org/licenses/>.
+! Keep in sync with config/accel/openacc.f90 and openacc_lib.h.
+
module openacc_kinds
use iso_fortran_env, only: int32
implicit none
@@ -34,7 +36,7 @@ module openacc_kinds
public
private :: int32
- ! When adding items, also update 'public' setting in 'module openmp' below.
+ ! When adding items, also update 'public' setting in 'module openacc' below.
integer, parameter :: acc_device_kind = int32
@@ -52,7 +54,7 @@ module openacc_kinds
! 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
+end module openacc_kinds
module openacc_internal
use openacc_kinds
@@ -704,7 +706,7 @@ module openacc_internal
integer (c_int), value :: async
end subroutine
end interface
-end module
+end module openacc_internal
module openacc
use openacc_kinds
@@ -712,6 +714,7 @@ module openacc
implicit none
private
+
! From openacc_kinds
public :: acc_device_kind, acc_handle_kind
public :: acc_device_none, acc_device_default, acc_device_host
@@ -933,7 +936,7 @@ module openacc
procedure :: acc_update_self_async_array_h
end interface
-end module
+end module openacc
function acc_get_num_devices_h (d)
use openacc_internal, only: acc_get_num_devices_l
diff --git a/libgomp/openacc_lib.h b/libgomp/openacc_lib.h
index fbd8f5e3625..a928414cffe 100644
--- a/libgomp/openacc_lib.h
+++ b/libgomp/openacc_lib.h
@@ -32,6 +32,8 @@
! Alternatively, the user can use the module version, which permits
! compilation with -std=f95.
+! Keep in sync with openacc.f90 and config/accel/openacc.f90.
+
integer, parameter :: acc_device_kind = 4
! Keep in sync with include/gomp-constants.h.
@@ -42,6 +44,7 @@
! removed.
integer (acc_device_kind), parameter :: acc_device_not_host = 4
integer (acc_device_kind), parameter :: acc_device_nvidia = 5
+ integer (acc_device_kind), parameter :: acc_device_gcn = 8
integer, parameter :: acc_handle_kind = 4