Opm::gpuistl::SolverAdapter< Operator, UnderlyingSolver, X > Class Template Reference

Wraps a CUDA solver to work with CPU data. More...

#include <SolverAdapter.hpp>

Inheritance diagram for Opm::gpuistl::SolverAdapter< Operator, UnderlyingSolver, X >:
Inheritance graph

Public Types

using XGPU = Opm::gpuistl::GpuVector< real_type >
 

Public Member Functions

template<class Comm >
 SolverAdapter (Operator &op, Dune::ScalarProduct< X > &sp, std::shared_ptr< Dune::Preconditioner< X, X > > prec, scalar_real_type reduction, int maxit, int verbose, const Comm &comm)
 constructor More...
 
virtual void apply (X &x, X &b, double reduction, Dune::InverseOperatorResult &res) override
 
virtual void apply (X &x, X &b, Dune::InverseOperatorResult &res) override
 

Static Public Attributes

static constexpr auto block_size = domain_type::block_type::dimension
 

Detailed Description

template<class Operator, template< class > class UnderlyingSolver, class X>
class Opm::gpuistl::SolverAdapter< Operator, UnderlyingSolver, X >

Wraps a CUDA solver to work with CPU data.

Template Parameters
Operatorthe Dune::LinearOperator to use
UnderlyingSolvera Dune solver like class, eg Dune::BiCGSTABSolver
Xthe outer type to use (eg. Dune::BlockVector<Dune::FieldVector<...>>)

Member Typedef Documentation

◆ XGPU

template<class Operator , template< class > class UnderlyingSolver, class X >
using Opm::gpuistl::SolverAdapter< Operator, UnderlyingSolver, X >::XGPU = Opm::gpuistl::GpuVector<real_type>

Constructor & Destructor Documentation

◆ SolverAdapter()

template<class Operator , template< class > class UnderlyingSolver, class X >
template<class Comm >
Opm::gpuistl::SolverAdapter< Operator, UnderlyingSolver, X >::SolverAdapter ( Operator &  op,
Dune::ScalarProduct< X > &  sp,
std::shared_ptr< Dune::Preconditioner< X, X > >  prec,
scalar_real_type  reduction,
int  maxit,
int  verbose,
const Comm comm 
)
inline

constructor

Parameters
opthe linear operator (assumed CPU, the output (matrix) of which will be converted to a GPU variant)
spthe scalar product (assumed CPU, this will be converted to a GPU variant)
reductionthe reduction factor passed to the iterative solver
maxitmaximum number of iterations for the linear solver
verboseverbosity level
commthe communication object. If this is Dune::Amg::SequentialInformation, we assume a serial setup

Member Function Documentation

◆ apply() [1/2]

template<class Operator , template< class > class UnderlyingSolver, class X >
virtual void Opm::gpuistl::SolverAdapter< Operator, UnderlyingSolver, X >::apply ( X &  x,
X &  b,
double  reduction,
Dune::InverseOperatorResult &  res 
)
inlineoverridevirtual

◆ apply() [2/2]

template<class Operator , template< class > class UnderlyingSolver, class X >
virtual void Opm::gpuistl::SolverAdapter< Operator, UnderlyingSolver, X >::apply ( X &  x,
X &  b,
Dune::InverseOperatorResult &  res 
)
inlineoverridevirtual

Member Data Documentation

◆ block_size

template<class Operator , template< class > class UnderlyingSolver, class X >
constexpr auto Opm::gpuistl::SolverAdapter< Operator, UnderlyingSolver, X >::block_size = domain_type::block_type::dimension
staticconstexpr

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