[gomp4] enable GOMP_MAP_FIRSTPRIVATE_INT in OpenACC
Cesar Philippidis
cesar@codesourcery.com
Fri Jan 27 15:46:00 GMT 2017
This patch does the following two things:
1) Enable GOMP_MAP_FIRSTPRIVATE_INT in OpenaCC.
2) Extends the 'INT' values to handle floats and doubles via type
casting.
OpenACC handles OMP_CLAUSE_FIRSTPRIVATE slightly different to OpenMP;
lower_omp_target changes it to a data map clause. Consequently, it
utilizes a different code path from OpenMP. The first part of this patch
is to enable GOMP_MAP_FIRSTPRIVATE_INT in OpenACC.
The second part involved extending GOMP_MAP_FIRSTPRIVATE_INT to support
floating point values. The scientific applications that are using
OpenACC tend to utilize a lot of floating point values. I'm not sure if
there are any repercussions/side-effects this form of casting.
If you take a close look at lower_omp_target, you'll notice that I'm
gave reference types special treatment. Specifically, I disabled this
optimization on non-INTEGER_TYPE and floating point values, because the
nvptx target was having some problems dereferencing boolean-typed
pointers. That's something I have on my TODO list to track down later.
As for the performance gains, this optimization resulted in a
non-trivial speedup in CloverLeaf running on a Nvidia Pascal board.
CloverLeaf is somewhat special in that it consists of a lot of OpenACC
offloaded regions which gets called multiple times throughout its
execution. Consequently, it is I/O limited. The other benchmarks I ran
didn't benefit nearly as much as CloverLeaf. I chose a small data set
for CloverLeaf that only ran in 1.3s without the patch, and hence make
it even more I/O limited. After the patch, it ran 0.35s faster.
This patch has been applied to gomp-4_0-branch.
Cesar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gomp4-fp-int.diff
Type: text/x-patch
Size: 18372 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20170127/b88937b5/attachment.bin>
More information about the Fortran
mailing list