[Openmp-commits] [openmp] e5a3d5b - [OpenMP][NFC] Enable more runtime tests and also run them with O3

Johannes Doerfert via Openmp-commits openmp-commits at lists.llvm.org
Mon Jul 31 15:55:07 PDT 2023


Author: Johannes Doerfert
Date: 2023-07-31T15:45:53-07:00
New Revision: e5a3d5ba88819cc5bbb18de5b5f5740983080edc

URL: https://github.com/llvm/llvm-project/commit/e5a3d5ba88819cc5bbb18de5b5f5740983080edc
DIFF: https://github.com/llvm/llvm-project/commit/e5a3d5ba88819cc5bbb18de5b5f5740983080edc.diff

LOG: [OpenMP][NFC] Enable more runtime tests and also run them with O3

The test run fine on my AMD GPU machine, we should verify them on others
too and put them into our regular testing. Not testing O1/2/3 is really
bad and not testing all architecturs is similarly problematic.

Differential Revision: https://reviews.llvm.org/D148576

Added: 
    

Modified: 
    openmp/libomptarget/test/api/omp_device_managed_memory_alloc.c
    openmp/libomptarget/test/api/omp_dynamic_shared_memory.c
    openmp/libomptarget/test/mapping/lambda_mapping.cpp
    openmp/libomptarget/test/offloading/assert.cpp
    openmp/libomptarget/test/offloading/barrier_fence.c
    openmp/libomptarget/test/offloading/bug47654.cpp
    openmp/libomptarget/test/offloading/bug49021.cpp
    openmp/libomptarget/test/offloading/bug49334.cpp
    openmp/libomptarget/test/offloading/bug49779.cpp
    openmp/libomptarget/test/offloading/bug50022.cpp
    openmp/libomptarget/test/offloading/bug51982.c
    openmp/libomptarget/test/offloading/bug53727.cpp
    openmp/libomptarget/test/offloading/d2d_memcpy.c
    openmp/libomptarget/test/offloading/dynamic_module.c
    openmp/libomptarget/test/offloading/target_nowait_target.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/test/api/omp_device_managed_memory_alloc.c b/openmp/libomptarget/test/api/omp_device_managed_memory_alloc.c
index d74ffebc472c84..c48866922debaf 100644
--- a/openmp/libomptarget/test/api/omp_device_managed_memory_alloc.c
+++ b/openmp/libomptarget/test/api/omp_device_managed_memory_alloc.c
@@ -1,5 +1,5 @@
-// RUN: %libomptarget-compile-run-and-check-nvptx64-nvidia-cuda
-// REQUIRES: nvptx64-nvidia-cuda
+// RUN: %libomptarget-compile-run-and-check-generic
+// RUN: %libomptarget-compileopt-run-and-check-generic
 
 #include <omp.h>
 #include <stdio.h>

diff  --git a/openmp/libomptarget/test/api/omp_dynamic_shared_memory.c b/openmp/libomptarget/test/api/omp_dynamic_shared_memory.c
index e291810e356630..b3c26a71d0ca6c 100644
--- a/openmp/libomptarget/test/api/omp_dynamic_shared_memory.c
+++ b/openmp/libomptarget/test/api/omp_dynamic_shared_memory.c
@@ -1,7 +1,13 @@
-// RUN: %libomptarget-compile-nvptx64-nvidia-cuda
+// RUN: %libomptarget-compile-generic
 // RUN: env LIBOMPTARGET_SHARED_MEMORY_SIZE=256 \
-// RUN:   %libomptarget-run-nvptx64-nvidia-cuda | %fcheck-nvptx64-nvidia-cuda
-// REQUIRES: nvptx64-nvidia-cuda
+// RUN:   %libomptarget-run-generic | %fcheck-generic
+
+// RUN: %libomptarget-compileopt-generic
+// RUN: env LIBOMPTARGET_SHARED_MEMORY_SIZE=256 \
+// RUN:   %libomptarget-run-generic | %fcheck-generic
+
+// UNSUPPORTED: x86_64-pc-linux-gnu
+// UNSUPPORTED: x86_64-pc-linux-gnu-LTO
 
 #include <omp.h>
 #include <stdio.h>

diff  --git a/openmp/libomptarget/test/mapping/lambda_mapping.cpp b/openmp/libomptarget/test/mapping/lambda_mapping.cpp
index f9a0ae855d3fed..acec6c82288a84 100644
--- a/openmp/libomptarget/test/mapping/lambda_mapping.cpp
+++ b/openmp/libomptarget/test/mapping/lambda_mapping.cpp
@@ -1,7 +1,8 @@
-// RUN: %libomptarget-compilexx-run-and-check-generic
-
-// Error on the gpu that crashes the host
-// UNSUPPORTED: amdgcn-amd-amdhsa
+// On AMDGPU we don't have malloc support yet. We need optimizations
+// to avoid a thread state which requires malloc.
+//
+// XUN: %libomptarget-compilexx-run-and-check-generic
+// RUN: %libomptarget-compileoptxx-run-and-check-generic
 
 #include <iostream>
 

