public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>
Cc: Tom de Vries <tdevries@suse.de>, Jakub Jelinek <jakub@redhat.com>,
	Tobias Burnus <tobias@codesourcery.com>
Subject: Spin 'dg-do run' part of 'libgomp.c/declare-variant-3-sm30.c' off into new 'libgomp.c/declare-variant-3.c' (was: [PATCH][libgomp, testsuite, nvptx] Add libgomp.c/declare-variant-3-sm*.c)
Date: Thu, 30 Nov 2023 15:59:29 +0100	[thread overview]
Message-ID: <877clz5lta.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <0ce14ee6-a677-76a9-7e7a-d99d3927bd8a@suse.de>

[-- Attachment #1: Type: text/plain, Size: 759 bytes --]

Hi!

On 2022-02-24T11:32:53+0100, Tom de Vries via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> the sm_30 test which is still dg-do run (although I've
> added the compile time test) which should pass on all boards (since we
> don't support below sm_30).

Pushed to master branch commit 95e6e32a85566a5510d21938d439e90e504e0ddc
"Spin 'dg-do run' part of 'libgomp.c/declare-variant-3-sm30.c' off into new 'libgomp.c/declare-variant-3.c'",
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-Spin-dg-do-run-part-of-libgomp.c-declare-variant-3-s.patch --]
[-- Type: text/x-diff, Size: 3104 bytes --]

From 95e6e32a85566a5510d21938d439e90e504e0ddc Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Tue, 21 Nov 2023 19:03:47 +0100
Subject: [PATCH] Spin 'dg-do run' part of 'libgomp.c/declare-variant-3-sm30.c'
 off into new 'libgomp.c/declare-variant-3.c'

Having nvptx offloading configured doesn't imply being able to run nvptx
offloading test cases on the test host.

Also, make 'libgomp.c/declare-variant-3.c' work for all non-offloading and
offloading cases.

Fix-up for commit 59b8ade88774b4dcf1691a8f650cdbb86cc30862
"[libgomp, testsuite, nvptx] Add libgomp.c/declare-variant-3-sm*.c".

	libgomp/
	* testsuite/libgomp.c/declare-variant-3-sm30.c: Turn 'dg-do run'
	into 'dg-do link'.
	* testsuite/libgomp.c/declare-variant-3.c: New.
	* testsuite/libgomp.c/declare-variant-3.h: Extend.
---
 libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-3.c      | 8 ++++++++
 libgomp/testsuite/libgomp.c/declare-variant-3.h      | 5 +++++
 3 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 libgomp/testsuite/libgomp.c/declare-variant-3.c

diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c b/libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c
index a373647bb33..d2ffa5637c5 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target { offload_target_nvptx } } } */
+/* { dg-do link { target { offload_target_nvptx } } } */
 /* { dg-additional-options -foffload=nvptx-none } */
 /* { dg-additional-options "-foffload=-misa=sm_30 -foffload=-mptx=_" } */
 /* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3.c b/libgomp/testsuite/libgomp.c/declare-variant-3.c
new file mode 100644
index 00000000000..62c1fa766ba
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3.c
@@ -0,0 +1,8 @@
+/* { dg-additional-options -DOFFLOAD_DEVICE_NVPTX { target offload_device_nvptx } } */
+/* { dg-additional-options {-fdump-tree-optimized -foffload-options=-fdump-tree-optimized} } */
+
+#include "declare-variant-3.h"
+
+/* { dg-final { scan-tree-dump "= f \\(\\);" "optimized" } }
+   { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "= f \\(\\);" "optimized" { target offload_target_amdgcn } } }
+   { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump "= f\[0-9\]+ \\(\\);" "optimized" { target offload_target_nvptx } } } */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3.h b/libgomp/testsuite/libgomp.c/declare-variant-3.h
index 646e15e5311..38ee257e42d 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3.h
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3.h
@@ -65,10 +65,15 @@ main (void)
   #pragma omp target map(from:v)
   v = f ();
 
+#ifdef OFFLOAD_DEVICE_NVPTX
   if (v == 0)
     __builtin_abort ();
 
   __builtin_printf ("Nvptx accelerator: sm_%d\n", v);
+#else
+  if (v != 0)
+    __builtin_abort ();
+#endif
 
   return 0;
 }
-- 
2.34.1


      parent reply	other threads:[~2023-11-30 14:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-17 17:24 [Patch] nvptx: Add -mptx=6.0 + -misa=sm_70 Tobias Burnus
2022-02-22 14:26 ` Tom de Vries
2022-02-22 14:39 ` Tom de Vries
2022-02-22 14:43 ` Tom de Vries
2022-02-22 16:03   ` Tobias Burnus
2022-02-24  8:29     ` Tom de Vries
2022-02-24 10:01       ` [PATCH][libgomp, testsuite, nvptx] Add libgomp.c/declare-variant-3-sm*.c Tom de Vries
2022-02-24 10:09         ` Jakub Jelinek
2022-02-24 10:32           ` Tom de Vries
2022-02-24 10:38             ` Jakub Jelinek
2023-11-30 14:48             ` Fix 'libgomp.c/declare-variant-3-*.c' compilation for configurations where GCN offloading is enabled in addition to nvptx (was: [PATCH][libgomp, testsuite, nvptx] Add libgomp.c/declare-variant-3-sm*.c) Thomas Schwinge
2023-11-30 14:49               ` Thomas Schwinge
2023-11-30 14:57             ` In 'libgomp.c/declare-variant-{3,4}-*.c', restrict 'scan-offload-tree-dump's to 'only_for_offload_target [...]' " Thomas Schwinge
2023-11-30 14:59             ` Thomas Schwinge [this message]

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=877clz5lta.fsf@euler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=tdevries@suse.de \
    --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).