public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5258] libgomp: Add a testcase for omp_get_num_teams inside of target inside of host teams
@ 2021-11-15 7:59 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2021-11-15 7:59 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:d29445972065f54566402b255d76b2567e23d445
commit r12-5258-gd29445972065f54566402b255d76b2567e23d445
Author: Jakub Jelinek <jakub@redhat.com>
Date: Mon Nov 15 08:54:52 2021 +0100
libgomp: Add a testcase for omp_get_num_teams inside of target inside of host teams
This is https://github.com/OpenMP/spec/issues/3183
There is an agreement that we should return 1 team inside of target,
even if that target is inside of host teams. We were doing that
when offloading and not during host fallback, r12-5151 should fix that
even for host fallback.
2021-11-15 Jakub Jelinek <jakub@redhat.com>
* testsuite/libgomp.c/teams-5.c: New test.
Diff:
---
libgomp/testsuite/libgomp.c/teams-5.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/libgomp/testsuite/libgomp.c/teams-5.c b/libgomp/testsuite/libgomp.c/teams-5.c
new file mode 100644
index 00000000000..ad42e05825f
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/teams-5.c
@@ -0,0 +1,17 @@
+#include <omp.h>
+#include <stdlib.h>
+
+int
+main ()
+{
+ #pragma omp teams num_teams (2)
+ {
+ if (omp_get_num_teams () != 2)
+ abort ();
+ #pragma omp parallel if (0)
+ #pragma omp target
+ if (omp_get_num_teams () != 1 || omp_get_team_num () != 0)
+ abort ();
+ }
+ return 0;
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-15 7:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 7:59 [gcc r12-5258] libgomp: Add a testcase for omp_get_num_teams inside of target inside of host teams Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).