From: Thomas Schwinge <thomas@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>, Tobias Burnus <tobias@codesourcery.com>
Cc: Jakub Jelinek <jakub@redhat.com>
Subject: Add 'libgomp.c-c++-common/pr100059-1.c' [PR100059]
Date: Mon, 4 Sep 2023 14:54:26 +0200 [thread overview]
Message-ID: <87ttsat7y5.fsf@dem-tschwing-1.ger.mentorg.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 473 bytes --]
Hi!
Pushed to master branch commit fe0f9e09413047484441468b05288412760d8a09
"Add 'libgomp.c-c++-common/pr100059-1.c'" (omitting PR100059 tag
unfortunately), see attached.
Grüße
Thomas
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-libgomp.c-c-common-pr100059-1.c.patch --]
[-- Type: text/x-diff, Size: 2211 bytes --]
From fe0f9e09413047484441468b05288412760d8a09 Mon Sep 17 00:00:00 2001
From: Tobias Burnus <tobias@codesourcery.com>
Date: Tue, 13 Apr 2021 08:58:51 +0000
Subject: [PATCH] Add 'libgomp.c-c++-common/pr100059-1.c'
For nvptx offloading, it'll FAIL its execution test until nvptx-tools updated
to include commit 1b5946d78ef5dcfb640e9f545a7c791b7f623911
"Merge commit '26095fd01232061de9f79decb3e8222ef7b46191' into HEAD [#29]",
<https://github.com/MentorEmbedded/nvptx-tools/commit/1b5946d78ef5dcfb640e9f545a7c791b7f623911>.
libgomp/
* testsuite/libgomp.c-c++-common/pr100059-1.c: New.
Co-authored-by: Thomas Schwinge <thomas@codesourcery.com>
---
.../libgomp.c-c++-common/pr100059-1.c | 55 +++++++++++++++++++
1 file changed, 55 insertions(+)
create mode 100644 libgomp/testsuite/libgomp.c-c++-common/pr100059-1.c
diff --git a/libgomp/testsuite/libgomp.c-c++-common/pr100059-1.c b/libgomp/testsuite/libgomp.c-c++-common/pr100059-1.c
new file mode 100644
index 00000000000..af12295541a
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c-c++-common/pr100059-1.c
@@ -0,0 +1,55 @@
+/* Based on sollve_vv's tests/5.0/declare_target/test_nested_declare_target.c. */
+
+#define N 1024
+int a[N], b[N], c[N];
+int i = 0;
+
+void
+update ()
+{
+ for (i = 0; i < N; i++)
+ {
+ a[i] += 1;
+ b[i] += 2;
+ c[i] += 3;
+ }
+}
+
+#pragma omp declare target
+#pragma omp declare target link(a,c,b,i)
+#pragma omp declare target to(update)
+#pragma omp end declare target
+
+int
+main ()
+{
+ for (i = 0; i < N; i++)
+ {
+ a[i] = i;
+ b[i] = i + 1;
+ c[i] = i + 2;
+ }
+
+ //__builtin_printf("i=5: A=%d, B=%d, C=%d\n", a[5], b[5], c[5]);
+
+ #pragma omp target map(to: i) map(tofrom: a, b, c)
+ {
+ update(); /* Device. */
+ }
+
+ //__builtin_printf("i=5: A=%d, B=%d, C=%d\n", a[5], b[5], c[5]);
+
+ for (i = 0; i < N; i++)
+ if ( a[i] != i + 1 || b[i] != i + 3 || c[i] != i + 5)
+ __builtin_abort();
+
+ update(); /* Host. */
+
+ //__builtin_printf("i=5: A=%d, B=%d, C=%d\n", a[5], b[5], c[5]);
+
+ for (i = 0; i < N; i++)
+ if ( a[i] != i + 2 || b[i] != i + 5 || c[i] != i + 8)
+ __builtin_abort ();
+
+ return 0;
+}
--
2.34.1
reply other threads:[~2023-09-04 12:54 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=87ttsat7y5.fsf@dem-tschwing-1.ger.mentorg.com \
--to=thomas@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--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).