MatrixBatch superclass for managing a collection of linear systems. More...
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. | |
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
ExecSpace | Execution space,needed by Kokkos for allocations and parallelism. The simplest choice is to follow Kokkos, for that: specify Kokkos::DefaultExecutionSpace |
|
inlineexplicitprotected |
The constructor for MatrixBatch class.
[in] | batch_size | Number of linear systems to solve. |
[in] | mat_size | Common matrix size for all the systems. |
|
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 >.
|
pure virtual |
Solve the multiple right-hand sides linear problem Ax=b inplace.
[in,out] | b | A 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 >.
|
inline |
Get the size of the square matrix corresponding to a single batch in one of its dimensions.
|
inline |
Get the batch size of the linear problem.