MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
gemv.hpp File Reference
#include <cstddef>
#include <mtl/concepts/scalar.hpp>
#include <mtl/simd/algorithm.hpp>
#include <mtl/simd/batch.hpp>

Namespaces

namespace  mtl
namespace  mtl::detail
 mat*vec multiply into pre-allocated y: y = A * x.

Functions

template<typename T>
requires mtl::Scalar<T>
void mtl::detail::gemv_rowmajor (std::size_t m, std::size_t n, const T *A, std::size_t lda, const T *x, T *y)
 y[m] := A[m x n] * x[n], A row-major (rows contiguous, lda = n).
template<typename T>
requires mtl::Scalar<T>
void mtl::detail::gemv_colmajor (std::size_t m, std::size_t n, const T *A, std::size_t lda, const T *x, T *y)
 y[m] := A[m x n] * x[n], A col-major (columns contiguous, lda = m).
template<typename T>
requires mtl::Scalar<T>
void mtl::detail::gemv_panel (bool row_major, std::size_t ld, const T *A, std::size_t r0, std::size_t c0, std::size_t m, std::size_t k, const T *x, T *t)
 t[m] := A(r0 : r0+m, c0 : c0+k) * x[k] for a sub-panel of an n-column (row-major) or n-row (column-major) dense matrix at A: the off-diagonal panel of the blocked trmv and trsv (#747).

Variables

constexpr std::size_t mtl::detail::gemv_colmajor_columns = 2
 Columns the col-major gemv takes per pass over a strip of y (#804): four where the target has a fused multiply-add, two where fma is a separate multiply and add.
template<typename T>
constexpr std::size_t mtl::detail::gemv_colmajor_strip_rows
 Rows per strip of the col-major gemv: 64 KB of y, a whole number of batches (at least one).