Structured kernel target #
Primitive operands are values, not computations. Bindings therefore fix the order of reads and arithmetic before CUDA rendering. Branches and loops retain their own blocks, so lowering cannot hoist a failing read out of a branch or reassociate a sequential accumulation.
The target evaluator specifies these blocks independently of the source evaluator. Its lowering theorem is about this representation, not NVIDIA's compiler or execution of rendered text.
An unsigned counter loop, stopping before count and at the first failed step.
The strict guard ensures that incrementing the counter cannot wrap, even when count is the
largest representable index. Starting at or beyond the bound leaves the accumulator unchanged.
Instances For
Constants and typed local variables, with no effects or arithmetic.
- scalar {α : Type} {Γ : List Ty} (value : α) : Atom α Γ Ty.scalar
- index {α : Type} {Γ : List Ty} (value : UInt64) : Atom α Γ Ty.index
- predicate {α : Type} {Γ : List Ty} (value : Bool) : Atom α Γ Ty.predicate
- var {α : Type} {Γ : List Ty} {t : Ty} (v : Var Γ t) : Atom α Γ t
Instances For
One primitive operation whose operands have already been evaluated.
- load {α : Type} {Γ : List Ty} (operand : Nat) (index : Atom α Γ Ty.index) : Primitive α Γ Ty.scalar
- binary {α : Type} {Γ : List Ty} (op : ScalarOp) (x y : Atom α Γ Ty.scalar) : Primitive α Γ Ty.scalar
- neg {α : Type} {Γ : List Ty} (x : Atom α Γ Ty.scalar) : Primitive α Γ Ty.scalar
- indexBinary {α : Type} {Γ : List Ty} (op : IndexOp) (x y : Atom α Γ Ty.index) : Primitive α Γ Ty.index
- compare {α : Type} {Γ : List Ty} (op : Compare) (x y : Atom α Γ Ty.scalar) : Primitive α Γ Ty.predicate
- indexCompare {α : Type} {Γ : List Ty} (op : Compare) (x y : Atom α Γ Ty.index) : Primitive α Γ Ty.predicate
Instances For
Scoped statement blocks. A binding finishes its value block before entering its body.
- result {α : Type} {Γ : List Ty} {t : Ty} (value : Atom α Γ t) : Block α Γ t
- compute {α : Type} {Γ : List Ty} {t : Ty} (operation : Primitive α Γ t) : Block α Γ t
- bind {α : Type} {Γ : List Ty} {s t : Ty} (value : Block α Γ s) (body : Block α (s :: Γ) t) : Block α Γ t
- branch {α : Type} {Γ : List Ty} {t : Ty} (p : Atom α Γ Ty.predicate) (yes no : Block α Γ t) : Block α Γ t
- loop {α : Type} {Γ : List Ty} (count : Atom α Γ Ty.index) (initial : Atom α Γ Ty.scalar) (body : Block α (Ty.scalar :: Ty.index :: Γ) Ty.scalar) : Block α Γ Ty.scalar
Instances For
Renaming cannot change primitive results or failed reads.
Lowering preserves results and failures without scalar associativity or field assumptions.