[PATCH 5/6] [GOMP4] OpenACC 1.0+ support in fortran front-end
Tobias Burnus
burnus@net-b.de
Sun Feb 9 23:43:00 GMT 2014
Some general questions to the patch set:
* I miss "-fopenacc". Is the support already in the branch? I assume
that part is then in c-family/c.opt fortran/lang.opt?
* Documentation: Do you also need to update fortran/gfortran.texi and/or
fortran/invoke.texi? (I assume that -fopenacc is already documented in
docs/invoke.texi) [Search for openmp to find possible spots.]
* Intrinsic module "openacc" and "openacc_lib.h": I assume that those
will be created as follow up - or do they already exist? If so, do you
need to document something in fortran/intrinsic.texi? Or in libgomp.texi?
Ilmir Usmanov wrote:
> OpenACC 1.0 fortran FE support -- tests.
>
> gcc/testsuite/gfortran.dg/goacc/
> * goacc.exp: New test directory.
> +++ b/gcc/testsuite/gfortran.dg/goacc/branch.f95
> @@ -0,0 +1,55 @@
> +! { dg-do compile }
> +! { dg-options "-fopenacc" }
Is there a reason that you don't automatically add that flag via goacc.exp?
> +! { dg-final { scan-tree-dump "pragma acc data" "original" } }
> +! { dg-final { scan-tree-dump "if" "original" } }
This one looks rather general. Shouldn't use narrow it down a bit, e.g.
by using "scan-tree-dump-times"?
> +! { dg-final { scan-tree-dump "to" "original" } }
> +! { dg-final { scan-tree-dump "from" "original" } }
> +! { dg-final { scan-tree-dump "alloc" "original" } }
Ditto. Also spaces before/after the pattern should make it more unique.
> --- /dev/null
> +++ b/gcc/testsuite/gfortran.dg/goacc/goacc.exp
> @@ -0,0 +1,36 @@
> +# Load support procs.
> +load_lib gfortran-dg.exp
> +
> +if ![check_effective_target_fopenmp] {
> + return
> +}
I assume that this should be indeed "fopenmp" here and not "fopenacc" as
both share libgomp?
> +# Main loop.
> +gfortran-dg-runtest [lsort \
> + [find $srcdir/$subdir *.\[fF\]{,90,95,03,08} ] ] " -fopenacc -fdump-parse-tree"
As you use -fopenacc here, you probably can get rid of it in dg-options.
Can't you? I am not sure whether -fdump-parse-tree is needed; on the
other hand, it just clutters the *log files.
As -fopenmp seemingly can be mixed with -fopenacc, I think it would be
nice to have some test cases where !$omp and !$acc are both placed - in
either order - before the same Fortran statement.
Tobias
More information about the Fortran
mailing list