SpikeGPU
1.0.0
|
Main SPIKE::GPU solver. More...
#include <solver.h>
Public Member Functions | |
Solver (int numPartitions, const Options &opts) | |
Spike solver constructor. More... | |
~Solver () | |
Spike solver destructor. More... | |
template<typename Matrix > | |
bool | setup (const Matrix &A) |
Preconditioner setup. More... | |
template<typename Array1 > | |
bool | update (const Array1 &entries) |
Preconditioner update. More... | |
template<typename SpmvOperator > | |
bool | solve (SpmvOperator &spmv, const Array &b, Array &x) |
Linear system solve. More... | |
const Stats & | getStats () const |
Extract solver statistics. More... | |
Main SPIKE::GPU solver.
This class is the public interface to the Spike-preconditioned Krylov iterative solver.
Array | is the array type for the linear system solution. (both cusp::array1d and cusp::array1d_view are valid). |
PrecValueType | is the floating point type used in the preconditioner (to support mixed-precision calculations). |
spike::Solver< Array, PrecValueType >::Solver | ( | int | numPartitions, |
const Options & | opts | ||
) |
Spike solver constructor.
This is the constructor for the Solver class. It specifies the requested number of partitions and the set of solver options.
spike::Solver< Array, PrecValueType >::~Solver | ( | ) |
Spike solver destructor.
This is the destructor for the Solver class. It frees the preconditioner objects.
|
inline |
Extract solver statistics.
bool spike::Solver< Array, PrecValueType >::setup | ( | const Matrix & | A | ) |
Preconditioner setup.
This function performs the initial setup for the Spike solver. It prepares the preconditioner based on the specified matrix A (which may be the system matrix, or some approximation to it).
Matrix | is the sparse matrix type used in the preconditioner. |
bool spike::Solver< Array, PrecValueType >::solve | ( | SpmvOperator & | spmv, |
const Array & | b, | ||
Array & | x | ||
) |
Linear system solve.
This function solves the system Ax=b, for given matrix A and right-handside vector b.
An exception is throw if this call was not preceeded by a call to Solver::setup().
SpmvOperator | is a functor class which implements the operator() to calculate sparse matrix-vector product. See spike::SpmvCusp for an example. |
bool spike::Solver< Array, PrecValueType >::update | ( | const Array1 & | entries | ) |
Preconditioner update.
This function updates the Spike preconditioner assuming that the reordering information generated when the preconditioner was initially set up is still valid. The diagonal blocks and off-diagonal spike blocks are updates based on the provided matrix non-zero entries.
An exception is thrown if this call was not preceeded by a call to Solver::setup() or if reordering tracking was not enabled through the solver options.
Array1 | is the vector type for the non-zero entries of the updated matrix (both cusp::array1d and cusp::array1d_view are allowed). |