code wiki / _hdl_build / nx_ptx_emit.nx
nx_ptx_emit.nx
buildroot/runtime/_hdl_build/nx_ptx_emit.nx
about
nx_ptx_emit.nx -- the SEED of the sovereign PTX emitter: a NishiLang program (compiled by nx_cc) that GENERATES
dispatchable PTX text for an elementwise integer kernel, parameterized by OP. Not hand-written, not nvcc -- OUR
stack emits the GPU kernel. Writes emitted_vadd.ptx; the driver harness then launches it on the RTX 5080.
Proves nx_cc -> (program that emits) PTX -> GPU. Grow this into the nx_cc backend proper. license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 9 | const OP: i64 = 0 // 0=add.s32 1=mul.lo.s32 2=max.s32 |
functions
| 7 | func w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 11 | func emit_head(fd: i64) -> i64 calls 1: w |
| 17 | func emit_index(fd: i64) -> i64 calls 1: w |
| 23 | func emit_load(fd: i64) -> i64 calls 1: w |
| 29 | func emit_op(fd: i64) -> i64 calls 1: w |
| 35 | func emit_tail(fd: i64) -> i64 calls 1: w |
| 41 | func emit_gemm_head(fd: i64) -> i64 |
| 47 | func emit_gemm_idx(fd: i64) -> i64 |
| 54 | func emit_gemm_bounds(fd: i64) -> i64 |
| 60 | func emit_gemm_body(fd: i64) -> i64 |
| 68 | func main() -> i64 |