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

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 03:35:35 PDT 2026


================
@@ -248,72 +260,102 @@ class MemoryManagerTy {
     if (Size == 0)
       return nullptr;
 
-    ODBG(OLDT_Alloc) << "MemoryManagerTy::allocate: size " << Size
+    size_t AllocationSize = Alignment > 0 ? (Size + Alignment - 1) : Size;
+
+    ODBG(OLDT_Alloc) << "MemoryManagerTy::allocate: requested memory " << Size
+                     << ", allocated:  " << AllocationSize
                      << " with host pointer " << HstPtr << ".";
 
     // If the size is greater than the threshold, allocate it directly from
     // device.
-    if (Size > SizeThreshold) {
-      ODBG(OLDT_Alloc) << Size << " is greater than the threshold "
+    if (AllocationSize > SizeThreshold) {
----------------
EuphoricThinking wrote:

Doesn't the test look for the exact wording to be checked?

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


More information about the llvm-commits mailing list