[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:58 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)) {
----------------
311Volt wrote:

`Granularity` is queried using CUDA virtual memory API (`cuMemGetAllocationGranularity` - https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__VA.html#group__CUDA__VA) but AFAIK the value does not imply anything about pointers returned by the basic memory API (`cuMemAlloc` etc. https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM) so this check was actually not redundant.

If anything, it's the `Granularity` check that should be removed, looks like it's always been a bug for `allocate()` to even use that value in the first place

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


More information about the llvm-commits mailing list