From: Jakub Jelinek <jakub@redhat.com>
To: gcc-patches@gcc.gnu.org
Cc: Tobias Burnus <tobias@codesourcery.com>
Subject: [committed] libgomp: Add a testcase for omp_get_num_teams inside of target inside of host teams
Date: Mon, 15 Nov 2021 09:00:22 +0100 [thread overview]
Message-ID: <20211115080022.GS2710@tucnak> (raw)
Hi!
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.
Bootstrapped/regtested on x86_64-linux and i686-linux and tested with
nvptx offloading on the former.
2021-11-15 Jakub Jelinek <jakub@redhat.com>
* testsuite/libgomp.c/teams-5.c: New test.
--- libgomp/testsuite/libgomp.c/teams-5.c.jj 2021-11-12 17:10:07.739523564 +0100
+++ libgomp/testsuite/libgomp.c/teams-5.c 2021-11-12 17:09:41.424899991 +0100
@@ -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;
+}
Jakub
reply other threads:[~2021-11-15 8:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211115080022.GS2710@tucnak \
--to=jakub@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=tobias@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).