|
| MatrixBatchEll (const int batch_size, const int mat_size, const int non_zeros_per_row, std::optional< int > max_iter=std::nullopt, std::optional< double > res_tol=std::nullopt, std::optional< bool > logger=std::nullopt) |
| The constructor for MatrixBatchEll class.
|
|
| MatrixBatchEll (Kokkos::View< int **, Kokkos::LayoutLeft, ExecSpace > cols_idx, Kokkos::View< double ***, Kokkos::LayoutStride, ExecSpace > batch_values, std::optional< int > max_iter=std::nullopt, std::optional< double > res_tol=std::nullopt, std::optional< bool > logger=std::nullopt) |
| Constructor for MatrixBatchEll class.
|
|
std::pair< Kokkos::View< int **, Kokkos::LayoutLeft, ExecSpace >, Kokkos::View< double ***, Kokkos::LayoutStride, ExecSpace > > | get_batch_ell () |
| A function to get information about values and indices for the whole batch.
|
|
double | get_ell_element (int batch_idx, int line_idx, int non_zero_col_idx) const |
| A getter function for a value located at a specified place.
|
|
void | set_ell_element (int batch_idx, int line_idx, int non_zero_col_idx, double aij) |
| A setter function to modify a value located at a specified place.
|
|
void | setup_solver () final |
| Perform a pre-process operation on the solver.
|
|
void | solve (BatchedRHS const b) const final |
| Solve the batched linear problem Ax=b.
|
|
double | norm (int batch_idx) const |
| A function returns the norm of a matrix located at batch_idx.
|
|
virtual | ~MatrixBatch ()=default |
| Destruct.
|
|
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.
|
|
template<class ExecSpace>
class MatrixBatchEll< ExecSpace >
Matrix class which is able to manage and solve a batch of sparse linear systems.
Executes on either CPU or GPU. It takes advantage of the sparse structure, and the only batched solver available in Ginkgo : Stabilized Bicg. The sparsity pattern is assumed to be the same for all matrices. ie the non-zero components are located at the same places for all matrices. This class uses the ELL storage format which needs two 1D arrays, one stores values the other column indices. The class returns these arrays (as Kokkos views) with the get_batch_idx_and_vals function, it is then possible to fill them outside the class. Tolerance and maximal number of iterations, which are parameters for the iterative solver, are set in the constructor. It is possibile to get convergence information by activating the logger at constructor call.
- Template Parameters
-
ExecSpace | Execution space,needed by Kokkos for allocations and parallelism. The simplest choice is to follow Kokkos, for that: specify Kokkos::DefaultExecutionSpace |
template<class ExecSpace >
Perform a pre-process operation on the solver.
Must be called after filling the matrix.
It uses parameters like maximum number of iterations and tolerance are used to instantiate a Ginkgo solver.
The stopping criterion is a reduction factor ||Ax-b||/||b||<tol with max_iter maximum iterations.
Implements MatrixBatch< ExecSpace >.