]> git.ipfire.org Git - thirdparty/gcc.git/commit - libgomp/env.c
openmp: Handle OpenMP 5.1 simplified OMP_PLACES syntax
authorJakub Jelinek <jakub@redhat.com>
Fri, 15 Oct 2021 14:35:57 +0000 (16:35 +0200)
committerJakub Jelinek <jakub@redhat.com>
Fri, 15 Oct 2021 14:35:57 +0000 (16:35 +0200)
commit4a0fed0c0c7241562eaa5f1a4c916b689429ad86
treecff49bd757788e03aba0a3eadfc889d2ac35f348
parentc057ed9c52c6a63a1a692268f916b1a9131cd4b7
openmp: Handle OpenMP 5.1 simplified OMP_PLACES syntax

In addition to adding ll_caches and numa_domain abstract names
to OMP_PLACES syntax, OpenMP 5.1 also added one syntax simplification:
https://github.com/OpenMP/spec/issues/2080
https://github.com/OpenMP/spec/pull/2081
in particular that in the grammar place non-terminal is now
not only { res-list } but also res (i.e. a non-negative integer),
which stands as a shortcut for { res }
So, one can specify OMP_PLACES=0,4,8,12 with the meaning
OMP_PLACES={0},{4},{8},{12} or OMP_PLACES=0:4 instead of OMP_PLACES={0}:4
or OMP_PLACES={0},{1},{2},{3} etc.

This patch implements that.

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

* env.c (parse_one_place): Handle non-negative-number the same
as { non-negative-number }.  Reject even !number:1 and
!number:1:stride or !place:1 or !place:1:stride instead of just
length other than 1.
* libgomp.texi (OpenMP 5.1): Document OMP_PLACES syntax extensions
and OMP_NUM_TEAMS/OMP_TEAMS_THREAD_LIMIT and
omp_{set_num,get_max}_teams/omp_{s,g}et_teams_thread_limit features
as implemented.
* testsuite/libgomp.c/affinity-1.c: Add a test for the 5.1 place
simplified syntax.
libgomp/env.c
libgomp/libgomp.texi
libgomp/testsuite/libgomp.c/affinity-1.c