cuda-oxide is a Rust-to-CUDA compiler that lets you write GPU kernels in safe, idiomatic Rust and compile them directly to PTX without DSLs or foreign language bindings.
The tool solves the problem of writing CUDA kernels while staying within the Rust ecosystem and type system. It works by implementing a custom rustc backend that compiles functions marked with `#[kernel]` to CUDA PTX. The compilation pipeline converts Rust code through Rust MIR to a Pliron IR framework, then to LLVM IR, and finally to PTX. The project enables single-source compilation where host and device code live in the same file and build together with a single `cargo oxide build` command. Device-side abstractions include type-safe indexing, shared memory, scoped atomics, barriers, TMA operations, and warp and cluster operations. Kernel policies can be defined at compile time to create separate tuned specializations without runtime overhead. The host-side runtime handles memory management, pinned host transfers, and kernel launching through both synchronous and asynchronous interfaces.
Developers should adopt this tool if they want to write GPU kernels in pure Rust without learning CUDA C++ or managing separate compilation pipelines. It suits projects where the Rust ecosystem and type safety are priorities and where kernels can be expressed in idiomatic Rust. The project is in early alpha stage, so adopters should expect bugs, incomplete features, and API changes as development continues. The tool supports both checked and unchecked kernel launches, with the latter requiring unsafe code to prove correctness of launch dimensions and resources.
The project maintains active continuous integration for both the main codebase and example compilation. Development activity includes regular updates to the codebase and ongoing refinement of the API surface. The maintainers actively solicit community feedback and contributions to shape the project's direction.