For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
matmul
def matmul[*, transpose_b: Bool = False, b_packed: Bool = False, elementwise_lambda_fn: Optional[def[dtype: DType, width: SIMDLength, *, alignment: Int = Int(1)](IndexList[Int(2)], SIMD[dtype, width]) capturing thin -> None] = None, saturated_vnni: Bool = False](c: TileTensor[Storage=c.Storage, linear_idx_type=c.linear_idx_type], a: TileTensor[Storage=a.Storage, linear_idx_type=a.linear_idx_type], b: TileTensor[Storage=b.Storage, linear_idx_type=b.linear_idx_type], kernel_type_m: Int, num_threads: Int = Int(-1), ctx: Optional[DeviceContext] = None)
TileTensor matmul dispatcher. Selects kernel type and delegates to _matmul_cpu_impl.
Parameters:
- βtranspose_b (
Bool): Whether the B operand is transposed (defaults toFalse). - βb_packed (
Bool): Whether B was pre-packed offline in the cache-friendly layout (defaults toFalse). - βelementwise_lambda_fn (
Optional[def[dtype: DType, width: SIMDLength, *, alignment: Int = Int(1)](IndexList[Int(2)], SIMD[dtype, width]) capturing thin -> None]): Optional elementwise epilogue applied to each output tile (defaults toNone). - βsaturated_vnni (
Bool): WhenTrue, uses the saturating x86 variant, which requires theaoperand to lie in[0, 127]; it saves instructions only on the AVX2 emulation path used when the target lacks VNNI (defaults toFalse).
Args:
- βc (
TileTensor[Storage=c.Storage, linear_idx_type=c.linear_idx_type]): Output matrix buffer accumulating the matmul result. - βa (
TileTensor[Storage=a.Storage, linear_idx_type=a.linear_idx_type]): Left operand of the matmul. - βb (
TileTensor[Storage=b.Storage, linear_idx_type=b.linear_idx_type]): Right operand of the matmul. - βkernel_type_m (
Int): M dimension used to select the kernel variant, or0if unknown. - βnum_threads (
Int): Number of worker threads to use (defaults to-1, which selects automatically). - βctx (
Optional[DeviceContext]): Device context governing parallelism (defaults toNone).