Loading...
Searching...
No Matches
StdParBackend.h File Reference

Direct CBLAS/LAPACKE backend with C++17 parallel algorithms. More...

#include <cblas.h>
#include <lapacke.h>
#include <algorithm>
#include <cmath>
#include <execution>
#include <numeric>
#include "CovarianceEquilibration.h"
#include "ExactSchur.h"
#include "ExactSum.h"
#include "LocalExecutor.h"

Go to the source code of this file.

Namespaces

namespace  gpr
 Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
namespace  gpr::linalg
 Dense and structured linear algebra behind the GP: Cholesky and eigen solvers, linear operators, backend selection.

Functions

bool gpr::linalg::cholesky (const EigenMatrix &C, EigenMatrix &L)
 Cholesky decomposition (LAPACK equivalent: dpotrf).
Eigen::VectorXd gpr::linalg::forward_solve (const EigenMatrix &L, const Eigen::VectorXd &b)
 Forward triangular solve with vector RHS (BLAS equivalent: dtrsv).
Eigen::VectorXd gpr::linalg::back_solve (const EigenMatrix &L, const Eigen::VectorXd &b)
 Back triangular solve with vector RHS (BLAS equivalent: dtrsv).
EigenMatrix gpr::linalg::forward_solve_mat (const EigenMatrix &L, const EigenMatrix &B)
 Forward triangular solve with matrix RHS (BLAS equivalent: dtrsm).
EigenMatrix gpr::linalg::back_solve_mat (const EigenMatrix &L, const EigenMatrix &B)
 Back triangular solve with matrix RHS (BLAS equivalent: dtrsm with side=L, uplo=L, trans=T).
Eigen::VectorXd gpr::linalg::forward_solve_mat_colwise_squared_norm (const EigenMatrix &L, const EigenMatrix &B)
 Forward triangular solve followed by columnwise squared norms.
Eigen::VectorXd gpr::linalg::bordered_cholesky_diagonal (const EigenMatrix &L, const EigenMatrix &B, const Eigen::VectorXd &prior)
 Posterior diagonal from bordered Cholesky pivots.
EigenMatrix gpr::linalg::cholesky_inverse (const EigenMatrix &L)
 Symmetric inverse from Cholesky factor (LAPACK equivalent: dpotri).
double gpr::linalg::trace_product (const EigenMatrix &A, const EigenMatrix &B)
 Frobenius inner product / trace of matrix product.
double gpr::linalg::log_det_cholesky (const EigenMatrix &L)
 Half log-determinant from Cholesky factor.

Detailed Description

Direct CBLAS/LAPACKE backend with C++17 parallel algorithms.

Bypasses Eigen expression templates entirely for the 7 hot-path operations, calling CBLAS and LAPACKE routines directly on the raw column-major data pointers inside EigenMatrix.

The trace_product function uses std::transform_reduce with std::execution::par_unseq to demonstrate C++17 parallel STL usage. The remaining operations (Cholesky, triangular solves, inverse) are inherently dense linear algebra and delegate to LAPACKE/CBLAS, which are already internally threaded when backed by OpenBLAS or MKL.

Dependencies
  • CBLAS + LAPACKE (e.g. OpenBLAS, or system BLAS/LAPACK)
  • TBB (required by GCC's libstdc++ for std::execution::par_unseq)
Meson usage
meson setup builddir -Dlinalg_backend=stdpar

Definition in file StdParBackend.h.