[llvm] [openmp] [offload] Pool host and shared allocations (PR #214754)
Robert Imschweiler via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 12 06:29:23 PDT 2026
================
@@ -4529,6 +4535,12 @@ Expected<void *> AMDGPUDeviceTy::allocate(size_t Size, void *,
// Enable all valid kernel agents to access the buffer.
if (auto Err = MemoryPool->enableAccess(Alloc, Size, Agents))
return std::move(Err);
+
+ // Register host / shared memory as pinned memory, so that transfers reading
+ // from it can take a device-accessible path.
+ if (Kind == TARGET_ALLOC_HOST || Kind == TARGET_ALLOC_SHARED)
+ if (auto Err = PinnedAllocs.registerHostBuffer(Alloc, Alloc, Size))
+ return std::move(Err);
----------------
ro-i wrote:
> Honestly, amd sharing this for host and shared is just wrong. That might be my fault because I think I just aliased them because we didn't have anything similar readily available at the time. But now that we have SVM we probably should actually use that.
this is something I'd like to handle separately, if possible, so that it doesn't block this stack. I already made a draft PR: https://github.com/llvm/llvm-project/pull/215801
https://github.com/llvm/llvm-project/pull/214754
More information about the llvm-commits
mailing list