std1.0.0-beta-7 SafeC docs

std :: simd::gemm

Function std::sgemm

#include <std/simd/gemm.h> source · definition

int sgemm(
    int transA,
    int transB,
    unsigned long m,
    unsigned long n,
    unsigned long k,
    float alpha,
    []const float a,
    unsigned long lda,
    []const float b,
    unsigned long ldb,
    float beta,
    []float c,
    unsigned long ldc,
)

C = alpha * op(A) * op(B) + beta * C, where op(A) is m x k and op(B) is k x n, and op(X) = X, or X transposed when its trans flag is SGEMM_TRANS (then X is stored k x m / n x k). Matrices are row-major with leading dimensions lda / ldb / ldc (the stride between rows). beta == 0 overwrites C without reading it, so C may start uninitialized. Returns 1, or 0 (nothing computed) when a slice is too short for its dimensions or a leading dimension is smaller than its row.