Module Sarek_codegen.Sarek_ir_cuda_coopmat_scale

CM_scale_add for the CUDA-C generator, which HIP shares (docs/design/coopmat-scaled-accumulate.md §3).

HIP gfx11. One call of the preamble's sarek_cm_scale_add template (Sarek_ir_cuda_coopmat_preamble), in registers: accumulator element e of lane l is row 2e + l / 16, column l mod 16, the layout the accumulator loads and stores already use. The template's flags are the statement's (col, offset, accumulate), so each instance has only the steps it needs. Non-contraction rests on hiprtc's -ffp-contract=off (Hip_rtc.base_options, appended after any caller option). A #pragma clang fp contract(off) in the helper would add no guard: clang's -ffp-contract=fast disregards that pragma (measured with hipcc for gfx1100: the helper with the pragma, under -ffp-contract=fast, has v_fma). Executed on an RX 7900 XTX, bit-identical to the interpreter (test_coopmat_scale_add_e2e, which also checks the ISA: no fused multiply-add under -ffp-contract=off, one under -ffp-contract=fast, so the check can fail).

CUDA. Refused with cuda_reason: a named #error in the CUDA arm of the shared source, as for the other CUDA-only gaps, and the CUDA probes report ds_scale_add = false so the launch gate refuses first.

module Codegen_error : sig ... end
val unsupported : string -> string -> 'a
val cuda_reason : string

Why neither CUDA lowering (the nvcuda::wmma arm here, and the wmma.* instructions of Sarek_ir_ptx_coopmat) emits CM_scale_add.

val cuda_error : string

The CUDA arm of a CM_scale_add.

val check_operands : dst_frag:Sarek_coopmat.fragment -> src_frag:Sarek_coopmat.fragment -> unit
val check_scale_buffer : buffers:(string * Sarek_ir_types.elttype) list -> Sarek_ir_types.coopmat_scale -> unit
val amd_call : buffers:(string * Sarek_ir_types.elttype) list -> expr_str:(Sarek_ir_types.expr -> string) -> dst:string -> dst_frag:Sarek_coopmat.fragment -> src:string -> src_frag:Sarek_coopmat.fragment -> row:Sarek_ir_types.coopmat_scale -> col:Sarek_ir_types.coopmat_scale option -> offset:Sarek_ir_types.coopmat_offset option -> accumulate:bool -> string

The HIP call: sarek_cm_scale_add<COL, OFF, ACC>(dst, src, r, (ri), c, (ci), p, (pi), q, (qi));, an absent scale passed as nullptr, 0.