[llvm] [offload] add handling of memory alignment to MemoryManagerTy (PR #218418)

Jan Trusiłło via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 03:36:57 PDT 2026


================
@@ -264,32 +281,55 @@ class MemoryManagerTy {
       ODBG(OLDT_Alloc) << "Got target pointer " << *TgtPtrOrErr
                        << ". Return directly.";
 
+      if (Alignment > 0 && !isAddrAligned(Align(Alignment), *TgtPtrOrErr)) {
+        auto AlignErr = make_error<StringError>(
+            "Allocated address is misaligned", inconvertibleErrorCode());
----------------
311Volt wrote:

It looks like alignment padding is not possible on this path and we still rely fully on `DeviceAllocator` to provide an aligned pointer, is this intentional?

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


More information about the llvm-commits mailing list