[llvm] [offload] add handling of memory alignment to MemoryManagerTy (PR #218418)
Piotr Balcer via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 26 05:16:48 PDT 2026
================
@@ -615,18 +615,6 @@ struct CUDADeviceTy : public GenericDeviceTy {
if (auto Err = Plugin::check(Res, "error in cuMemAlloc[Host|Managed]: %s"))
return std::move(Err);
- if (Alignment > 0 && !isAddrAligned(Align(Alignment), MemAlloc)) {
----------------
pbalcer wrote:
If we want to be strictly true to the cuda docs, we can only rely on guaranteed minimum alignment (256). However, in practice, this API should only be ever used for large page-sized allocations, with smaller allocations handled by the memory manager. If so, the right solution would be to use the virtual memory APIs here, to be guaranteed page alignment. But that's a larger change we could do in a follow-up patch.
https://github.com/llvm/llvm-project/pull/218418
More information about the llvm-commits
mailing list