summaryrefslogtreecommitdiff
path: root/offload/plugins-nextgen/common/src/PluginInterface.cpp
diff options
context:
space:
mode:
authorJoseph Huber <huberjn@outlook.com>2025-11-06 12:37:19 -0600
committerJoseph Huber <huberjn@outlook.com>2025-11-06 13:00:26 -0600
commitaaddd8d38aa06f096cdf5ebe0d36c8e2b9a63265 (patch)
tree9028fb571c9d8d91390afda1e024a2de9972e53b /offload/plugins-nextgen/common/src/PluginInterface.cpp
parentde2a86e5f0bdab3a09d91f4f8f57b06d3ff55b18 (diff)
[OpenMP] Fix tests relying on the heap size variable
Summary: I made that an unimplemented error, but forgot that it was used for this environment variable.
Diffstat (limited to 'offload/plugins-nextgen/common/src/PluginInterface.cpp')
-rw-r--r--offload/plugins-nextgen/common/src/PluginInterface.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/offload/plugins-nextgen/common/src/PluginInterface.cpp b/offload/plugins-nextgen/common/src/PluginInterface.cpp
index 3ed3cb1cc13b..ee2ecbcfd309 100644
--- a/offload/plugins-nextgen/common/src/PluginInterface.cpp
+++ b/offload/plugins-nextgen/common/src/PluginInterface.cpp
@@ -762,13 +762,15 @@ Error GenericDeviceTy::init(GenericPluginTy &Plugin) {
return StackSizeEnvarOrErr.takeError();
OMPX_TargetStackSize = std::move(*StackSizeEnvarOrErr);
- auto HeapSizeEnvarOrErr = UInt64Envar::create(
- "LIBOMPTARGET_HEAP_SIZE",
- [this](uint64_t &V) -> Error { return getDeviceHeapSize(V); },
- [this](uint64_t V) -> Error { return setDeviceHeapSize(V); });
- if (!HeapSizeEnvarOrErr)
- return HeapSizeEnvarOrErr.takeError();
- OMPX_TargetHeapSize = std::move(*HeapSizeEnvarOrErr);
+ if (hasDeviceHeapSize()) {
+ auto HeapSizeEnvarOrErr = UInt64Envar::create(
+ "LIBOMPTARGET_HEAP_SIZE",
+ [this](uint64_t &V) -> Error { return getDeviceHeapSize(V); },
+ [this](uint64_t V) -> Error { return setDeviceHeapSize(V); });
+ if (!HeapSizeEnvarOrErr)
+ return HeapSizeEnvarOrErr.takeError();
+ OMPX_TargetHeapSize = std::move(*HeapSizeEnvarOrErr);
+ }
// Update the maximum number of teams and threads after the device
// initialization sets the corresponding hardware limit.