9#include "../seq/impl.hpp"
12#ifdef NUMERICS_HAS_BLAS
17void warn_blas_unavailable() {
18#ifndef NUMERICS_HAS_BLAS
19 static bool warned =
false;
23 "[numerics] WARNING: Backend::blas requested but BLAS was not "
26 " Falling back to Backend::blocked (cache-blocked).\n"
27 " Install OpenBLAS and reconfigure: "
28 "apt install libopenblas-dev | brew install openblas\n");
37 warn_blas_unavailable();
38#ifdef NUMERICS_HAS_BLAS
39 cblas_dgemm(CblasRowMajor,
42 static_cast<int>(A.
rows()),
43 static_cast<int>(B.
cols()),
44 static_cast<int>(A.
cols()),
47 static_cast<int>(A.
cols()),
49 static_cast<int>(B.
cols()),
52 static_cast<int>(C.
cols()));
59 warn_blas_unavailable();
60#ifdef NUMERICS_HAS_BLAS
61 cblas_dgemv(CblasRowMajor,
63 static_cast<int>(A.
rows()),
64 static_cast<int>(A.
cols()),
67 static_cast<int>(A.
cols()),
79 warn_blas_unavailable();
80#ifdef NUMERICS_HAS_BLAS
81 cblas_dcopy(
static_cast<int>(A.
size()), A.
data(), 1, C.
data(), 1);
82 cblas_dscal(
static_cast<int>(C.
size()), alpha, C.
data(), 1);
constexpr idx rows() const noexcept
constexpr idx size() const noexcept
constexpr idx cols() const noexcept
Dense row-major matrix templated over scalar type T.
void matmul(const Matrix &A, const Matrix &B, Matrix &C)
void matadd(real alpha, const Matrix &A, real beta, const Matrix &B, Matrix &C)
void matvec(const Matrix &A, const Vector &x, Vector &y)
void matvec(const Matrix &A, const Vector &x, Vector &y)
void matmul_blocked(const Matrix &A, const Matrix &B, Matrix &C, idx block_size)
void matadd(real alpha, const Matrix &A, real beta, const Matrix &B, Matrix &C)
real beta(real a, real b)
B(a, b) – beta function.