@@ -9,8 +9,8 @@ Rust GPU kernel code and see the resulting PTX assembly.
99Compiler Explorer expects a single "compiler" binary that reads source on
1010stdin or from a file and writes assembly to stdout. Since rust-cuda has no
1111standalone compiler (the pipeline is ` rustc ` with a custom codegen backend
12- plus ` cargo ` for dependency resolution), the integration uses a wrapper
13- script that:
12+ plus ` cargo ` for dependency resolution), the integration uses a small Rust
13+ wrapper binary that:
1414
15151 . Accepts a ` .rs ` file containing ` #[kernel] ` functions.
16162 . Creates a temporary Cargo project that depends on ` cuda_std ` .
@@ -25,10 +25,10 @@ script that:
2525
2626| File | Purpose |
2727| ------| ---------|
28- | ` rust-cuda-wrapper.sh ` | The wrapper script CE invokes as the "compiler" |
28+ | ` rust-cuda-wrapper/ ` | Rust crate for the wrapper binary CE invokes as the "compiler" |
2929| ` rust-cuda.defaults.properties ` | CE configuration (compiler type, flags, defaults) |
3030| ` rust-cuda.amazon.properties ` | CE instance-specific overrides for the AWS fleet |
31- | ` install.sh ` | Installs the pinned nightly, builds the codegen backend, and lays out the prefix |
31+ | ` install.sh ` | Installs the pinned nightly, builds the codegen backend and the wrapper , and lays out the prefix |
3232| ` test-kernel.rs ` | Sample kernel with shared memory and thread indexing |
3333
3434## Supported flags
@@ -61,7 +61,7 @@ export CUDA_PATH=/usr/local/cuda
6161./contrib/godbolt/install.sh
6262
6363# Then test:
64- ./contrib/godbolt/ rust-cuda-wrapper.sh contrib/godbolt/test-kernel.rs
64+ $RUST_CUDA_ROOT /bin/ rust-cuda-wrapper contrib/godbolt/test-kernel.rs
6565```
6666
6767You should see PTX assembly printed to stdout.
@@ -73,8 +73,21 @@ point the wrapper at the repo tree directly:
7373
7474``` bash
7575export RUST_CUDA_ROOT=/path/to/rust-cuda
76- # Ensure lib/librustc_codegen_nvvm.so exists at that path, or adjust
77- # CODEGEN_SO in the script.
76+ # Ensure $RUST_CUDA_ROOT/lib/librustc_codegen_nvvm.so exists.
77+
78+ cd contrib/godbolt/rust-cuda-wrapper
79+ cargo run --release -- ../test-kernel.rs
80+ ```
81+
82+ ### Running the integration test
83+
84+ The wrapper crate ships a smoke test that compiles ` test-kernel.rs `
85+ end-to-end and asserts the output looks like PTX:
86+
87+ ``` bash
88+ cd contrib/godbolt/rust-cuda-wrapper
89+ cargo test # skips without RUST_CUDA_ROOT
90+ RUST_CUDA_ROOT=/path/to/rust-cuda cargo test # runs the real build
7891```
7992
8093## Submitting to Compiler Explorer
0 commit comments