SpikeGPU  1.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
spike::Solver< Array, PrecValueType > Class Template Reference

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 StatsgetStats () const
 Extract solver statistics. More...
 

Detailed Description

template<typename Array, typename PrecValueType>
class spike::Solver< Array, PrecValueType >

Main SPIKE::GPU solver.

This class is the public interface to the Spike-preconditioned Krylov iterative solver.

Template Parameters
Arrayis the array type for the linear system solution. (both cusp::array1d and cusp::array1d_view are valid).
PrecValueTypeis the floating point type used in the preconditioner (to support mixed-precision calculations).

Constructor & Destructor Documentation

template<typename Array , typename PrecValueType >
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.

template<typename Array , typename PrecValueType >
spike::Solver< Array, PrecValueType >::~Solver ( )

Spike solver destructor.

This is the destructor for the Solver class. It frees the preconditioner objects.

Member Function Documentation

template<typename Array , typename PrecValueType >
const Stats& spike::Solver< Array, PrecValueType >::getStats ( ) const
inline

Extract solver statistics.

template<typename Array , typename PrecValueType >
template<typename Matrix >
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).

Template Parameters
Matrixis the sparse matrix type used in the preconditioner.
template<typename Array , typename PrecValueType >
template<typename SpmvOperator >
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().

Template Parameters
SpmvOperatoris a functor class which implements the operator() to calculate sparse matrix-vector product. See spike::SpmvCusp for an example.
template<typename Array , typename PrecValueType >
template<typename Array1 >
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.

Template Parameters
Array1is the vector type for the non-zero entries of the updated matrix (both cusp::array1d and cusp::array1d_view are allowed).

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