diff options
author | Andrew Stubbs <ams@codesourcery.com> | 2020-09-25 16:22:47 +0100 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2021-06-10 13:37:13 +0200 |
commit | 7aefef31365b9c3d32a0edb6ea0d3b8864d7e91a (patch) | |
tree | ae2fbfb33c70285282cfb070d9e78e492cc30557 /libgomp | |
parent | 7999363961dc6feeb0976cc6d85ea91a120d0e1d (diff) | |
download | gcc-7aefef31365b9c3d32a0edb6ea0d3b8864d7e91a.zip gcc-7aefef31365b9c3d32a0edb6ea0d3b8864d7e91a.tar.gz gcc-7aefef31365b9c3d32a0edb6ea0d3b8864d7e91a.tar.bz2 |
OpenACC: Separate enter/exit data ABIs
Move the OpenACC enter and exit data directives from using a single builtin to
having one each. For most purposes it was easy to tell which was which, from
the clauses given, but it's overhead we can easily avoid, and there may be
future uses where that isn't possible.
gcc/
* omp-builtins.def (BUILT_IN_GOACC_ENTER_EXIT_DATA): Split into...
(BUILT_IN_GOACC_ENTER_DATA, BUILT_IN_GOACC_EXIT_DATA): ... these.
* gimple.h (enum gf_mask): Split
'GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA' into
'GF_OMP_TARGET_KIND_OACC_ENTER_DATA' and
'GF_OMP_TARGET_KIND_OACC_EXIT_DATA'.
(is_gimple_omp_oacc): Update.
* gimple-pretty-print.c (dump_gimple_omp_target): Likewise.
* gimplify.c (gimplify_omp_target_update): Likewise.
* omp-expand.c (expand_omp_target, build_omp_regions_1)
(omp_make_gimple_edges): Likewise.
* omp-low.c (check_omp_nesting_restrictions, lower_omp_target):
Likewise.
gcc/testsuite/
* c-c++-common/goacc-gomp/nesting-fail-1.c: Adjust patterns.
* c-c++-common/goacc/finalize-1.c: Likewise.
* c-c++-common/goacc/mdc-1.c: Likewise.
* c-c++-common/goacc/nesting-fail-1.c: Likewise.
* c-c++-common/goacc/struct-enter-exit-data-1.c: Likewise.
* gfortran.dg/goacc/attach-descriptor.f90: Likewise.
* gfortran.dg/goacc/finalize-1.f: Likewise.
* gfortran.dg/goacc/mapping-tests-3.f90: Likewise.
libgomp/
* libgomp.map (GOACC_2.0.2): New symbol version.
* libgomp_g.h (GOACC_enter_data, GOACC_exit_data) New prototypes.
* oacc-mem.c (GOACC_enter_data, GOACC_exit_data) New functions.
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/libgomp.map | 6 | ||||
-rw-r--r-- | libgomp/libgomp_g.h | 4 | ||||
-rw-r--r-- | libgomp/oacc-mem.c | 26 |
3 files changed, 36 insertions, 0 deletions
diff --git a/libgomp/libgomp.map b/libgomp/libgomp.map index 4ad190a..8ea27b5 100644 --- a/libgomp/libgomp.map +++ b/libgomp/libgomp.map @@ -541,6 +541,12 @@ GOACC_2.0.1 { GOACC_parallel_keyed; } GOACC_2.0; +GOACC_2.0.2 { + global: + GOACC_enter_data; + GOACC_exit_data; +} GOACC_2.0.1; + GOMP_PLUGIN_1.0 { global: GOMP_PLUGIN_malloc; diff --git a/libgomp/libgomp_g.h b/libgomp/libgomp_g.h index b66b697..f890a20 100644 --- a/libgomp/libgomp_g.h +++ b/libgomp/libgomp_g.h @@ -370,6 +370,10 @@ extern void GOACC_wait (int, int, ...); extern void GOACC_enter_exit_data (int, size_t, void **, size_t *, unsigned short *, int, int, ...); +extern void GOACC_enter_data (int, size_t, void **, size_t *, + unsigned short *, int, int, ...); +extern void GOACC_exit_data (int, size_t, void **, size_t *, + unsigned short *, int, int, ...); extern void GOACC_declare (int, size_t, void **, size_t *, unsigned short *); /* oacc-parallel.c */ diff --git a/libgomp/oacc-mem.c b/libgomp/oacc-mem.c index f6173b9..123fe15 100644 --- a/libgomp/oacc-mem.c +++ b/libgomp/oacc-mem.c @@ -1422,6 +1422,8 @@ goacc_enter_exit_data_internal (int flags_m, size_t mapnum, void **hostaddrs, } } +/* Legacy entry point (GCC 11 and earlier). */ + void GOACC_enter_exit_data (int flags_m, size_t mapnum, void **hostaddrs, size_t *sizes, unsigned short *kinds, int async, @@ -1469,6 +1471,30 @@ GOACC_enter_exit_data (int flags_m, size_t mapnum, void **hostaddrs, } void +GOACC_enter_data (int flags_m, size_t mapnum, void **hostaddrs, + size_t *sizes, unsigned short *kinds, int async, + int num_waits, ...) +{ + va_list ap; + va_start (ap, num_waits); + goacc_enter_exit_data_internal (flags_m, mapnum, hostaddrs, sizes, kinds, + true, async, num_waits, &ap); + va_end (ap); +} + +void +GOACC_exit_data (int flags_m, size_t mapnum, void **hostaddrs, + size_t *sizes, unsigned short *kinds, int async, + int num_waits, ...) +{ + va_list ap; + va_start (ap, num_waits); + goacc_enter_exit_data_internal (flags_m, mapnum, hostaddrs, sizes, kinds, + false, async, num_waits, &ap); + va_end (ap); +} + +void GOACC_declare (int flags_m, size_t mapnum, void **hostaddrs, size_t *sizes, unsigned short *kinds) { |