10#include <guanaqo/trace.hpp>
15template <
class T,
class Abi, micro_kernels::geqrf::KernelConfig Conf,
StorageOrder OA,
22 BATMAT_ASSERT(W.rows() == 0 || (W.cols() == 1 && W.rows() == A.cols()) ||
23 std::make_pair(W.rows(), W.cols()) ==
25 const index_t M = D.rows(), N = D.cols();
29 if (M == 0 || N == 0) [[unlikely]]
44 const index_t M = D.rows(), N = D.cols(), K = B.cols();
48 if (K == 0 && D.data() != A.data()) [[unlikely]]
50 if (M == 0 || N == 0 || K == 0) [[unlikely]]
69template <simdifiable VA, simdifiable VD, simdifiable VW>
71void geqrf(VA &&A, VD &&D, VW &&W) {
81template <simdifiable VD, simdifiable VW>
90template <simdifiable VA, simdifiable VD, simdifiable VB, simdifiable VW>
92void geqrf_apply(VA &&A, VD &&D, VB &&B, VW &&W,
bool transposed =
false) {
100template <simdifiable VD, simdifiable VB, simdifiable VW>
102void geqrf_apply(VD &&D, VB &&B, VW &&W,
bool transposed =
false) {
110template <simdifiable VA>
constexpr FlopCount geqrf_apply(index_t m, index_t n, index_t k)
Apply the Q factor of a QR factorization of an m×n matrix with m≥n to an m×k matrix.
constexpr FlopCount geqrf(index_t m, index_t n)
QR factorization of an m×n matrix with m≥n.
auto geqrf_size_W(VA &&A)
Get the size of the storage for the matrix W returned by geqrf(VA &&A, VD &&D, VW &&W).
void geqrf_apply(VA &&A, VD &&D, VB &&B, VW &&W, bool transposed=false)
Apply the Q factor from geqrf (represented by B and W) to a matrix A, storing either QA or QᵀA in D (...
void copy(VA &&A, VB &&B, Opts... opts)
B = A.
void geqrf(VA &&A, VD &&D, VW &&W)
QR factorization.
#define GUANAQO_TRACE_LINALG(name, gflops)
void geqrf_apply(view< const T, Abi, OA > A, view< T, Abi, OD > D, view< const T, Abi, OB > B, view< const T, Abi > W, bool transposed, bool reversed)
void geqrf(view< const T, Abi, OA > A, view< T, Abi, OD > D, view< T, Abi > W)
void geqrf_copy_register(view< const T, Abi, OA > A, view< T, Abi, OD > D, view< T, Abi > W) noexcept
Block hyperbolic Householder factorization update using register blocking.
constexpr std::pair< index_t, index_t > geqrf_W_size(view< T, Abi, OA > A)
void geqrf_apply_register(view< const T, Abi, OA > A, view< T, Abi, OD > D, view< const T, Abi, OB > B, view< const T, Abi > W, bool transposed, bool reversed) noexcept
Apply a block Householder transformation.
typename detail::simdified_abi< V >::type simdified_abi_t
constexpr bool simdify_compatible
constexpr auto simdify(simdifiable auto &&a) -> simdified_view_t< decltype(a)>
simd_view_types< std::remove_const_t< T >, Abi >::template view< T, Order > view