You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 076eb5d
Browse filesBrowse the repository at this point in the historyBrowse files
Rollup merge of #162177 - Flakebi:amdgpu-kernel-cc, r=bjorn3
Properly implement the gpu-kernel ABI for amdgpu
Add support to pass structs, arrays and vectors to amdgpu kernels.
Scalars and vectors are taken by value, aggregates are passed by byref
pointers. Structs containing a single scalar/vector are handled like
a scalar.
Judging from clang tests, nvptx seems to do somewhat the same, just
using byval instead of byref: https://github.com/llvm/llvm-project/blob/e4e18dba3d77f4a3eea58bcc9ccae5a5498ede7c/clang/test/CodeGenCUDA/kernel-args.cu
I tested a couple of the lit test signatures on real hardware and it
seems to work fine. Given the relatively simple implementation, I hope
this amount of testing is enough (the C calling convention seems like
a worse fit for Rust’s current ABI code, it’s still giving me headaches).
This adds two members to `PassMode::Indirect`.
`address_space` specifies the address space of an on_stack/byval or
by_ref pointer argument.
`by_ref` translates to LLVM’s byref, which is similar to on_stack/byval,
however, there is no extra copy made, the pointer may not point to the
stack but can point to some other address space, and the passed argument
should not be modified.
Both are used by the amdgpu target to implement the `gpu-kernel`
ABI.
Tracking issue for the `gpu-kernel` ABI: #135467
Tracking issue for the amdgpu target: #135024
0 commit comments