[Openmp-commits] [llvm] [openmp] [offload] Use HSA SVM for AMDGPU shared memory (PR #215801)
Robert Imschweiler via Openmp-commits
openmp-commits at lists.llvm.org
Wed Aug 12 09:00:42 PDT 2026
================
@@ -3024,9 +3191,63 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
return Plugin::success();
}
+ /// Fill \p TgtPtr with the given pattern on the host. Requires \p TgtPtr to
+ /// be host accessible.
+ Error dataFillHostImpl(void *TgtPtr, const void *PatternPtr,
----------------
ro-i wrote:
hsa_amd_memory_fill fails for SVM memory with HSA_STATUS_ERROR_INVALID_ALLOCATION. So, there needs to be some other path. That's the correctness part that requires some action.
And, afaict, the existing alternative is creating the memory pattern on the host and then copying it in a loop to the device until the whole size is filled. That would be madness and that's the performance part that should be covered directly here if we want to benefit from the SVM performance-wise, I think. (?)
(Other optimizations, such as prefetch, shall be reserved for potential future PRs, ofc.)
https://github.com/llvm/llvm-project/pull/215801
More information about the Openmp-commits
mailing list