MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
gemmt.hpp File Reference
#include <cassert>
#include <cstddef>
#include <limits>
#include <type_traits>
#include <utility>
#include <vector>
#include <mtl/concepts/scalar.hpp>
#include <mtl/concepts/matrix.hpp>
#include <mtl/concepts/vector.hpp>
#include <mtl/math/identity.hpp>
#include <mtl/math/accumulator_traits.hpp>
#include <mtl/detail/wrapping_arithmetic.hpp>
#include <mtl/interface/dispatch_traits.hpp>
#include <mtl/traits/is_expression.hpp>
#include <mtl/mat/dense2D.hpp>
#include <mtl/mat/parameter.hpp>
#include <mtl/mat/compressed2D.hpp>
#include <mtl/mat/view/transposed_view.hpp>
#include <mtl/operation/mult.hpp>
#include <mtl/operation/trans.hpp>

Classes

struct  mtl::detail::gemmt_strided< T >
 A dense operand as a base pointer and strides: X(i, j) == p[i*rs + j*cs]. More...

Namespaces

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

Typedefs

template<typename MC>
using mtl::detail::congruence_temp_t
 The intermediate T of a congruence: dense, C's element type and orientation.

Enumerations

enum class  mtl::uplo { mtl::lower , mtl::upper }
 Which triangle of a square matrix an operation forms or reads. More...
enum class  mtl::gemmt_fill { mtl::mirror , mtl::keep }
 What gemmt does with the triangle it does not form. More...

Functions

template<typename MC>
void mtl::detail::mirror_triangle (MC &C, uplo t)
 Copy the t triangle of the n x n matrix C across the diagonal.
template<typename Accumulator, typename Value, typename S, typename MC, typename Terms>
void mtl::detail::gemmt_triangle (const S &alpha, const S &beta, MC &C, uplo t, Terms terms)
 The generic triangle loop.
template<typename M>
auto mtl::detail::gemmt_describe (const M &X)
template<typename M>
auto mtl::detail::gemmt_describe_mut (M &X)
template<typename Accumulator = void, Scalar S, Matrix MA, Matrix MB, Matrix MC>
void mtl::gemmt (const S &alpha_in, const MA &A, const MB &B, const S &beta_in, MC &C, uplo t=uplo::lower, gemmt_fill fill=gemmt_fill::mirror)
 Triangular-output product: the t triangle of C = alpha*A*B + beta*C.
template<typename Accumulator = void, typename S, typename MT, typename MA, typename MC>
void mtl::detail::congruence_second (const S &alpha, const MT &T, const MA &A, const S &beta, MC &C)
 The second product of a congruence, C = alpha * T*A^T + beta*C, lower triangle mirrored.
template<typename Accumulator = void, Scalar S, Matrix MA, Matrix MP, Matrix MC>
void mtl::congruence (const S &alpha, const MA &A, const MP &P, const S &beta, MC &C)
 Congruence: C = alpha * A*P*A^T + beta*C, for a symmetric m x m result.
template<typename Accumulator = void, Scalar S, Matrix MA, Vector VR, Matrix MC>
requires (!Matrix<VR>)
void mtl::congruence (const S &alpha, const MA &A, const VR &r, const S &beta, MC &C)
 Congruence with a diagonal middle term: C = alpha * A*diag(r)*A^T + beta*C.
template<typename Accumulator = void, Matrix MA, Matrix MP, Matrix MC>
void mtl::congruence (const MA &A, const MP &P, MC &C)
 C = A*P*A^T.
template<typename Accumulator = void, Matrix MA, Vector VR, Matrix MC>
requires (!Matrix<VR>)
void mtl::congruence (const MA &A, const VR &r, MC &C)
 C = A*diag(r)*A^T.

Variables

template<typename M>
constexpr bool mtl::detail::is_transposed_view_v = false
template<typename M>
constexpr bool mtl::detail::is_transposed_view_v< mat::view::transposed_view< M > > = true
template<typename M>
constexpr bool mtl::detail::is_transposed_csr_v = false
template<typename V, typename P>
constexpr bool mtl::detail::is_transposed_csr_v< mat::view::transposed_view< mat::compressed2D< V, P > > > = true
template<typename Accumulator, typename MA, typename MB, typename MC>
constexpr bool mtl::detail::gemmt_dispatches_blas_v
 Whether gemmt<Accumulator>(alpha, A, B, beta, C) calls ?gemmt (for sizes that fit an int; with OpenBLAS, only for n <= gemmt_block – see gemmt_uses_blocked_v).
constexpr std::size_t mtl::detail::gemmt_block = 64
 Rows of the diagonal blocks of the blocked gemmt (#744).
template<typename M>
constexpr bool mtl::detail::gemmt_strided_dense_v
 Dense float/double with contiguous storage and an orientation: the operands the blocked gemmt describes by strides.
template<typename M>
constexpr bool mtl::detail::gemmt_strided_operand_v
template<typename Accumulator, typename MA, typename MB, typename MC>
constexpr bool mtl::detail::gemmt_uses_blocked_v
 Whether gemmt<Accumulator>(alpha, A, B, beta, C) takes the blocked path for n > gemmt_block (#744): wherever ?gemmt is not called, and with OpenBLAS in place of its dgemmt.