[Openmp-commits] [openmp] 3219f1a - [OpenMP] Force initialization of global device environment

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Thu Jan 22 14:46:15 PST 2026


Author: Joseph Huber
Date: 2026-01-22T16:45:49-06:00
New Revision: 3219f1a5ce497125025ad8d27131cdea4b6e8595

URL: https://github.com/llvm/llvm-project/commit/3219f1a5ce497125025ad8d27131cdea4b6e8595
DIFF: https://github.com/llvm/llvm-project/commit/3219f1a5ce497125025ad8d27131cdea4b6e8595.diff

LOG: [OpenMP] Force initialization of global device environment

Summary:
This causes issues when we omit this, which requires a constructor from
an incompatible address space and bad things happen.

Added: 
    

Modified: 
    openmp/device/src/Configuration.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/device/src/Configuration.cpp b/openmp/device/src/Configuration.cpp
index 0c31c66ab2deb..bc2a5d7086671 100644
--- a/openmp/device/src/Configuration.cpp
+++ b/openmp/device/src/Configuration.cpp
@@ -28,8 +28,8 @@ using namespace ompx;
 // This variable should be visible to the plugin so we override the default
 // hidden visibility.
 [[gnu::used, gnu::retain, gnu::weak,
-  gnu::visibility(
-      "protected")]] Constant<DeviceEnvironmentTy> __omp_rtl_device_environment;
+  gnu::visibility("protected")]] Constant<DeviceEnvironmentTy>
+    __omp_rtl_device_environment{};
 
 uint32_t config::getAssumeTeamsOversubscription() {
   return __omp_rtl_assume_teams_oversubscription;


        


More information about the Openmp-commits mailing list