Skip to content

num::kernel::gemm

Defined in header <kernel/dense.hpp>

template <std::floating_point T>
void gemm(T *C, idx ldc, const T *A, idx lda, const T *B, idx ldb, T alpha, T beta,
          idx m, idx n, idx k, T *work) noexcept;  // (1)

template <std::floating_point T>
void gemm(T *C, idx ldc, const T *A, idx lda, const T *B, idx ldb, T alpha, T beta,
          idx m, idx n, idx k) noexcept;  // (2)

template <std::floating_point T>
void gemm(T *C, const T *A, const T *B, T alpha, T beta, idx m, idx n, idx k) noexcept;  // (3)

(1) Dense matrix product C <- alpha*A*B + beta*C, with row strides and caller-provided workspace.

A is m x k, B is k x n, C is m x n; work holds at least gemm_workspace<T>(m, n, k) elements. A, B, C and work must not overlap. See gemm_config for the blocking.

(2) Dense matrix product C <- alpha*A*B + beta*C, with row strides.

Packs through a per-thread static buffer (see detail::gemm_scratch); pass a workspace explicitly to keep the call free of any state.

(3) Undocumented.