[Patch][Fortran] OpenACC – permit common blocks in some clauses

Tobias Burnus tobias@codesourcery.com
Tue Oct 15 21:32:00 GMT 2019


This OpenACC-only patch extends the support for /common/ blocks.

[In OpenMP (4.0 to 5.0, unchanged) and gfortran, common blocks are supported in copyin/copyprivate, in firstprivate/lastprivate/private/shared, in threadprivate and in declare target.]

For OpenACC, gfortran already supports common blocks for device_resident/usedevice/cache/flush/link.

This patch adds them (for OpenACC only) to copy/copyin/copyout, create/delete,
host, pcopy/pcopy_in/pcopy_out, present_or_copy, present_or_copy_in,
present_or_copy_out, present_or_create and self.
[Of those, only "copy()" is also an OpenMP clause name.]
[Cf. OpenACC 2.7 in 1.9 (for the p* variants) and 2.13; the latter is new since OpenACC 2.0.]



I think the Fortran part is obvious, once one agrees on the list of clauses; and OK from a Fortran's maintainer view.

gcc/gimplify.c: oacc_default_clause contains some changes; there are additionally two lines which only differ for ORT_ACC – Hence, it is an OpenACC-only change!
The ME change is about privatizing common blocks (I haven't studied this part closer.)


@Thomas: Please review
@Jakub, all: comments and approvals are welcome.

Tobias

PS: This patch is the rediffed OG9 (alias OG8) patch 0793cef408c9937f4c4e2423dd1f7d6a97b9bed3 by Cesar Philippidis from 2016. (Which was on gomp-4_0-branch as r240165). Due to the wonders of GIT – when not requiring linear history and due to rebasing with GCC9, it is also part of the OG9 commit ac6c90812344f4f4cfe4d2f5901c1a9d038a4000 – which in addition also does some other things like handling OpenACC device pointers.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: acc-common2.diff
Type: text/x-patch
Size: 21385 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20191015/8a28c867/attachment.bin>


More information about the Fortran mailing list