[Openmp-commits] [PATCH] D113963: [OpenMP] Fix initializer not working on AMDGPU

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Nov 16 05:17:39 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG374cd0fb6102: [OpenMP] Fix initializer not working on AMDGPU (authored by jhuber6).

Changed prior to commit:
  https://reviews.llvm.org/D113963?vs=387484&id=387582#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113963/new/

https://reviews.llvm.org/D113963

Files:
  openmp/libomptarget/DeviceRTL/include/Debug.h
  openmp/libomptarget/DeviceRTL/src/Debug.cpp
  openmp/libomptarget/DeviceRTL/src/State.cpp


Index: openmp/libomptarget/DeviceRTL/src/State.cpp
===================================================================
--- openmp/libomptarget/DeviceRTL/src/State.cpp
+++ openmp/libomptarget/DeviceRTL/src/State.cpp
@@ -366,8 +366,10 @@
 
 void state::init(bool IsSPMD) {
   SharedMemorySmartStack.init(IsSPMD);
-  if (mapping::isInitialThreadInLevel0(IsSPMD))
+  if (mapping::isInitialThreadInLevel0(IsSPMD)) {
     TeamState.init(IsSPMD);
+    DebugEntryRAII::init();
+  }
 
   ThreadStates[mapping::getThreadIdInBlock()] = nullptr;
 }
Index: openmp/libomptarget/DeviceRTL/src/Debug.cpp
===================================================================
--- openmp/libomptarget/DeviceRTL/src/Debug.cpp
+++ openmp/libomptarget/DeviceRTL/src/Debug.cpp
@@ -55,7 +55,7 @@
 }
 
 /// Current indentation level for the function trace. Only accessed by thread 0.
-static uint32_t Level = 0;
+static uint32_t Level;
 #pragma omp allocate(Level) allocator(omp_pteam_mem_alloc)
 
 DebugEntryRAII::DebugEntryRAII(const char *File, const unsigned Line,
@@ -78,4 +78,6 @@
     Level--;
 }
 
+void DebugEntryRAII::init() { Level = 0; }
+
 #pragma omp end declare target
Index: openmp/libomptarget/DeviceRTL/include/Debug.h
===================================================================
--- openmp/libomptarget/DeviceRTL/include/Debug.h
+++ openmp/libomptarget/DeviceRTL/include/Debug.h
@@ -57,6 +57,8 @@
 struct DebugEntryRAII {
   DebugEntryRAII(const char *File, const unsigned Line, const char *Function);
   ~DebugEntryRAII();
+
+  static void init();
 };
 
 #endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113963.387582.patch
Type: text/x-patch
Size: 1562 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20211116/919ba9e5/attachment.bin>


More information about the Openmp-commits mailing list