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

Linear algebra abstraction layer for GPR hot-path operations. More...

#include <Eigen/Dense>
#include <concepts>
#include "../../backend/Macros.h"
#include "BackendInterface.h"
#include "CovarianceEquilibration.h"
#include "EigenBackend.h"
#include "CholeskyUpdate.h"
#include "DenseFactorTrace.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.

Concepts

concept  gpr::linalg::LocalDenseBackend

Typedefs

using gpr::linalg::ActiveBackend = backend::EigenTag
using gpr::linalg::ActiveBackendTraits = BackendTraits<ActiveBackend>

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

Linear algebra abstraction layer for GPR hot-path operations.

Declares 9 free functions in the gpr::linalg namespace that wrap every dense linear algebra call on the GPR critical path (Cholesky, triangular solves, inverse, trace-product, log-determinant). The concrete implementation is selected at compile time via the linalg_backend meson option, which sets one of:

Define Backend header Runtime
(none / default) EigenBackend.h Eigen (+ OpenBLAS)
GPR_LINALG_CHOLMOD CholmodBackend.h CHOLMOD + Eigen
GPR_LINALG_STDPAR StdParBackend.h CBLAS/LAPACKE+TBB
GPR_LINALG_KOKKOS KokkosBackend.h KokkosKernels
GPR_LINALG_CUSOLVER CusolverBackend.h cuSOLVER/cuBLAS
GPR_LINALG_SCALAPACK ScalapackBackend.h MPI + ScaLAPACK
GPR_LINALG_SLATE SlateBackend.h MPI + SLATE tiles

All backends operate on EigenMatrix (ColMajor) and Eigen::VectorXd — the data type used throughout the GPR core. Data movement depends on the backend and operation. Kokkos GPU paths copy Eigen buffers to device memory and back. cuSOLVER reuses device-buffer capacity, but its dense factor and solve functions upload the supplied Eigen operands for each call.

See also
EigenBackend.h, StdParBackend.h, KokkosBackend.h, CusolverBackend.h

Definition in file Backend.h.