[llvm] [AMDGPU] Split struct kernel arguments (PR #133786)
Yaxun Liu via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 23 11:10:58 PDT 2025
yxsamliu wrote:
> > > Another question is, does it affect explicit kernel launch via `hipLaunchKernelGGL` or even the lower level use via HSA?
> >
> >
> > No. The kernel signature does not change from the user pointer of view. It only needs HIP runtime change about laying out the kernel arg segment. It does not need HSA or firmware change.
>
> I mean, if users launch a kernel using HSA runtime instead of HIP (which is what OpenMP is doing), is it gonna break?
OpenMP does not seem to use explicit kernel args although it uses implicit kernel args https://github.com/llvm/llvm-project/blob/main/offload/plugins-nextgen/amdgpu/src/rtl.cpp#L3393 . Since it does not use explicit kernel args, it is not affected by this patch. Even if it decides to use explicit kernel args, based on the libomptarget code, it needs to layout kernel arguments from host into kernel argument segment as dictated by code object metadata, before passing the pointer to the kernel arg segment to HSA runtime, in a similar way as HIP runtime does. Therefore, as long as it correctly follow the code object metadata, it will be able to launch the kernel transformed by this pass correctly with HSA runtime.
https://github.com/llvm/llvm-project/pull/133786
More information about the llvm-commits
mailing list