diff  --git a/openmp/libomptarget/test/offloading/assert.cpp b/openmp/libomptarget/test/offloading/assert.cpp
index 95c28cc9793ac9..07716f457e0860 100644
--- a/openmp/libomptarget/test/offloading/assert.cpp
+++ b/openmp/libomptarget/test/offloading/assert.cpp
@@ -1,5 +1,5 @@
-// RUN: %libomptarget-compilexx-nvptx64-nvidia-cuda && %libomptarget-run-fail-nvptx64-nvidia-cuda
-// REQUIRES: nvptx64-nvidia-cuda
+// RUN: %libomptarget-compilexx-generic && %libomptarget-run-fail-generic
+// RUN: %libomptarget-compileoptxx-generic && %libomptarget-run-fail-generic
 
 int main(int argc, char *argv[]) {
 #pragma omp target

diff  --git a/openmp/libomptarget/test/offloading/barrier_fence.c b/openmp/libomptarget/test/offloading/barrier_fence.c
index d2876191714798..5d1096478ed9e9 100644
--- a/openmp/libomptarget/test/offloading/barrier_fence.c
+++ b/openmp/libomptarget/test/offloading/barrier_fence.c
@@ -1,5 +1,7 @@
 // RUN: %libomptarget-compile-generic -fopenmp-offload-mandatory -O3
 // RUN: %libomptarget-run-generic
+// RUN: %libomptarget-compileopt-generic -fopenmp-offload-mandatory -O3
+// RUN: %libomptarget-run-generic
 
 // UNSUPPORTED: aarch64-unknown-linux-gnu
 // UNSUPPORTED: aarch64-unknown-linux-gnu-LTO

diff  --git a/openmp/libomptarget/test/offloading/bug47654.cpp b/openmp/libomptarget/test/offloading/bug47654.cpp
index abe1dfc29dc2bc..eba7904e76ca8a 100644
--- a/openmp/libomptarget/test/offloading/bug47654.cpp
+++ b/openmp/libomptarget/test/offloading/bug47654.cpp
@@ -1,4 +1,5 @@
 // RUN: %libomptarget-compilexx-run-and-check-generic
+// RUN: %libomptarget-compileoptxx-run-and-check-generic
 
 #include <cassert>
 #include <iostream>

diff  --git a/openmp/libomptarget/test/offloading/bug49021.cpp b/openmp/libomptarget/test/offloading/bug49021.cpp
index 6cc59b12824c8d..37da8ce5d861bd 100644
--- a/openmp/libomptarget/test/offloading/bug49021.cpp
+++ b/openmp/libomptarget/test/offloading/bug49021.cpp
@@ -1,5 +1,7 @@
 // RUN: %libomptarget-compilexx-generic -O3 && %libomptarget-run-generic
 // RUN: %libomptarget-compilexx-generic -O3 -ffast-math && %libomptarget-run-generic
+// RUN: %libomptarget-compileoptxx-generic -O3 && %libomptarget-run-generic
+// RUN: %libomptarget-compileoptxx-generic -O3 -ffast-math && %libomptarget-run-generic
 
 #include <iostream>
 

diff  --git a/openmp/libomptarget/test/offloading/bug49334.cpp b/openmp/libomptarget/test/offloading/bug49334.cpp
index 2568d50eba2e91..077331a6ca055e 100644
--- a/openmp/libomptarget/test/offloading/bug49334.cpp
+++ b/openmp/libomptarget/test/offloading/bug49334.cpp
@@ -1,8 +1,12 @@
-// The test is disabled for now because of the flaky failure which can cause
-// Buildbot gives false negative results.
-
-// RUN: nothing
-// REQUIRES: testToBeFixed
+// RUN: %libomptarget-compilexx-generic -O3 && %libomptarget-run-generic
+// RUN: %libomptarget-compilexx-generic -O3 -ffast-math && \
+// RUN: %libomptarget-run-generic
+// RUN: %libomptarget-compileoptxx-generic -O3 && %libomptarget-run-generic
+// RUN: %libomptarget-compileoptxx-generic -O3 -ffast-math && \
+// RUN: %libomptarget-run-generic
+
+// UNSUPPORTED: x86_64-pc-linux-gnu
+// UNSUPPORTED: x86_64-pc-linux-gnu-LTO
 
 #include <cassert>
 #include <cmath>

diff  --git a/openmp/libomptarget/test/offloading/bug49779.cpp b/openmp/libomptarget/test/offloading/bug49779.cpp
index 91a689d0cbf07f..d036f95b3c3532 100644
--- a/openmp/libomptarget/test/offloading/bug49779.cpp
+++ b/openmp/libomptarget/test/offloading/bug49779.cpp
@@ -1,6 +1,9 @@
 // RUN: %libomptarget-compilexx-generic && \
 // RUN:   env LIBOMPTARGET_STACK_SIZE=2048 %libomptarget-run-generic
+// RUN: %libomptarget-compileoptxx-generic && \
+// RUN:   env LIBOMPTARGET_STACK_SIZE=2048 %libomptarget-run-generic
 
+// We need malloc/global_alloc support
 // UNSUPPORTED: amdgcn-amd-amdhsa
 
 #include <cassert>

diff  --git a/openmp/libomptarget/test/offloading/bug50022.cpp b/openmp/libomptarget/test/offloading/bug50022.cpp
index 54ce06ea2d5392..d2ae02b7054b9f 100644
--- a/openmp/libomptarget/test/offloading/bug50022.cpp
+++ b/openmp/libomptarget/test/offloading/bug50022.cpp
@@ -1,4 +1,5 @@
 // RUN: %libomptarget-compilexx-and-run-generic
+// RUN: %libomptarget-compileoptxx-and-run-generic
 
 #include <cassert>
 #include <iostream>

diff  --git a/openmp/libomptarget/test/offloading/bug51982.c b/openmp/libomptarget/test/offloading/bug51982.c
index 4211190ec2ddf0..91ce4a264e2382 100644
--- a/openmp/libomptarget/test/offloading/bug51982.c
+++ b/openmp/libomptarget/test/offloading/bug51982.c
@@ -1,5 +1,6 @@
 // RUN: %libomptarget-compile-generic -O1 && %libomptarget-run-generic
 // -O1 to run openmp-opt
+// RUN: %libomptarget-compileopt-generic -O1 && %libomptarget-run-generic
 
 int main(void) {
   long int aa = 0;

diff  --git a/openmp/libomptarget/test/offloading/bug53727.cpp b/openmp/libomptarget/test/offloading/bug53727.cpp
index 1008806fc147e3..8ce8b7e9b87c4b 100644
--- a/openmp/libomptarget/test/offloading/bug53727.cpp
+++ b/openmp/libomptarget/test/offloading/bug53727.cpp
@@ -1,4 +1,5 @@
 // RUN: %libomptarget-compilexx-and-run-generic
+// RUN: %libomptarget-compileoptxx-and-run-generic
 
 #include <cassert>
 #include <iostream>

diff  --git a/openmp/libomptarget/test/offloading/d2d_memcpy.c b/openmp/libomptarget/test/offloading/d2d_memcpy.c
index 7610e82291abe4..f26d0c7c580062 100644
--- a/openmp/libomptarget/test/offloading/d2d_memcpy.c
+++ b/openmp/libomptarget/test/offloading/d2d_memcpy.c
@@ -1,4 +1,9 @@
-// RUN: %libomptarget-compile-generic && env OMP_MAX_ACTIVE_LEVELS=2 %libomptarget-run-generic | %fcheck-generic -allow-empty
+// RUN: %libomptarget-compile-generic && \
+// RUN: env OMP_MAX_ACTIVE_LEVELS=2 %libomptarget-run-generic | \
+// RUN: %fcheck-generic -allow-empty
+// RUN: %libomptarget-compileopt-generic && \
+// RUN: env OMP_MAX_ACTIVE_LEVELS=2 %libomptarget-run-generic | \
+// RUN: %fcheck-generic -allow-empty
 
 #include <assert.h>
 #include <omp.h>

diff  --git a/openmp/libomptarget/test/offloading/dynamic_module.c b/openmp/libomptarget/test/offloading/dynamic_module.c
index 05efcb526fc516..f1e9862002a186 100644
--- a/openmp/libomptarget/test/offloading/dynamic_module.c
+++ b/openmp/libomptarget/test/offloading/dynamic_module.c
@@ -1,4 +1,7 @@
-// RUN: %libomptarget-compile-generic -DSHARED -fPIC -shared -o %t.so && %libomptarget-compile-generic %t.so && %libomptarget-run-generic 2>&1 | %fcheck-generic
+// RUN: %libomptarget-compile-generic -DSHARED -fPIC -shared -o %t.so && \
+// RUN: %libomptarget-compile-generic %t.so && %libomptarget-run-generic 2>&1 | %fcheck-generic
+// RUN: %libomptarget-compileopt-generic -DSHARED -fPIC -shared -o %t.so && \
+// RUN: %libomptarget-compileopt-generic %t.so && %libomptarget-run-generic 2>&1 | %fcheck-generic
 
 #ifdef SHARED
 void foo() {}

diff  --git a/openmp/libomptarget/test/offloading/target_nowait_target.cpp b/openmp/libomptarget/test/offloading/target_nowait_target.cpp
index c00b23d316d9a7..7c20e76ce138ac 100644
--- a/openmp/libomptarget/test/offloading/target_nowait_target.cpp
+++ b/openmp/libomptarget/test/offloading/target_nowait_target.cpp
@@ -1,6 +1,5 @@
 // RUN: %libomptarget-compilexx-and-run-generic
-
-// UNSUPPORTED: amdgcn-amd-amdhsa
+// RUN: %libomptarget-compileoptxx-and-run-generic
 
 #include <cassert>
 


        


More information about the Openmp-commits mailing list