[Openmp-commits] [PATCH] D118625: [Libomptarget] Reduce shared memory stack size to 512 and a message when it is exceeded

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Jan 31 10:00:20 PST 2022


jhuber6 updated this revision to Diff 404586.
jhuber6 added a comment.

Being more specific.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118625

Files:
  openmp/libomptarget/DeviceRTL/CMakeLists.txt
  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
@@ -136,6 +136,9 @@
     return Ptr;
   }
 
+  if (config::isDebugMode(config::DebugKind::CommonIssues))
+    PRINT("Shared memory stack, fallback to dynamic allocation of global "
+          "memory will negatively impact performance.");
   void *GlobalMemory = memory::allocGlobal(
       AlignedBytes, "Slow path shared memory allocation, insufficient "
                     "shared memory stack memory!");
Index: openmp/libomptarget/DeviceRTL/CMakeLists.txt
===================================================================
--- openmp/libomptarget/DeviceRTL/CMakeLists.txt
+++ openmp/libomptarget/DeviceRTL/CMakeLists.txt
@@ -122,7 +122,7 @@
   ${source_directory}/Workshare.cpp
 )
 
-set(clang_opt_flags -O1 -mllvm -openmp-opt-disable -DSHARED_SCRATCHPAD_SIZE=2048)
+set(clang_opt_flags -O1 -mllvm -openmp-opt-disable -DSHARED_SCRATCHPAD_SIZE=512)
 set(link_opt_flags  -O1        -openmp-opt-disable)
 
 # Prepend -I to each list element


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118625.404586.patch
Type: text/x-patch
Size: 1160 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220131/48f36d2f/attachment.bin>


More information about the Openmp-commits mailing list