Gyselalib++
 
Loading...
Searching...
No Matches
MatrixBatch< ExecSpace > Class Template Referenceabstract

MatrixBatch superclass for managing a collection of linear systems. More...

Inheritance diagram for MatrixBatch< ExecSpace >:
MatrixBatchCsr< Kokkos::DefaultExecutionSpace, MatrixBatchCsrSolver::CG > MatrixBatchCsr< ExecSpace, Solver > MatrixBatchEll< ExecSpace > MatrixBatchTridiag< ExecSpace >

Public Types

using BatchedRHS = Kokkos::View< double **, Kokkos::LayoutRight, ExecSpace >
 The type of a Kokkos::View storing batched right-hand sides. Second dimenion is batch dimension.
 

Public Member Functions

virtual ~MatrixBatch ()=default
 Destruct.
 
virtual void setup_solver ()=0
 Perform a pre-process operation on the solver.
 
virtual void solve (BatchedRHS b) const =0
 Solve the multiple right-hand sides linear problem Ax=b inplace.
 
std::size_t size () const
 Get the size of the square matrix corresponding to a single batch in one of its dimensions.
 
std::size_t batch_size () const
 Get the batch size of the linear problem.
 

Protected Member Functions

 MatrixBatch (const std::size_t batch_size, const std::size_t mat_size)
 The constructor for MatrixBatch class.
 

Detailed Description

template<typename ExecSpace>
class MatrixBatch< ExecSpace >

MatrixBatch superclass for managing a collection of linear systems.

The main assumption is that all matrices have the same size. It is also assumed that each matrix is used to solve one equation.

Classes inheriting from this class must manage other aspects: Sparsity: kind of storage (Dense, Ell, Csr, etc.) Kind of solver (direct, iterative) Preconditioners and factorizations

Template Parameters
ExecSpaceExecution space,needed by Kokkos for allocations and parallelism. The simplest choice is to follow Kokkos, for that: specify Kokkos::DefaultExecutionSpace

Constructor & Destructor Documentation

◆ MatrixBatch()

template<typename ExecSpace >
MatrixBatch< ExecSpace >::MatrixBatch ( const std::size_t  batch_size,
const std::size_t  mat_size 
)
inlineexplicitprotected

The constructor for MatrixBatch class.

Parameters
[in]batch_sizeNumber of linear systems to solve.
[in]mat_sizeCommon matrix size for all the systems.

Member Function Documentation

◆ setup_solver()

template<typename ExecSpace >
virtual void MatrixBatch< ExecSpace >::setup_solver ( )
pure virtual

Perform a pre-process operation on the solver.

Must be called after filling the matrix.

Implemented in MatrixBatchCsr< ExecSpace, Solver >, MatrixBatchCsr< Kokkos::DefaultExecutionSpace, MatrixBatchCsrSolver::CG >, MatrixBatchEll< ExecSpace >, and MatrixBatchTridiag< ExecSpace >.

◆ solve()

template<typename ExecSpace >
virtual void MatrixBatch< ExecSpace >::solve ( BatchedRHS  b) const
pure virtual

Solve the multiple right-hand sides linear problem Ax=b inplace.

Parameters
[in,out]bA 2D Kokkos::View storing the batched right-hand sides of the problem and receiving the corresponding solution.

Implemented in MatrixBatchCsr< ExecSpace, Solver >, MatrixBatchCsr< Kokkos::DefaultExecutionSpace, MatrixBatchCsrSolver::CG >, MatrixBatchEll< ExecSpace >, and MatrixBatchTridiag< ExecSpace >.

◆ size()

template<typename ExecSpace >
std::size_t MatrixBatch< ExecSpace >::size ( ) const
inline

Get the size of the square matrix corresponding to a single batch in one of its dimensions.

Returns
The size of the matrix in one of its dimensions.

◆ batch_size()

template<typename ExecSpace >
std::size_t MatrixBatch< ExecSpace >::batch_size ( ) const
inline

Get the batch size of the linear problem.

Returns
The batch size of the linear problem.

The documentation for this class was generated from the following file: