Repository navigation
codegen: accept char in device-extern signatures - #1179
Conversation
Map Rust char to a plain i32 across parameter, result, and pointee positions. Extend device_ffi_test with a char parameter/return/pointer case and a dual sm_90/sm_100 IR gate that rejects extension attributes. This independently lands and credits the sound compiler change proposed by @NgoQuocViet2001 in #1049. Closes #875 Signed-off-by: nihalp <[email protected]>
Signed-off-by: nihalp <[email protected]>
Signed-off-by: nihalp <[email protected]>
|
Reproduced the gap, and @NgoQuocViet2001 had the compiler mapping right in #1049: Rust I landed it independently on this signed maintainer branch because the contributor fork does not allow maintainer edits. I kept the parameter/return example and added the pointer form plus a checked-in dual-path IR gate. The deliberate Exact head |
Closes #875.
This independently lands the sound ABI change proposed by @NgoQuocViet2001 in #1049 on a signed maintainer branch; the contributor fork does not allow maintainer edits.
Before, a
#[device] extern "C"taking or returning Rustcharwas rejected. After,charuses the same plain 32-bit slot as CUDA C++unsigned intin parameter, result, and pointee positions.The device-FFI example now exercises parameter, return, and pointer forms. Its checked-in shape gate builds both the legacy
sm_90and modernsm_100NVVM paths and rejectssignext/zeroext, which the functional round-trip alone cannot detect.Local checks: 27 rustc-codegen tests, strict clippy for the backend and example, formatting/SPDX/shell checks, and both exact NVVM-IR paths pass.