mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-01 17:40:16 +00:00
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: 3a8affeef4/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).