6#include <guanaqo/demangled-typename.hpp>
7#include <guanaqo/print.hpp>
8#include <batmat-version.h>
21 std::println(
"{:+<79}",
"");
22 std::println(
"batmat {} ({}:{})", BATMAT_VERSION, batmat_commit_hash, batmat_build_time);
23 std::println(
"{:+<79}",
"");
26 std::println(
"Supported dtypes and vector lengths:");
30 std::println(
"{:+<79}",
"");
33 static_assert(v != 0,
"No suitable vector length for real_t");
34 using batch_size = std::integral_constant<index_t, 4>;
35 constexpr auto storage_order = batmat::matrix::StorageOrder::ColMajor;
39 index_t n = 3, m = n + 5;
40 Mat C{{.rows = n, .cols = n}}, A{{.rows = n, .cols = m}};
42 std::mt19937 rng{12345};
43 std::uniform_real_distribution<real_t> uni{-1.0, 1.0};
44 std::ranges::generate(A, [&] {
return uni(rng); });
53 for (index_t l = 0; l < C.depth(); ++l) {
61 const auto eps = std::numeric_limits<real_t>::epsilon();
62 for (index_t l = 0; l < C.depth(); ++l)
63 for (index_t c = 0; c < C.cols(); ++c)
64 for (index_t r = c; r < C.rows(); ++r)
65 errors += std::abs(C(l, r, c) - L(l, r, c)) < 10 * eps ? 0 : 1;
std::string demangled_typename(const std::type_info &t)
std::ostream & print_python(std::ostream &os, std::span< T, E > x, std::string_view end="\n", bool squeeze=true)
void syrk(Structured< VA, SA > A, Structured< VD, SD > D, Opts... opts)
D = A Aᵀ with D symmetric.
void potrf(Structured< VC, SC > C, Structured< VD, SC > D, simdified_value_t< VC > regularization=0)
D = chol(C) with C symmetric, D triangular.
void fill(simdified_value_t< VB > a, VB &&B)
B = a.
constexpr auto triu(M &&m)
Upper-triangular view.
constexpr auto tril(M &&m)
Lower-triangular view.
struct batmat::matrix::uninitialized_t uninitialized
Tag type to indicate that memory should not be initialized.
Class for a batch of matrices that owns its storage.
constexpr auto foreach_dtype_vl(F &&f)
Call a given function f for all supported (dtype, VL) combinations.
constexpr index_t vl_at_most
The largest supported vector length for dtype DT that is less than or equal to VL.
Owning array of matrices, stored in an efficient batched format.