gcc/libgomp
Marcel Vollweiler bbb7f8604e C, C++, Fortran, OpenMP: Add 'has_device_addr' clause to 'target' construct.
This patch adds the 'has_device_addr' clause to the OpenMP 'target' construct
which was introduced in OpenMP 5.1 (OpenMP API 5.1 specification pp. 197ff):

	has_device_addr(list)

"The has_device_addr clause indicates that its list items already have device
addresses and therefore they may be directly accessed from a target device.
If the device address of a list item is not for the device on which the target
region executes, accessing the list item inside the region results in
unspecified behavior. The list items may include array sections." (p. 200)

"A list item may not be specified in both an is_device_ptr clause and a
has_device_addr clause on the directive." (p. 202)

"A list item that appears in an is_device_ptr or a has_device_addr clause must
not be specified in any data-sharing attribute clause on the same target
construct." (p. 203)

gcc/c-family/ChangeLog:

	* c-omp.cc (c_omp_split_clauses): Added OMP_CLAUSE_HAS_DEVICE_ADDR case.
	* c-pragma.h (enum pragma_kind): Added 5.1 in comment.
	(enum pragma_omp_clause): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR.

gcc/c/ChangeLog:

	* c-parser.cc (c_parser_omp_clause_name): Parse 'has_device_addr'
	clause.
	(c_parser_omp_variable_list): Handle array sections.
	(c_parser_omp_clause_has_device_addr): Added.
	(c_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
	case.
	(c_parser_omp_target_exit_data): Added HAS_DEVICE_ADDR to
	OMP_CLAUSE_MASK.
	* c-typeck.cc (handle_omp_array_sections): Handle clause restrictions.
	(c_finish_omp_clauses): Handle array sections.

gcc/cp/ChangeLog:

	* parser.cc (cp_parser_omp_clause_name): Parse 'has_device_addr' clause.
	(cp_parser_omp_var_list_no_open): Handle array sections.
	(cp_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR
	case.
	(cp_parser_omp_target_update): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK.
	* semantics.cc (handle_omp_array_sections): Handle clause restrictions.
	(finish_omp_clauses): Handle array sections.

gcc/fortran/ChangeLog:

	* dump-parse-tree.cc (show_omp_clauses): Added OMP_LIST_HAS_DEVICE_ADDR
	case.
	* gfortran.h: Added OMP_LIST_HAS_DEVICE_ADDR.
	* openmp.cc (enum omp_mask2): Added OMP_CLAUSE_HAS_DEVICE_ADDR.
	(gfc_match_omp_clauses): Parse HAS_DEVICE_ADDR clause.
	(resolve_omp_clauses): Same.
	* trans-openmp.cc (gfc_trans_omp_variable_list): Added
	OMP_LIST_HAS_DEVICE_ADDR case.
	(gfc_trans_omp_clauses): Firstprivatize of array descriptors.

gcc/ChangeLog:

	* gimplify.cc (gimplify_scan_omp_clauses): Added cases for
	OMP_CLAUSE_HAS_DEVICE_ADDR
	and handle array sections.
	(gimplify_adjust_omp_clauses): Added OMP_CLAUSE_HAS_DEVICE_ADDR case.
	* omp-low.cc (scan_sharing_clauses): Handle OMP_CLAUSE_HAS_DEVICE_ADDR.
	(lower_omp_target): Same.
	* tree-core.h (enum omp_clause_code): Same.
	* tree-nested.cc (convert_nonlocal_omp_clauses): Same.
	(convert_local_omp_clauses): Same.
	* tree-pretty-print.cc (dump_omp_clause): Same.
	* tree.cc: Same.

libgomp/ChangeLog:

	* libgomp.texi: Updated entry for HAS_DEVICE_ADDR.
	* target.c (copy_firstprivate_data): Copy only if host address is not
	NULL.
	* testsuite/libgomp.c++/target-has-device-addr-2.C: New test.
	* testsuite/libgomp.c++/target-has-device-addr-4.C: New test.
	* testsuite/libgomp.c++/target-has-device-addr-5.C: New test.
	* testsuite/libgomp.c++/target-has-device-addr-6.C: New test.
	* testsuite/libgomp.c-c++-common/target-has-device-addr-1.c: New test.
	* testsuite/libgomp.c/target-has-device-addr-3.c: New test.
	* testsuite/libgomp.fortran/target-has-device-addr-1.f90: New test.
	* testsuite/libgomp.fortran/target-has-device-addr-2.f90: New test.
	* testsuite/libgomp.fortran/target-has-device-addr-3.f90: New test.
	* testsuite/libgomp.fortran/target-has-device-addr-4.f90: New test.

gcc/testsuite/ChangeLog:

	* c-c++-common/gomp/clauses-1.c: Added has_device_addr to test cases.
	* g++.dg/gomp/attrs-1.C: Added has_device_addr to test cases.
	* g++.dg/gomp/attrs-2.C: Added has_device_addr to test cases.
	* c-c++-common/gomp/target-has-device-addr-1.c: New test.
	* c-c++-common/gomp/target-has-device-addr-2.c: New test.
	* c-c++-common/gomp/target-is-device-ptr-1.c: New test.
	* c-c++-common/gomp/target-is-device-ptr-2.c: New test.
	* gfortran.dg/gomp/is_device_ptr-3.f90: New test.
	* gfortran.dg/gomp/target-has-device-addr-1.f90: New test.
	* gfortran.dg/gomp/target-has-device-addr-2.f90: New test.
2022-02-09 23:47:12 -08:00
..
config libgomp, OpenMP: Fix issue for omp_get_device_num on gcn targets. 2022-01-19 05:03:54 -08:00
plugin amdgcn: Tune default OpenMP/OpenACC GPU utilization 2022-01-16 17:25:36 +01:00
testsuite C, C++, Fortran, OpenMP: Add 'has_device_addr' clause to 'target' construct. 2022-02-09 23:47:12 -08:00
.gitattributes
acc_prof.h Update copyright years. 2022-01-03 10:42:10 +01:00
acinclude.m4 Add mold detection for libs. 2022-01-31 09:46:44 +01:00
aclocal.m4
affinity-fmt.c Update copyright years. 2022-01-03 10:42:10 +01:00
affinity.c Update copyright years. 2022-01-03 10:42:10 +01:00
alloc.c Update copyright years. 2022-01-03 10:42:10 +01:00
allocator.c Update copyright years. 2022-01-03 10:42:10 +01:00
atomic.c Update copyright years. 2022-01-03 10:42:10 +01:00
barrier.c Update copyright years. 2022-01-03 10:42:10 +01:00
ChangeLog Daily bump. 2022-02-09 00:16:24 +00:00
ChangeLog.graphite
config.h.in
configure make -Werror optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer 2022-02-03 16:10:18 +01:00
configure.ac make -Werror optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer 2022-02-03 16:10:18 +01:00
configure.tgt
critical.c Update copyright years. 2022-01-03 10:42:10 +01:00
env.c Update copyright years. 2022-01-03 10:42:10 +01:00
error.c Update copyright years. 2022-01-03 10:42:10 +01:00
fortran.c Update copyright years. 2022-01-03 10:42:10 +01:00
hashtab.h Update copyright years. 2022-01-03 10:42:10 +01:00
icv-device.c Update copyright years. 2022-01-03 10:42:10 +01:00
icv.c Update copyright years. 2022-01-03 10:42:10 +01:00
iter_ull.c Update copyright years. 2022-01-03 10:42:10 +01:00
iter.c Update copyright years. 2022-01-03 10:42:10 +01:00
libgomp_f.h.in Update copyright years. 2022-01-03 10:42:10 +01:00
libgomp_g.h Update copyright years. 2022-01-03 10:42:10 +01:00
libgomp-plugin.c Update copyright years. 2022-01-03 10:42:10 +01:00
libgomp-plugin.h Update copyright years. 2022-01-03 10:42:10 +01:00
libgomp.h Update copyright years. 2022-01-03 10:42:10 +01:00
libgomp.map openmp: Honor OpenMP 5.1 num_teams lower bound 2021-11-12 12:41:22 +01:00
libgomp.spec.in
libgomp.texi C, C++, Fortran, OpenMP: Add 'has_device_addr' clause to 'target' construct. 2022-02-09 23:47:12 -08:00
lock.c Update copyright years. 2022-01-03 10:42:10 +01:00
loop_ull.c Update copyright years. 2022-01-03 10:42:10 +01:00
loop.c Update copyright years. 2022-01-03 10:42:10 +01:00
Makefile.am
Makefile.in
oacc-async.c Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-cuda.c Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-host.c Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-init.c Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-int.h Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-mem.c Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-parallel.c Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-plugin.c Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-plugin.h Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-profiling.c Update copyright years. 2022-01-03 10:42:10 +01:00
oacc-target.c
omp_lib.f90.in Update copyright years. 2022-01-03 10:42:10 +01:00
omp_lib.h.in Update copyright years. 2022-01-03 10:42:10 +01:00
omp.h.in Update copyright years. 2022-01-03 10:42:10 +01:00
openacc_lib.h Update copyright years. 2022-01-03 10:42:10 +01:00
openacc.f90 Update copyright years. 2022-01-03 10:42:10 +01:00
openacc.h Update copyright years. 2022-01-03 10:42:10 +01:00
ordered.c Update copyright years. 2022-01-03 10:42:10 +01:00
parallel.c Update copyright years. 2022-01-03 10:42:10 +01:00
priority_queue.c Update copyright years. 2022-01-03 10:42:10 +01:00
priority_queue.h Update copyright years. 2022-01-03 10:42:10 +01:00
scope.c Update copyright years. 2022-01-03 10:42:10 +01:00
sections.c Update copyright years. 2022-01-03 10:42:10 +01:00
secure_getenv.h Update copyright years. 2022-01-03 10:42:10 +01:00
single.c Update copyright years. 2022-01-03 10:42:10 +01:00
splay-tree.c Update copyright years. 2022-01-03 10:42:10 +01:00
splay-tree.h Update copyright years. 2022-01-03 10:42:10 +01:00
target.c C, C++, Fortran, OpenMP: Add 'has_device_addr' clause to 'target' construct. 2022-02-09 23:47:12 -08:00
task.c libgomp: Fix segfault with posthumous orphan tasks [PR104385] 2022-02-08 09:30:17 +01:00
taskloop.c Update copyright years. 2022-01-03 10:42:10 +01:00
team.c Update copyright years. 2022-01-03 10:42:10 +01:00
teams.c Update copyright years. 2022-01-03 10:42:10 +01:00
work.c Update copyright years. 2022-01-03 10:42:10 +01:00