Module Sarek_matrix_direct

The aligned size class of the matrix rewrite (specs/matrix-pattern-dynamic.md).

When the region is whole 32 x 32 tiles, the reduction a multiple of 16 and the operands float16 (each matrix row- or column-major), the fragments are loaded straight from global memory (as Sarek_gemm.Coopmat does) instead of being staged through shared memory: one wave per 32 x 32 tile, 2 x 2 fragments, waves waves per block, batches on grid y. Same arguments as Sarek_matrix_rewrite.kernel; same configuration as the staged float16 lowering, so the same opt-in applies.

val eligible : Sarek_matrix_pattern.gemm -> bool

The plan admits the variant: float16 operands (A, B and C each row- or column-major, loaded and stored in that layout), a float32 output stored as is, the accumulator starting from zero (from C it would update C in place through fragments, which the interpreter evaluates once per invocation: such a kernel is staged).

val fits : me:int -> ne:int -> k_extent:int -> d:int -> bool

The region admits it: me and ne multiples of 32, k_extent a multiple of 16, no quotient predicate (d = 0).

val waves_for : me:int -> ne:int -> int

2 when the number of wave tiles is even, else 1.

val launch_dims : me:int -> ne:int -> ze:int -> waves:int -> (int * int * int) * (int * int * int)
val kernel : Sarek_ir_types.kernel -> Sarek_matrix_pattern.gemm -> waves:int -> (Sarek_ir_types.kernel, string) Stdlib.result