Module Sarek_codegen.Sarek_ir_ptx_stmt

PTX statement emitter.

Translates Sarek IR statements to PTX instruction sequences. All emitters mutate buf and alloc as side effects.

val emit_stmt : Stdlib.Buffer.t -> Sarek_ir_ptx_types.reg_alloc -> Sarek_ir_ptx_types.env -> Sarek_ir_types.stmt -> unit

emit_stmt buf alloc env stmt emits PTX instructions for stmt into buf.

Raises Ptx_codegen_error for IR constructs not covered by the PTX backend (e.g. SMatch).

emit_assign buf alloc env lv e emits a PTX assignment for lvalue lv set to expression e. Handles scalar, array-element, and indirect array-element lvalues.