[clang] [llvm] [HIP] Support managed variables using the new driver (PR #123437)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 18 02:21:59 PST 2025


================
@@ -1221,12 +1221,31 @@ void CGNVCUDARuntime::createOffloadingEntries() {
              ? static_cast<int32_t>(llvm::offloading::OffloadGlobalNormalized)
              : 0);
     if (I.Flags.getKind() == DeviceVarFlags::Variable) {
-      llvm::offloading::emitOffloadingEntry(
-          M, I.Var, getDeviceSideName(I.D), VarSize,
-          (I.Flags.isManaged() ? llvm::offloading::OffloadGlobalManagedEntry
-                               : llvm::offloading::OffloadGlobalEntry) |
-              Flags,
-          /*Data=*/0, Section);
+      if (I.Flags.isManaged()) {
+        assert(I.Var->getName().ends_with(".managed") &&
+               "HIP managed variables not transformed");
+
----------------
arsenm wrote:

Add a todo about the format change to use one struct 

https://github.com/llvm/llvm-project/pull/123437


More information about the llvm-commits mailing list