[Openmp-commits] [openmp] 87dac9f - [OpenMP] Rewrite test to check the correct (CPU) result

Johannes Doerfert via Openmp-commits openmp-commits at lists.llvm.org
Sat Oct 21 14:56:04 PDT 2023


Author: Johannes Doerfert
Date: 2023-10-21T14:55:15-07:00
New Revision: 87dac9f1682c389c9feee6358263b049f1ad27d9

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

LOG: [OpenMP] Rewrite test to check the correct (CPU) result

The test initially showed we do no crash but compute the wrong GPU
result, now we show the CPU result is correct and disable GPU testing.

Added: 
    

Modified: 
    openmp/libomptarget/test/offloading/thread_state_1.c

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/test/offloading/thread_state_1.c b/openmp/libomptarget/test/offloading/thread_state_1.c
index 87251200b907826..4d31214553e8e79 100644
--- a/openmp/libomptarget/test/offloading/thread_state_1.c
+++ b/openmp/libomptarget/test/offloading/thread_state_1.c
@@ -1,19 +1,13 @@
 // RUN: %libomptarget-compile-run-and-check-generic
 // RUN: %libomptarget-compileopt-run-and-check-generic
 
-// These are supported and work, but we compute bogus results on the GPU. For
-// now we disable the CPU and enable it once the GPU is fixed.
-//
-// UNSUPPORTED: aarch64-unknown-linux-gnu
-// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
-// UNSUPPORTED: x86_64-pc-linux-gnu
-// UNSUPPORTED: x86_64-pc-linux-gnu-LTO
+// UNSUPPORTED: amdgcn-amd-amdhsa
 
 #include <omp.h>
 #include <stdio.h>
 
 int main() {
-  // TODO: Test all ICVs
+  // TODO: Test all ICVs on all levels
   int lvl = 333, tid = 666, nt = 999;
 #pragma omp target teams map(tofrom : lvl, tid, nt) num_teams(2)
   {
@@ -30,7 +24,7 @@ int main() {
     }
   }
   // TODO: This is wrong, but at least it doesn't crash
-  // CHECK: lvl: 333, tid: 666, nt: 999
+  // CHECK: lvl: 2, tid: 0, nt: 1
   printf("lvl: %i, tid: %i, nt: %i\n", lvl, tid, nt);
   return 0;
 }


        


More information about the Openmp-commits mailing list