diff mbox series

[committed] libgomp: Add gfx90c, 1036 and 1103 declare variant tests

Message ID ZjNlqoBjYCgUhsV8@tucnak
State New
Headers show
Series [committed] libgomp: Add gfx90c, 1036 and 1103 declare variant tests | expand

Commit Message

Jakub Jelinek May 2, 2024, 10:06 a.m. UTC
Hi!

Recently -march=gfx{90c,1036,1103} support has been added, but corresponding
changes weren't done in the testsuite.

The following patch adds that.

Tested on x86_64-linux (with fiji and gfx1103 devices; had to use
OMP_DEFAULT_DEVICE=1 there, fiji doesn't really work due to LLVM dropping
support, but we still list those as offloading devices).
Committed to trunk.

2024-05-02  Jakub Jelinek  <jakub@redhat.com>

	* testsuite/libgomp.c/declare-variant-4.h (gfx90c, gfx1036, gfx1103):
	New functions.
	(f): Add #pragma omp declare variant directives for those.
	* testsuite/libgomp.c/declare-variant-4-gfx90c.c: New test.
	* testsuite/libgomp.c/declare-variant-4-gfx1036.c: New test.
	* testsuite/libgomp.c/declare-variant-4-gfx1103.c: New test.


	Jakub
diff mbox series

Patch

--- libgomp/testsuite/libgomp.c/declare-variant-4.h.jj	2024-01-29 12:11:57.917149306 +0100
+++ libgomp/testsuite/libgomp.c/declare-variant-4.h	2024-05-02 11:41:42.579379273 +0200
@@ -37,6 +37,13 @@  gfx90a (void)
 
 __attribute__ ((noipa))
 int
+gfx90c (void)
+{
+  return 0x90c;
+}
+
+__attribute__ ((noipa))
+int
 gfx1030 (void)
 {
   return 0x1030;
@@ -44,11 +51,25 @@  gfx1030 (void)
 
 __attribute__ ((noipa))
 int
+gfx1036 (void)
+{
+  return 0x1036;
+}
+
+__attribute__ ((noipa))
+int
 gfx1100 (void)
 {
   return 0x1100;
 }
 
+__attribute__ ((noipa))
+int
+gfx1103 (void)
+{
+  return 0x1103;
+}
+
 #ifdef USE_FIJI_FOR_GFX803
 #pragma omp declare variant(gfx803) match(device = {isa("fiji")})
 #else
@@ -58,8 +79,11 @@  gfx1100 (void)
 #pragma omp declare variant(gfx906) match(device = {isa("gfx906")})
 #pragma omp declare variant(gfx908) match(device = {isa("gfx908")})
 #pragma omp declare variant(gfx90a) match(device = {isa("gfx90a")})
+#pragma omp declare variant(gfx90c) match(device = {isa("gfx90c")})
 #pragma omp declare variant(gfx1030) match(device = {isa("gfx1030")})
+#pragma omp declare variant(gfx1036) match(device = {isa("gfx1036")})
 #pragma omp declare variant(gfx1100) match(device = {isa("gfx1100")})
+#pragma omp declare variant(gfx1103) match(device = {isa("gfx1103")})
 __attribute__ ((noipa))
 int
 f (void)
--- libgomp/testsuite/libgomp.c/declare-variant-4-gfx90c.c.jj	2024-05-02 11:38:57.272597106 +0200
+++ libgomp/testsuite/libgomp.c/declare-variant-4-gfx90c.c	2024-05-02 11:39:11.169410657 +0200
@@ -0,0 +1,8 @@ 
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx90c } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "= gfx90c \\(\\);" "optimized" } } */
--- libgomp/testsuite/libgomp.c/declare-variant-4-gfx1036.c.jj	2024-05-02 11:39:29.393166162 +0200
+++ libgomp/testsuite/libgomp.c/declare-variant-4-gfx1036.c	2024-05-02 11:39:51.834865074 +0200
@@ -0,0 +1,8 @@ 
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx1036 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "= gfx1036 \\(\\);" "optimized" } } */
--- libgomp/testsuite/libgomp.c/declare-variant-4-gfx1103.c.jj	2024-05-02 11:39:43.155981513 +0200
+++ libgomp/testsuite/libgomp.c/declare-variant-4-gfx1103.c	2024-05-02 11:40:02.801717936 +0200
@@ -0,0 +1,8 @@ 
+/* { dg-do link { target { offload_target_amdgcn } } } */
+/* { dg-additional-options -foffload=amdgcn-amdhsa } */
+/* { dg-additional-options -foffload=-march=gfx1103 } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-4.h"
+
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "= gfx1103 \\(\\);" "optimized" } } */