4#include <batmat/config.hpp>
24 return {.fma = a.
fma + b.
fma,
38constexpr FlopCount gemm(index_t m, index_t n, index_t k) {
return {.fma = m * k * n}; }
56 return {.fma = k * (k + 1) / 2 * n + (m - k) * k * n};
63 return {.fma = m * (m + 1) / 2 * n + (k - m) * (k - m) * n};
65 return {.fma = m * k * n};
72 return {.fma = k * (k + 1) / 2 * m + (n - k) * k * m};
74 return {.fma = n * (n + 1) / 2 * m + (k - n) * (k - n) * m};
81 return {.fma = m * (m + 1) / 2 * k};
89 return {.fma = m * (m + 1) * (m + 2) / 6};
105 return trmm(m, n, k, sA, sB, sC);
124 return trmm(m, n, k, sA, sB, sC) +
FlopCount{.mul = std::min(m, n) * k};
134 .fma = (n + 1) * n * (n - 1) / 6
135 + (m - n) * n * (n - 1) / 2,
136 .mul = n * (n - 1) / 2
149 .fma = k * n * n + 2 * n,
150 .mul = k * n + (n + 1) * n / 2 + n,
151 .add = (n + 1) * n / 2 + n,
163 .fma = 2 * nr * k * nc,
184 return potrf(m, n) +
FlopCount{.fma = n * (n + 1) * k / 2 + (m - n) * n * k};
192 return {.fma = m * (m - 1) * n / 2, .mul = m * n, .div = m};
200 return {.fma = (m + 1) * m * (m - 1) / 6, .div = m};
#define BATMAT_ASSUME(x)
Invokes undefined behavior if the expression x does not evaluate to true.
constexpr FlopCount hyh(index_t nr, index_t nc, index_t k)
Hyperbolic Householder factorization update with L nr×nc and A nr×k.
constexpr FlopCount gemmt_diag(index_t m, index_t n, index_t k, MatrixStructure sC)
Matrix-matrix multiplication of m×k and k×n matrices with a diagonal k×k matrix in the middle,...
constexpr index_t total(FlopCount c)
Compute the total number of floating point operations by summing the counts of all operation types.
constexpr FlopCount syrk_potrf(index_t m, index_t n, index_t k)
Fused symmetric rank-k update and Cholesky factorization of an m×n matrix with m≥n.
constexpr FlopCount hyh_square(index_t n, index_t k)
Hyperbolic Householder factorization update with L n×n and A nr×k.
constexpr FlopCount trtri(index_t m)
Triangular inversion of an m×m matrix.
constexpr FlopCount gemm(index_t m, index_t n, index_t k)
Matrix-matrix multiplication of m×k and k×n matrices.
constexpr FlopCount trmm(index_t m, index_t n, index_t k, MatrixStructure sA, MatrixStructure sB, MatrixStructure sC)
Matrix-matrix multiplication of m×k and k×n matrices where one or more of the matrices are triangular...
constexpr FlopCount operator+(FlopCount a, FlopCount b)
Combine two flop counts by summing the counts of each operation type.
constexpr FlopCount potrf(index_t m, index_t n)
Cholesky factorization and triangular solve for an m×n matrix with m≥n.
constexpr FlopCount hyh_apply(index_t nr, index_t nc, index_t k)
Hyperbolic Householder factorization application to L2 nr×nc and A2 nr×k.
constexpr FlopCount trsm(index_t m, index_t n)
Triangular solve of m×n matrices.
constexpr FlopCount syrk(index_t n, index_t k)
Symmetric rank-k update of n×n matrices.
constexpr FlopCount gemmt(index_t m, index_t n, index_t k, MatrixStructure sA, MatrixStructure sB, MatrixStructure sC)
Matrix-matrix multiplication of m×k and k×n matrices where the result is symmetric.
Count of individual floating point operations, broken down by type.
constexpr MatrixStructure transpose(MatrixStructure s)