[PATCH, OpenACC] Enable GOMP_MAP_FIRSTPRIVATE_INT for OpenACC
Julian Brown
julian@codesourcery.com
Thu Dec 13 16:03:00 GMT 2018
On Fri, 7 Dec 2018 15:05:46 +0100
Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, Dec 06, 2018 at 10:40:41PM +0000, Julian Brown wrote:
> > + && (TREE_CODE (inner_type) == REAL_TYPE
> > + || (!omp_is_reference (var)
> > + && INTEGRAL_TYPE_P (inner_type))
> > + || TREE_CODE (inner_type) == INTEGER_TYPE)
>
> Not sure I understand the above. INTEGRAL_TYPE_P is INTEGER_TYPE,
> BOOLEAN_TYPE and ENUMERAL_TYPE, so you want to handle INTEGER_TYPE
> no magger whether var should be passed by reference or not, but
> BOOLEAN_TYPE or ENUMERAL_TYPE only if it is not a reference?
> That is just weird. Any test to back that up?
I couldn't figure out any reason for the test being written like that
-- specifically, what it was meant to exclude -- but the attached
simplifies it to ANY_INTEGRAL_TYPE_P or FLOAT_TYPE_P, and that seems to
work fine.
> > + if ((TREE_CODE (inner_type) == REAL_TYPE
> > + || (!omp_is_reference (var)
> > + && INTEGRAL_TYPE_P (inner_type))
> > + || TREE_CODE (inner_type) ==
> > INTEGER_TYPE)
>
> Ditto here.
Likewise. Re-tested with offloading to NVPTX. OK?
Thanks for review,
Julian
ChangeLog
gcc/
* omp-low.c (maybe_lookup_field_in_outer_ctx): New function.
(convert_to_firstprivate_int): New function.
(convert_from_firstprivate_int): New function.
(lower_omp_target): Enable GOMP_MAP_FIRSTPRIVATE_INT in OpenACC.
libgomp/
* oacc-parallel.c (GOACC_parallel_keyed): Handle
GOMP_MAP_FIRSTPRIVATE_INT host addresses.
* plugin/plugin-nvptx.c (nvptx_exec): Handle GOMP_MAP_FIRSTPRIVATE_INT
host addresses.
* testsuite/libgomp.oacc-c++/firstprivate-int.C: New test.
* testsuite/libgomp.oacc-c-c++-common/firstprivate-int.c: New test.
* testsuite/libgomp.oacc-fortran/firstprivate-int.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: firstprivate-int-3.diff
Type: text/x-patch
Size: 18515 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20181213/03a3c8b1/attachment.bin>
More information about the Fortran
mailing list