Expand description
PTX backend.
Lowers Rust meta-HIR (functions annotated #[gpu_kernel(...)]) to
NVIDIA PTX text targeting sm_80+. Layer 5 compile contract:
contracts/compile-rust-to-ptx-mma-v1.yaml.
Architecture (PMAT-264 / Section 29): PtxBackend wraps a
MultiEmitterBackend so emission routes through the same
general/specialist quorum framework that will eventually carry
rustc_codegen_nvvm (general) + aprender-gpu (specialist). At
v0.1.0 the wrapper holds a single [ScaffoldPtxEmitter] in the
general slot — the same code path real emitters will plug into.
When rustc_codegen_nvvm lights up (next phase per
sub/layer5-multi-emitter-quorum.md), it slots into the general
position; when aprender-gpu ships its bridge, it slots into the
specialist position; no changes to PtxBackend’s public API.
Structs§
- PtxBackend
- PTX backend —
Backendimpl wrapping aMultiEmitterBackendso the v0.1.0 scaffold drives through the same routing the futurerustc_codegen_nvvm+aprender-gpuquorum will use.
Enums§
- PtxValidation
Error - Reasons emitted PTX text fails the
validate_ptxwell-formedness gate.
Functions§
- ptx_
looks_ real truewhentextlooks like real PTX (carries a.versiondirective) rather than the v0.1.0 scaffold comment placeholder.- ptxas_
arch - The
ptxas -arch=<…>value for a PTX.targetcompute capability — derived, never hard-coded (PMAT-481). Theptxasassemble step (free CI, wired with the real emitter in PMAT-485) uses this so the assembled arch always matches the emitted.target. - validate_
ptx - PMAT-481 — structural well-formedness check on emitted PTX text:
.version,.targetmatchingcompute_capability,.address_size 64, and at least one.visible .entry. Pure text — no GPU, noptxas. Gate onptx_looks_realfirst so the scaffold placeholder is not treated as real emission.