fn
sgemm
void sgemm(bool transA, bool transB, int M, int N, int K, float alpha, const float * A, int lda, const float * B, int ldb, float beta, float * C, int ldc)Single-precision general matrix multiply (GEMM).
Computes in row-major layout using
Accelerate's cblas_sgemm. Each transpose flag is mapped to the
corresponding CBLAS_TRANSPOSE enum (CblasNoTrans / CblasTrans)
at zero copy cost — the BLAS kernel selects an alternate inner loop for
transposed operands.
Math
References
BLAS Reference (Netlib), Accelerate.framework cblas_sgemm.
Parameters
transA, transBboolWhether or should be transposed before the multiply.
M, N, KintOutput is ; the contracted dimension is , so and (before optional transposition).
alpha, betafloatLinear-combination coefficients. Use for a pure multiply; nonzero enables fused accumulate-into-C.
A, Bconst float*Row-major operand buffers.
Cfloat*Row-major output buffer; updated in place when .
lda, ldb, ldcintLeading dimensions (row stride in elements) of , , .
Notes
Single-threaded on Apple Silicon for small/medium sizes; Accelerate dispatches to AMX (matrix coprocessor) for large GEMMs automatically.