mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
6268b9118e
Add checks for gpu-kernel calling conv The `gpu-kernel` calling convention has several restrictions that were not enforced by the compiler until now. Add the following restrictions: 1. Cannot be async 2. Cannot be called 3. Cannot return values, return type must be `()` or `!` 4. Arguments should be simple, i.e. passed by value. More complicated types can work when you know what you are doing, but it is rather unintuitive, one needs to know ABI/compiler internals. 5. Export name should be unmangled, either through `no_mangle` or `export_name`. Kernels are searched by name on the CPU side, having a mangled name makes it hard to find and probably almost always unintentional. Tracking issue: rust-lang/rust#135467 amdgpu target tracking issue: rust-lang/rust#135024 ``@workingjubilee,`` these should be all the restrictions we talked about a year ago. cc ``@RDambrosio016`` ``@kjetilkjeka`` for nvptx