summaryrefslogtreecommitdiff
path: root/openmp
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2022-01-31 11:47:19 -0500
committerJoseph Huber <jhuber6@vols.utk.edu>2022-01-31 15:19:48 -0500
commitfd5853dae6b9a49c8fea0acdc91093e5acd1ca58 (patch)
tree66275d37529902f51a336156dc6a8322a19f0301 /openmp
parent[x86] add tests for binop of select with identity constant; NFC (diff)
downloadllvm-project-fd5853dae6b9a49c8fea0acdc91093e5acd1ca58.tar.gz
llvm-project-fd5853dae6b9a49c8fea0acdc91093e5acd1ca58.tar.bz2
llvm-project-fd5853dae6b9a49c8fea0acdc91093e5acd1ca58.zip
[Libomptarget] Reduce shared memory stack size to 512 and a message when it is exceeded
Reduces the shared memory size used for globalization to 512 bytes from 2048 to reduce the pressure on shared memory. This patch ado adds a debug mesage to indicate when the shared memory was insufficient. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D118625
Diffstat (limited to 'openmp')
-rw-r--r--openmp/libomptarget/DeviceRTL/CMakeLists.txt2
-rw-r--r--openmp/libomptarget/DeviceRTL/src/State.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/openmp/libomptarget/DeviceRTL/CMakeLists.txt b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
index 2e52bdf4d90b..d8b9e40802b8 100644
--- a/openmp/libomptarget/DeviceRTL/CMakeLists.txt
+++ b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
@@ -122,7 +122,7 @@ set(src_files
${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
diff --git a/openmp/libomptarget/DeviceRTL/src/State.cpp b/openmp/libomptarget/DeviceRTL/src/State.cpp
index 754c7067faac..800176eb5eda 100644
--- a/openmp/libomptarget/DeviceRTL/src/State.cpp
+++ b/openmp/libomptarget/DeviceRTL/src/State.cpp
@@ -136,6 +136,9 @@ void *SharedMemorySmartStackTy::push(uint64_t Bytes) {
return Ptr;
}
+ if (config::isDebugMode(config::DebugKind::CommonIssues))
+ PRINT("Shared memory stack full, 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!");