gcc/include
Chung-Lin Tang 3a3596389c OpenACC 2.7: Implement self clause for compute constructs
This patch implements the 'self' clause for compute constructs: parallel,
kernels, and serial. This clause conditionally uses the local device
(the host mult-core CPU) as the executing device of the compute region.

The actual implementation of the "local device" device type inside libgomp
(presumably using pthreads) is still not yet completed, so the libgomp
side is still implemented the exact same as host-fallback mode. (so as of now,
it essentially behaves like the 'if' clause with the condition inverted)

gcc/c/ChangeLog:

	* c-parser.cc (c_parser_oacc_compute_clause_self): New function.
	(c_parser_oacc_all_clauses): Add new 'bool compute_p = false'
	parameter, add parsing of self clause when compute_p is true.
	(OACC_KERNELS_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_SELF.
	(OACC_PARALLEL_CLAUSE_MASK): Likewise,
	(OACC_SERIAL_CLAUSE_MASK): Likewise.
	(c_parser_oacc_compute): Adjust call to c_parser_oacc_all_clauses to
	set compute_p argument to true.
	* c-typeck.cc (c_finish_omp_clauses): Add OMP_CLAUSE_SELF case.

gcc/cp/ChangeLog:

	* parser.cc (cp_parser_oacc_compute_clause_self): New function.
	(cp_parser_oacc_all_clauses): Add new 'bool compute_p = false'
	parameter, add parsing of self clause when compute_p is true.
	(OACC_KERNELS_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_SELF.
	(OACC_PARALLEL_CLAUSE_MASK): Likewise,
	(OACC_SERIAL_CLAUSE_MASK): Likewise.
	(cp_parser_oacc_compute): Adjust call to c_parser_oacc_all_clauses to
	set compute_p argument to true.
	* pt.cc (tsubst_omp_clauses): Add OMP_CLAUSE_SELF case.
	* semantics.cc (c_finish_omp_clauses): Add OMP_CLAUSE_SELF case, merged
	with OMP_CLAUSE_IF case.

gcc/fortran/ChangeLog:

	* gfortran.h (typedef struct gfc_omp_clauses): Add self_expr field.
	* openmp.cc (enum omp_mask2): Add OMP_CLAUSE_SELF.
	(gfc_match_omp_clauses): Add handling for OMP_CLAUSE_SELF.
	(OACC_PARALLEL_CLAUSES): Add OMP_CLAUSE_SELF.
	(OACC_KERNELS_CLAUSES): Likewise.
	(OACC_SERIAL_CLAUSES): Likewise.
	(resolve_omp_clauses): Add handling for omp_clauses->self_expr.
	* trans-openmp.cc (gfc_trans_omp_clauses): Add handling of
	clauses->self_expr and building of OMP_CLAUSE_SELF tree clause.
	(gfc_split_omp_clauses): Add handling of self_expr field copy.

gcc/ChangeLog:

	* gimplify.cc (gimplify_scan_omp_clauses): Add OMP_CLAUSE_SELF case.
	(gimplify_adjust_omp_clauses): Likewise.
	* omp-expand.cc (expand_omp_target): Add OMP_CLAUSE_SELF expansion code,
	* omp-low.cc (scan_sharing_clauses): Add OMP_CLAUSE_SELF case.
	* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_SELF enum.
	* tree-nested.cc (convert_nonlocal_omp_clauses): Add OMP_CLAUSE_SELF
	case.
	(convert_local_omp_clauses): Likewise.
	* tree-pretty-print.cc (dump_omp_clause): Add OMP_CLAUSE_SELF case.
	* tree.cc (omp_clause_num_ops): Add OMP_CLAUSE_SELF entry.
	(omp_clause_code_name): Likewise.
	* tree.h (OMP_CLAUSE_SELF_EXPR): New macro.

gcc/testsuite/ChangeLog:

	* c-c++-common/goacc/self-clause-1.c: New test.
	* c-c++-common/goacc/self-clause-2.c: New test.
	* gfortran.dg/goacc/self.f95: New test.

include/ChangeLog:

	* gomp-constants.h (GOACC_FLAG_LOCAL_DEVICE): New flag bit value.

libgomp/ChangeLog:

	* oacc-parallel.c (GOACC_parallel_keyed): Add code to handle
	GOACC_FLAG_LOCAL_DEVICE case.
	* testsuite/libgomp.oacc-c-c++-common/self-1.c: New test.
2023-10-25 10:49:55 +02:00
..
cuda libgomp: cuda.h and omp_target_memcpy_rect cleanup 2023-07-29 13:25:03 +02:00
gdb Update copyright years. 2023-01-16 11:52:17 +01:00
ansidecl.h Update copyright years. 2023-01-16 11:52:17 +01:00
btf.h Update copyright years. 2023-01-16 11:52:17 +01:00
ChangeLog Daily bump. 2023-10-13 00:18:18 +00:00
ChangeLog-9103
ChangeLog.jit
collectorAPI.h gprofng: a new GNU profiler 2023-08-07 22:59:38 +02:00
COPYING
COPYING3
ctf.h Synchronize include/ctf.h with upstream binutils/libctf. 2023-04-28 14:20:24 +01:00
demangle.h c++: constrained hidden friends [PR109751] 2023-08-22 14:34:53 -04:00
dwarf2.def Update copyright years. 2023-01-16 11:52:17 +01:00
dwarf2.h Update copyright years. 2023-01-16 11:52:17 +01:00
dyn-string.h Update copyright years. 2023-01-16 11:52:17 +01:00
environ.h Update copyright years. 2023-01-16 11:52:17 +01:00
fibheap.h Update copyright years. 2023-01-16 11:52:17 +01:00
filenames.h Update copyright years. 2023-01-16 11:52:17 +01:00
floatformat.h Update copyright years. 2023-01-16 11:52:17 +01:00
fnmatch.h Update copyright years. 2023-01-16 11:52:17 +01:00
gcc-c-fe.def Update copyright years. 2023-01-16 11:52:17 +01:00
gcc-c-interface.h Update copyright years. 2023-01-16 11:52:17 +01:00
gcc-cp-fe.def Update copyright years. 2023-01-16 11:52:17 +01:00
gcc-cp-interface.h Update copyright years. 2023-01-16 11:52:17 +01:00
gcc-interface.h Update copyright years. 2023-01-16 11:52:17 +01:00
getopt.h Update copyright years. 2023-01-16 11:52:17 +01:00
gomp-constants.h OpenACC 2.7: Implement self clause for compute constructs 2023-10-25 10:49:55 +02:00
hashtab.h Update copyright years. 2023-01-16 11:52:17 +01:00
hsa.h Import HSA header files from AMD 2020-12-09 11:10:40 +00:00
hsa_ext_amd.h Import HSA header files from AMD 2020-12-09 11:10:40 +00:00
hsa_ext_image.h Import HSA header files from AMD 2020-12-09 11:10:40 +00:00
leb128.h Update copyright years. 2023-01-16 11:52:17 +01:00
libcollector.h gprofng: a new GNU profiler 2023-08-07 22:59:38 +02:00
libfcollector.h gprofng: a new GNU profiler 2023-08-07 22:59:38 +02:00
libiberty.h Update copyright years. 2023-01-16 11:52:17 +01:00
longlong.h Update copyright years. 2023-01-16 11:52:17 +01:00
lto-symtab.h Update copyright years. 2023-01-16 11:52:17 +01:00
md5.h Update copyright years. 2023-01-16 11:52:17 +01:00
objalloc.h Update copyright years. 2023-01-16 11:52:17 +01:00
obstack.h Update copyright years. 2023-01-16 11:52:17 +01:00
partition.h Update copyright years. 2023-01-16 11:52:17 +01:00
plugin-api.h PR29961, plugin-api.h: "Could not detect architecture endianess" 2023-08-07 22:59:36 +02:00
safe-ctype.h Update copyright years. 2023-01-16 11:52:17 +01:00
sha1.h Update copyright years. 2023-01-16 11:52:17 +01:00
simple-object.h Update copyright years. 2023-01-16 11:52:17 +01:00
sort.h Update copyright years. 2023-01-16 11:52:17 +01:00
spincount.h x86: set spincount 1 for x86 hybrid platform 2023-10-12 12:47:17 +08:00
splay-tree.h Update copyright years. 2023-01-16 11:52:17 +01:00
symcat.h Update copyright years. 2023-01-16 11:52:17 +01:00
timeval-utils.h Update copyright years. 2023-01-16 11:52:17 +01:00
vtv-change-permission.h Update copyright years. 2023-01-16 11:52:17 +01:00
xregex.h
xregex2.h Update copyright years. 2023-01-16 11:52:17 +01:00
xtensa-config.h Update copyright years. 2023-01-16 11:52:17 +01:00
xtensa-dynconfig.h gcc-4.5 build fixes 2023-08-07 22:59:36 +02:00