[PATCH 2/6] [GOMP4] OpenACC 1.0+ support in fortran front-end
Thomas Schwinge
thomas@codesourcery.com
Fri Jan 24 20:47:00 GMT 2014
Hi!
Regarding my comments, please keep in mind that I don't have a lot of
Fortran experience; neither as a user nor as an implementor ;-) in the
GCC front end, so don't hesitate to tell me if I'm misunderstanding
something. As I suggested, it may make sense to CC Fortran front end
maintainers for such patches.
On Thu, 23 Jan 2014 22:03:42 +0400, Ilmir Usmanov <i.usmanov@samsung.com> wrote:
> Subject: [PATCH 2/6] OpenACC fortran FE part 2
> --- a/gcc/fortran/openmp.c
> +++ b/gcc/fortran/openmp.c
> @@ -186,15 +292,51 @@ cleanup:
> #define OMP_CLAUSE_FINAL (1 << 14)
> #define OMP_CLAUSE_MERGEABLE (1 << 15)
>
> +/* OpenACC 2.0 clauses. */
> +#define OACC_CLAUSE_IF OMP_CLAUSE_IF
> +#define OACC_CLAUSE_ASYNC (1 << 16)
> +#define OACC_CLAUSE_NUM_GANGS (1 << 17)
> +#define OACC_CLAUSE_NUM_WORKERS (1 << 18)
> +#define OACC_CLAUSE_VECTOR_LENGTH (1 << 19)
> +#define OACC_CLAUSE_REDUCTION OMP_CLAUSE_REDUCTION
> +#define OACC_CLAUSE_COPY (1 << 20)
> +#define OACC_CLAUSE_COPYIN OMP_CLAUSE_COPYIN
> +#define OACC_CLAUSE_COPYOUT (1 << 21)
> +#define OACC_CLAUSE_[...]
As asked/suggested in »[PATCH 4/6] OpenACC GENERIC nodes«, can we again
avoid the duplicate names, and use the existing OpenMP memory mapping
stuff for expressing the OpenACC data clauses?
> /* Match OpenMP directive clauses. MASK is a bitmask of
> clauses that are allowed for a particular directive. */
>
> static match
> -gfc_match_omp_clauses (gfc_omp_clauses **cp, int mask)
> +gfc_match_omp_clauses (gfc_omp_clauses **cp, long long mask, bool is_acc)
Here, in turn, in the C front end,
<http://news.gmane.org/find-root.php?message_id=%3C1389712208-416-4-git-send-email-thomas%40codesourcery.com%3E>
(and following), I went with a separate function for OpenACC vs. OpenMP
clauses parsing, specifically to avoid the is_acc disambiguation
variable.
That is, I parse the OACC_CLAUSE_* in context of either an OpenACC or
OpenMP directive, and as such it's implicitly clear whether this is an
OpenACC or OpenMP one.
That's the reason why I can have PRAGMA_OMP_CLAUSE_COPYIN mean different
things for OpenACC vs. OpenMP in the C front end. Maybe such an approach
would work well in the Fortran front end, too?
Grüße,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140124/b95a5de5/attachment.sig>
More information about the Gcc-patches
mailing list