[Openmp-commits] [openmp] 9f3b06d - [OpenMP][FIX] Fix memset oversight to partially unblock test

Johannes Doerfert via Openmp-commits openmp-commits at lists.llvm.org
Sun Oct 22 14:29:24 PDT 2023


Author: Johannes Doerfert
Date: 2023-10-22T14:29:11-07:00
New Revision: 9f3b06d8bea1ee03ef03bf3da4b4bfc9925e87fe

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

LOG: [OpenMP][FIX] Fix memset oversight to partially unblock test

The tests "unoptimized" version is still broken, disabled for now.

Added: 
    

Modified: 
    openmp/libomptarget/DeviceRTL/src/State.cpp
    openmp/libomptarget/test/offloading/thread_state_1.c

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/DeviceRTL/src/State.cpp b/openmp/libomptarget/DeviceRTL/src/State.cpp
index 70f30e9ba120c52..22f684b05f598d8 100644
--- a/openmp/libomptarget/DeviceRTL/src/State.cpp
+++ b/openmp/libomptarget/DeviceRTL/src/State.cpp
@@ -265,7 +265,7 @@ void state::enterDataEnvironment(IdentTy *Ident) {
     uint32_t Bytes = sizeof(ThreadStates[0]) * mapping::getMaxTeamThreads();
     void *ThreadStatesPtr =
         memory::allocGlobal(Bytes, "Thread state array allocation");
-    memset(ThreadStatesPtr, '0', Bytes);
+    memset(ThreadStatesPtr, 0, Bytes);
     if (!atomic::cas(ThreadStatesBitsPtr, uintptr_t(0),
                      reinterpret_cast<uintptr_t>(ThreadStatesPtr),
                      atomic::seq_cst, atomic::seq_cst))

diff  --git a/openmp/libomptarget/test/offloading/thread_state_1.c b/openmp/libomptarget/test/offloading/thread_state_1.c
index a53e90882470589..4e8043ea844ebf2 100644
--- a/openmp/libomptarget/test/offloading/thread_state_1.c
+++ b/openmp/libomptarget/test/offloading/thread_state_1.c
@@ -1,8 +1,7 @@
-// RUN: %libomptarget-compile-run-and-check-generic
+// Still broken "without optimizations"
+// XUN: %libomptarget-compile-run-and-check-generic
 // RUN: %libomptarget-compileopt-run-and-check-generic
 
-// UNSUPPORTED: amdgcn-amd-amdhsa
-
 #include <omp.h>
 #include <stdio.h>
 


        


More information about the Openmp-commits mailing list