CUDA-C lowering of the compute-graph IR — the second backend in one pass (plan §4,
Phase 5). The sameComputeGraph that emit_graph_wgsl
lowers to WGSL is lowered here to CUDA-C by a CudaCLowerer, with no per-kernel.id
branches — both backends are just Lowerer impls walked by the one
lower_graph driver.
HLSL lowering of the portable compute-graph nodes (plan §4 / P7) — the fourth backend
the one lower_graph driver walks. HlslLowerer implements the same
Lowerer trait, emitting HLSL compute shaders for
the portable native kit (Elementwise/Reduce/Broadcast) with the same binding ABI +
math as the WGSL graph_ops kernels.
MSL (Metal) lowering of the portable compute-graph nodes (plan §4 / P7) — the third
backend the one lower_graph driver walks, after WGSL and CUDA-C. MslLowerer implements
the same Lowerer trait, emitting Metal for the
portable native kit (Elementwise/Reduce/Broadcast) — same binding ABI + math as the
WGSL graph_ops kernels, so a portable graph lowers to Metal with no per-id branch.
The CUDA-C Lowerer: walks a ComputeGraph and appends one CUDA-C kernel per node to
source. The mirror of the WGSL WgslDelegateLowerer/WgslGraphLowerer.
Raw WGSL source for the df64 (double-single) emulated-f64 GEMM. See the module
docs for the binding ABI and precision contract. The error-free-transform helpers
are transcribed verbatim — quick_two_sum/two_sum/two_prod and the
df_add/df_mul pair-arithmetic are subtle and must not be “simplified”.
Compile HLSL to SPIR-V with caching. On a cache hit, returns the stored
binary without invoking DXC. On a miss, calls the inner compiler and stores
the result.
Emit a complete CUDA-C module for a pure compute-graph — the CUDA-C analogue of
emit_graph_wgsl. A single-node graph produces one kernel
(compile + dispatch it with graph_cuda_entry); multi-node graphs concatenate the
per-node kernels (a device-side multi-node CUDA executor is a later deliverable — see the
module header).
Emit a complete WGSL module for a pure compute-graph (no backing KernelSpec) —
the native-node path (Reduce/Broadcast in Phase 2). A single-node graph produces one
kernel module; multi-node graph emission (per-node functions + a driver) is Phase 4.
The CUDA-C entry-point name a single-node graph lowers to (so a caller can compile +
dispatch the emitted source). Mirrors the per-node kernel chosen by CudaCLowerer.
Returns Err for op-classes without a CUDA-C lowering this phase.