]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Adjust 'libgomp.c/max_vf-*.c'
authorThomas Schwinge <tschwinge@baylibre.com>
Sat, 9 Nov 2024 12:37:53 +0000 (13:37 +0100)
committerThomas Schwinge <tschwinge@baylibre.com>
Sun, 10 Nov 2024 10:19:02 +0000 (11:19 +0100)
For configurations where both GCN and nvptx offloading are enabled, we get:

    PASS: libgomp.c/max_vf-1.c (test for excess errors)
    PASS: libgomp.c/max_vf-1.c scan-tree-dump-times ompexp "GOMP_MAX_VF" 2
    PASS: libgomp.c/max_vf-1.c scan-tree-dump-times ompexp "__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \\(.*, D\\.[0-9]*, 0\\);" 1
    PASS: libgomp.c/max_vf-1.c scan-amdgcn-amdhsa-offload-tree-dump-times optimized "__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \\(.*, 64, 0\\);" 1
    FAIL: libgomp.c/max_vf-1.c scan-nvptx-none-offload-tree-dump-times optimized "__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \\(.*, 64, 0\\);" 1
    FAIL: libgomp.c/max_vf-1.c scan-amdgcn-amdhsa-offload-tree-dump-times optimized "__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \\(.*, 7, 0\\);" 1
    PASS: libgomp.c/max_vf-1.c scan-nvptx-none-offload-tree-dump-times optimized "__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \\(.*, 7, 0\\);" 1

Avoid these FAILs via 'only_for_offload_target [...]'.  Also, for consistency
with other libgomp test cases, use effective-target specifiers of the libgomp
test suite.  Fix-up for recent commit d334f729e53867b838e867375b3f475ba793d96e
"openmp: Add testcases for omp_max_vf".

libgomp/
* testsuite/libgomp.c/max_vf-1.c: Adjust.
* testsuite/libgomp.c/max_vf-2.c: Likewise.

libgomp/testsuite/libgomp.c/max_vf-1.c
libgomp/testsuite/libgomp.c/max_vf-2.c

index 9c8d5dc0af97a2a514c9aa6d87fb2db5a9bbdc02..70f6b86c614c678e3fdb67add6ebcd3d617ab1f8 100644 (file)
@@ -1,7 +1,7 @@
 /* Test that omp parallel simd schedule uses the correct max_vf for the
    host system, when target directives are present.  */
 
-/* { dg-require-effective-target offloading_enabled } */
+/* { dg-require-effective-target offload_target_any } */
 
 /* { dg-do link } */
 /* { dg-options "-fopenmp -O2 -fdump-tree-ompexp -foffload=-fdump-tree-optimized" } */
@@ -41,7 +41,7 @@ f3 (int *a, int *b, int *c)
 { dg-final { scan-tree-dump-times {__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \(.*, D\.[0-9]*, 0\);} 1 "ompexp" { target { x86_64-*-* i?86-*-* } } } } */
 
 /* Test SIMD offload devices
-{ dg-final { scan-offload-tree-dump-times {__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \(.*, 64, 0\);} 1 "optimized" { target { offload_gcn } } } } 
-{ dg-final { scan-offload-tree-dump-times {__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \(.*, 7, 0\);} 1 "optimized" { target { offload_nvptx } } } } */
+{ dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump-times {__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \(.*, 64, 0\);} 1 "optimized" { target offload_target_amdgcn } } }
+{ dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump-times {__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \(.*, 7, 0\);} 1 "optimized" { target offload_target_nvptx } } } */
 
 int main() {}
index 91744c309df8d25e079cb4100e6a0d71a4734920..545cf1d2138a5e3360dbc8c0c8ac1b2b678a1130 100644 (file)
@@ -1,7 +1,7 @@
 /* Ensure that the default safelen is set correctly for the larger of the host
    and offload device, to prevent defeating the vectorizer.  */
  
-/* { dg-require-effective-target offloading_enabled } */
+/* { dg-require-effective-target offload_target_any } */
 
 /* { dg-do link } */
 /* { dg-options "-fopenmp -O2 -fdump-tree-omplower" } */
@@ -16,6 +16,6 @@ int f(float *a, float *b, int n)
 }
 
 /* Make sure that the max_vf used is suitable for the offload device.
-{ dg-final { scan-tree-dump-times {omp simd safelen\(64\)} 1 "omplower" { target { offload_gcn } } } } */
+{ dg-final { scan-tree-dump-times {omp simd safelen\(64\)} 1 "omplower" { target offload_target_amdgcn } } } */
 
 int main() {}