gcc/libgomp
Jakub Jelinek aea7238683 openmp: Add support for thread_limit clause on target
OpenMP 5.1 says that thread_limit clause can also appear on target,
and similarly to teams should affect the thread-limit-var ICV.
On combined target teams, the clause goes to both.

We actually passed thread_limit internally on target already before,
but only used it for gcn/ptx offloading to hint how many threads should be
created and for ptx didn't set thread_limit_var in that case.
Similarly for host fallback.
Also, I found that we weren't copying the args array that contains encoded
thread_limit and num_teams clause for target (etc.) for async target.

2021-11-15  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* gimplify.c (optimize_target_teams): Only add OMP_CLAUSE_THREAD_LIMIT
	to OMP_TARGET_CLAUSES if it isn't there already.
gcc/c-family/
	* c-omp.c (c_omp_split_clauses) <case OMP_CLAUSE_THREAD_LIMIT>:
	Duplicate to both OMP_TARGET and OMP_TEAMS.
gcc/c/
	* c-parser.c (OMP_TARGET_CLAUSE_MASK): Add
	PRAGMA_OMP_CLAUSE_THREAD_LIMIT.
gcc/cp/
	* parser.c (OMP_TARGET_CLAUSE_MASK): Add
	PRAGMA_OMP_CLAUSE_THREAD_LIMIT.
libgomp/
	* task.c (gomp_create_target_task): Copy args array as well.
	* target.c (gomp_target_fallback): Add args argument.
	Set gomp_icv (true)->thread_limit_var if thread_limit is present.
	(GOMP_target): Adjust gomp_target_fallback caller.
	(GOMP_target_ext): Likewise.
	(gomp_target_task_fn): Likewise.
	* config/nvptx/team.c (gomp_nvptx_main): Set
	gomp_global_icv.thread_limit_var.
	* testsuite/libgomp.c-c++-common/thread-limit-1.c: New test.
2021-11-15 13:20:53 +01:00
..
config openmp: Add support for thread_limit clause on target 2021-11-15 13:20:53 +01:00
plugin
testsuite openmp: Add support for thread_limit clause on target 2021-11-15 13:20:53 +01:00
.gitattributes
acc_prof.h
acinclude.m4
aclocal.m4
affinity-fmt.c openmp: Avoid PLT relocations for omp_* symbols in libgomp 2021-10-01 10:42:07 +02:00
affinity.c
alloc.c
allocator.c libgomp: Add tests for omp_atv_serialized and deprecate omp_atv_sequential. 2021-10-11 04:34:51 -07:00
atomic.c
barrier.c
ChangeLog Daily bump. 2021-11-13 00:16:39 +00:00
ChangeLog.graphite
config.h.in
configure libgomp: Only check for 2*sizeof(void*) int type with Fortran [PR96661] 2021-09-28 15:15:47 +02:00
configure.ac libgomp: Only check for 2*sizeof(void*) int type with Fortran [PR96661] 2021-09-28 15:15:47 +02:00
configure.tgt
critical.c
env.c Restore 'GOMP_OPENACC_DIM' environment variable parsing 2021-11-09 16:51:57 +01:00
error.c
fortran.c openmp: Add omp_set_num_teams, omp_get_max_teams, omp_[gs]et_teams_thread_limit 2021-10-11 12:20:22 +02:00
hashtab.h
icv-device.c openmp: Avoid PLT relocations for omp_* symbols in libgomp 2021-10-01 10:42:07 +02:00
icv.c openmp: Add omp_set_num_teams, omp_get_max_teams, omp_[gs]et_teams_thread_limit 2021-10-11 12:20:22 +02:00
iter_ull.c
iter.c
libgomp_f.h.in
libgomp_g.h openmp: Honor OpenMP 5.1 num_teams lower bound 2021-11-12 12:41:22 +01:00
libgomp-plugin.c
libgomp-plugin.h
libgomp.h libgomp: Use TLS storage for omp_get_num_teams()/omp_get_team_num() values 2021-11-11 13:57:31 +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 openmp: Document that non-rect loops are not supported in Fortran yet 2021-10-27 09:24:46 +02:00
lock.c
loop_ull.c
loop.c
Makefile.am
Makefile.in
oacc-async.c
oacc-cuda.c
oacc-host.c
oacc-init.c
oacc-int.h
oacc-mem.c
oacc-parallel.c
oacc-plugin.c
oacc-plugin.h
oacc-profiling.c
oacc-target.c
omp_lib.f90.in libgomp: Add tests for omp_atv_serialized and deprecate omp_atv_sequential. 2021-10-11 04:34:51 -07:00
omp_lib.h.in openmp: Add omp_set_num_teams, omp_get_max_teams, omp_[gs]et_teams_thread_limit 2021-10-11 12:20:22 +02:00
omp.h.in libgomp: Add tests for omp_atv_serialized and deprecate omp_atv_sequential. 2021-10-11 04:34:51 -07:00
openacc_lib.h
openacc.f90
openacc.h
ordered.c
parallel.c
priority_queue.c
priority_queue.h
scope.c
sections.c
secure_getenv.h
single.c
splay-tree.c
splay-tree.h
target.c openmp: Add support for thread_limit clause on target 2021-11-15 13:20:53 +01:00
task.c openmp: Add support for thread_limit clause on target 2021-11-15 13:20:53 +01:00
taskloop.c
team.c libgomp: Use TLS storage for omp_get_num_teams()/omp_get_team_num() values 2021-11-11 13:57:31 +01:00
teams.c libgomp: Use TLS storage for omp_get_num_teams()/omp_get_team_num() values 2021-11-11 13:57:31 +01:00
work.c openmp: Fix up struct gomp_work_share handling [PR102838] 2021-10-20 09:34:51 +02:00