skip to content
==> README.md <==
1# @ajax/mesh-rt-ptx
2
3mesh-rt's device primitives on NVIDIA GPUs, as inline PTX in C (`mesh/rt/ptx.h`): special registers
4(`%tid`, `%ctaid`, `%ntid`, `%smid`, `%globaltimer`, `%dynamic_smem_size`), system-scope loads and stores
5(acquire, release, relaxed), atomics (`atom.add/or/and/cas`, `red.add`), fences, `nanosleep`, warp
6shuffles and ballot, the warp and block barriers, the node's dynamic shared memory (`mesh_smem`), and
7`trap`. Every asm has a `"memory"` clobber, as Rust's `asm!` without `nomem` is a compiler barrier.
8
9The header is empty unless compiled for nvptx64 (`clang --target=nvptx64-nvidia-cuda`). Programs include
10`mesh/rt/prim.h` (@ajax/mesh-rt-prim), which picks this or the CPU simulator.
11
12- **Ported from:** alpha-rust-mesh `crates/mesh-rt/src/ptx.rs`, instruction for instruction.
13- **Tests:** every program under `programs/` compiles these into PTX in each test run; @ajax/mesh-prog-hello's
14  linked PTX is checked for its entry, `MESH_RT_ABI` and the float mode.
15- **Differences:** `rdf`/`wrf`, `shfl_idx_f` and `warp_sum` (target-neutral) live in @ajax/mesh-rt-prim.