[clang] [llvm] [mlir] [Offload] Rework offloading entry type to be more generic (PR #124018)

Jan Patrick Lehr via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 07:43:08 PST 2025


================
@@ -24,11 +24,24 @@ namespace offloading {
 /// This is the record of an object that just be registered with the offloading
 /// runtime.
 struct EntryTy {
+  /// Reserved bytes used to detect an older version of the struct, always zero.
+  uint64_t Reserved = 0x0;
+  /// The current version of the struct for runtime forward compatibility.
+  uint16_t Version = 0x1;
+  /// The expected consumer of this entry, e.g. CUDA or OpenMP.
+  uint16_t Kind;
+  /// Flags associated with the global.
+  uint32_t Flags;
+  /// The address of the global to be registered by the runtime.
   void *Address;
+  /// The name of the symbol in the device image.
   char *SymbolName;
-  size_t Size;
-  int32_t Flags;
-  int32_t Data;
+  /// The number of bytes the symbol takes, usually zero for functions.
----------------
jplehr wrote:

```suggestion
  /// The number of bytes the symbol takes, zero for functions.
```

usually? In which cases is this non-zero?

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


More information about the llvm-commits mailing list