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

Vocabulary of the swappable dense linear-algebra backend. More...

#include <cstddef>
#include <vector>
#include "../../backend/Macros.h"

Go to the source code of this file.

Classes

struct  gpr::linalg::ThreadBudget
struct  gpr::linalg::DistributedShape
struct  gpr::linalg::backend::EigenTag
struct  gpr::linalg::backend::CholmodTag
struct  gpr::linalg::backend::StdParTag
struct  gpr::linalg::backend::KokkosTag
struct  gpr::linalg::backend::CusolverTag
struct  gpr::linalg::backend::ScalapackTag
struct  gpr::linalg::backend::SlateTag
struct  gpr::linalg::BackendTraits< backend::EigenTag >
struct  gpr::linalg::BackendTraits< backend::CholmodTag >
struct  gpr::linalg::BackendTraits< backend::StdParTag >
struct  gpr::linalg::BackendTraits< backend::CusolverTag >
struct  gpr::linalg::BackendTraits< backend::ScalapackTag >
struct  gpr::linalg::BackendTraits< backend::SlateTag >
struct  gpr::linalg::TileView
struct  gpr::linalg::ConstTileView
struct  gpr::linalg::ProviderTraits
 Description of a distributed kernel provider. More...
class  gpr::linalg::DistributedKernelProvider

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.
namespace  gpr::linalg::backend

Enumerations

enum class  gpr::linalg::MemoryKind { gpr::linalg::Host , gpr::linalg::CudaDevice , gpr::linalg::HipDevice , gpr::linalg::SyclDevice }
enum class  gpr::linalg::ExecutionKind {
  gpr::linalg::Serial , gpr::linalg::HostThreads , gpr::linalg::Cuda , gpr::linalg::Hip ,
  gpr::linalg::Sycl
}
 Which units run the operation. More...
enum class  gpr::linalg::ArithmeticClass { gpr::linalg::Unconstrained , gpr::linalg::GridInvariant , gpr::linalg::SerialEqual }

Functions

constexpr bool gpr::linalg::hostAccessible (MemoryKind kind) noexcept
constexpr const char * gpr::linalg::memoryKindName (MemoryKind kind) noexcept
constexpr const char * gpr::linalg::executionKindName (ExecutionKind kind) noexcept
constexpr const char * gpr::linalg::arithmeticClassName (ArithmeticClass cls) noexcept
constexpr bool gpr::linalg::satisfies (ArithmeticClass provided, ArithmeticClass required) noexcept
 True when a provider of class provided meets the class required.

Detailed Description

Vocabulary of the swappable dense linear-algebra backend.

Three layers, each with its own seam:

  1. Local dense backend. One process, one execution space, one memory space. Eigen/LAPACK (default), Kokkos (Serial, OpenMP, CUDA, HIP), cuSOLVER, stdpar and CHOLMOD. The operation set is the free functions of gpr::linalg that Backend.h declares and the selected backend header defines. BackendTraits describes the selected backend, and Backend.h checks that it provides the whole set.
  2. Distributed layout and collectives. Process group, grid, descriptors, scatter and gather, the cached factor, and the ordered, exact and disjoint reductions. One implementation (DistributedState over MPI and BLACS). It owns the contract that every rank holds the same bits. A local backend answers the layout trivially: one rank, a 1 x 1 grid, reductions that return their input.
  3. Distributed kernel provider on that layout. ScaLAPACK, SLATE (host or devices) and the canonical reproducible tile kernels implement DistributedKernelProvider. The choice is made at run time, by the same selection as DistributedFactorization.

Nothing here changes arithmetic. The header holds declarations, traits and compile-time checks; the Eigen backend's numerics are untouched.

Contracts every provider keeps
  • Collective ordering. All ranks of a group issue the same sequence of provider calls. A provider does not skip a collective on one rank, for example on a cache hit.
  • Arithmetic class. A provider declares ArithmeticClass. A comparison of trajectories is valid only between providers whose classes satisfy the comparison asked for (see satisfies()).
  • Thread budget. Each provider is handed a ThreadBudget and spends no more than it. The nested BLAS team of a tile kernel counts inside it.
  • Wall accounting. Factor and solve kernels open a KernelWall scope, so the "GP kernel times" line does not depend on the provider.
  • Shape. Tile width and grid follow from the order N and the rank count. A provider whose arithmetic is grid-invariant fixes its tile order and does not vary the tile with N.

Definition in file BackendInterface.h.