This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Use verify_oacc_routine_clauses for Fortran (was: Use verify_oacc_routine_clauses for C/C++)
- From: Cesar Philippidis <cesar at codesourcery dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>, <gcc-patches at gcc dot gnu dot org>, <fortran at gcc dot gnu dot org>
- Date: Tue, 9 Aug 2016 08:54:46 -0700
- Subject: Re: Use verify_oacc_routine_clauses for Fortran (was: Use verify_oacc_routine_clauses for C/C++)
- Authentication-results: sourceware.org; auth=none
- References: <87y44gik20.fsf@hertz.schwinge.homeip.net>
On 08/01/2016 08:29 AM, Thomas Schwinge wrote:
> On Mon, 01 Aug 2016 17:21:37 +0200, I wrote:
>> Some checking of OpenACC clauses currently done in the front ends should
>> be moved later, and be unified. (Also, I suppose, for supporting of the
>> device_type clause, such checking actually *must* be moved later, into
>> the oaccdevlow pass, or similar.) Here is a first preparatory patch. OK
>> for trunk?
>>
>> commit e02a9b65c505b404f8d985b0ec6ccb99d73515d3
>> Author: Thomas Schwinge <thomas@codesourcery.com>
>> Date: Wed Jul 27 15:54:38 2016 +0200
>>
>> Use verify_oacc_routine_clauses for C/C++
>
> Here is a Fortran patch. This depends on other Fortran patches in flight
> (such as Cesar's), and on PR72741 "Fortran OpenACC routine directive
> doesn't properly handle clauses specifying the level of parallelism" be
> resolved, and thereabouts, but I'm posting it anyway, in case anyone has
> any review comments already. I suppose, to begin with, the call of
> gfc_oacc_routine_dims will move later into the Fortran front end
> pipeline, to the point then function declarations' attributes are set, or
> similar. Also, as discussed already, the Fortran front end currently is
> very "forgetful" in regards to OpenACC/OpenMP clauses' specific location
> information, so we're not able at present to produce diagnostics with
> precise location information.
Are you planning on staging this patch in gomp4? I know it's a work in
progress, but is this function ...
> diff --git gcc/fortran/trans-openmp.c gcc/fortran/trans-openmp.c
> index 0d646ed..254732c 100644
> --- gcc/fortran/trans-openmp.c
> +++ gcc/fortran/trans-openmp.c
> @@ -4570,3 +4570,70 @@ gfc_trans_omp_declare_simd (gfc_namespace *ns)
> DECL_ATTRIBUTES (fndecl) =;
> }
> }
> +
> +/* Determine and verify the level of parallelism for an OpenACC routine. */
> +
> +oacc_function
> +gfc_oacc_routine_dims (gfc_omp_clauses *clauses, locus location)
> +{
> + /* This is implemented in terms of OMP_CLAUSE trees, so that we can use the
> + generic functions for checking validity. This has a little bit of
> + overhead, but as the number of clauses on OpenACC routine directives as
> + well as the number of OpenACC routine directives will both be rather
> + small, this is acceptable. */
> + tree clauses_t =ULL_TREE;
> + /* We don't have specific location information available for the individual
> + clauses... */
> + location_t loc =ocation.lb->location;
> + if (clauses)
> + {
> + if (clauses->gang)
> + {
> + tree c =uild_omp_clause (loc, OMP_CLAUSE_GANG);
> + OMP_CLAUSE_CHAIN (c) =lauses_t;
> + clauses_t =;
> + }
> + if (clauses->worker)
> + {
> + tree c =uild_omp_clause (loc, OMP_CLAUSE_WORKER);
> + OMP_CLAUSE_CHAIN (c) =lauses_t;
> + clauses_t =;
> + }
> + if (clauses->vector)
> + {
> + tree c =uild_omp_clause (loc, OMP_CLAUSE_VECTOR);
> + OMP_CLAUSE_CHAIN (c) =lauses_t;
> + clauses_t =;
> + }
> + if (clauses->seq)
> + {
> + tree c =uild_omp_clause (loc, OMP_CLAUSE_SEQ);
> + OMP_CLAUSE_CHAIN (c) =lauses_t;
> + clauses_t =;
> + }
> + }
> + verify_oacc_routine_clauses (&clauses_t, loc);
included elsewhere in your patch set? I'll take over this patch as I
work on PR72741.
Cesar