This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [WIP] [PR fortran/72741] Rework Fortran OpenACC routine clause handling (was: [PATCH] OpenACC routines in fortran modules)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: Cesar Philippidis <cesar at codesourcery dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Fortran List <fortran at gcc dot gnu dot org>, Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- Date: Thu, 11 Aug 2016 17:40:26 +0200
- Subject: Re: [WIP] [PR fortran/72741] Rework Fortran OpenACC routine clause handling (was: [PATCH] OpenACC routines in fortran modules)
- Authentication-results: sourceware.org; auth=none
- References: <579973CB.3070006@codesourcery.com> <579AD9C9.3030804@codesourcery.com> <5776D55A.4030002@codesourcery.com> <878tw35o6k.fsf@kepler.schwinge.homeip.net>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Aug 11, 2016 at 05:18:43PM +0200, Thomas Schwinge wrote:
> --- gcc/fortran/gfortran.h
> +++ gcc/fortran/gfortran.h
> @@ -729,7 +839,7 @@ ext_attr_t;
> extern const ext_attr_t ext_attr_list[];
>
> /* Symbol attribute structure. */
> -typedef struct
> +typedef struct symbol_attribute
> {
> /* Variable attributes. */
> unsigned allocatable:1, dimension:1, codimension:1, external:1, intrinsic:1,
> @@ -864,6 +974,13 @@ typedef struct
> /* Mentioned in OMP DECLARE TARGET. */
> unsigned omp_declare_target:1;
>
> + /* OpenACC routine. */
> + unsigned oacc_routine:1;
> + unsigned oacc_routine_gang:1;
> + unsigned oacc_routine_worker:1;
> + unsigned oacc_routine_vector:1;
> + unsigned oacc_routine_seq:1;
> +
> /* Mentioned in OACC DECLARE. */
> unsigned oacc_declare_create:1;
> unsigned oacc_declare_copyin:1;
> @@ -871,137 +988,24 @@ typedef struct
> unsigned oacc_declare_device_resident:1;
> unsigned oacc_declare_link:1;
>
> - /* This is an OpenACC acclerator function at level N - 1 */
> - ENUM_BITFIELD (oacc_function) oacc_function:3;
> -
> /* Attributes set by compiler extensions (!GCC$ ATTRIBUTES). */
> unsigned ext_attr:EXT_ATTR_NUM;
>
> + /* Location information for OMP clauses. */
> + //TODO: how to handle in module.c/symbol.c?
> + locus omp_clauses_locus;
> +
> /* The namespace where the attribute has been set. */
> struct gfc_namespace *volatile_ns, *asynchronous_ns;
> +
> + /* Chain to another set of symbol attributes. Currently only used for
> + OpenACC routine. */
> + //TODO: how to handle in module.c/symbol.c?
> + struct symbol_attribute *next;
While symbol_attribute is already bloated, I don't like bloating it this
much further. Do you really need it for all symbols, or just all subroutines?
In the latter case, it is much better to add some openacc specific pointer
into the namespace structure and stick everything you need into some custom
structure it will refer to. E.g. look at gfc_omp_declare_simd struct
in ns->omp_declare_simd.
omp_clauses_locus makes no sense, symbol_attribute contains parsed info from
many different clauses, which one it is?
Jakub