My Project
Loading...
Searching...
No Matches
Opm::gpuistl::PreconditionerAdapter< X, Y, CudaPreconditionerType > Class Template Reference

Makes a CUDA preconditioner available to a CPU simulator. More...

#include <PreconditionerAdapter.hpp>

Inheritance diagram for Opm::gpuistl::PreconditionerAdapter< X, Y, CudaPreconditionerType >:
Dune::PreconditionerWithUpdate< X, Y > Opm::gpuistl::PreconditionerHolder< GpuVector< X::field_type >, GpuVector< Y::field_type > >

Public Types

using domain_type = X
 The domain type of the preconditioner.
 
using range_type = Y
 The range type of the preconditioner.
 
using field_type = typename X::field_type
 The field type of the preconditioner.
 

Public Member Functions

 PreconditionerAdapter (std::shared_ptr< CudaPreconditionerType > preconditioner)
 Constructor.
 
virtual void pre (X &x, Y &b) override
 Prepare the preconditioner.
 
virtual void apply (X &v, const Y &d) override
 Apply the preconditoner.
 
virtual void post (X &x) override
 Clean up.
 
Dune::SolverCategory::Category category () const override
 Category of the preconditioner (see SolverCategory::Category)
 
virtual void update () override
 Calls update on the underlying CUDA preconditioner.
 
virtual std::shared_ptr< Dune::PreconditionerWithUpdate< GpuVector< field_type >, GpuVector< field_type > > > getUnderlyingPreconditioner () override
 getUnderlyingPreconditioner gets the underlying preconditioner (preconditioner being held)
 
virtual bool hasPerfectUpdate () const override
 
- Public Member Functions inherited from Dune::PreconditionerWithUpdate< X, Y >
- Public Member Functions inherited from Opm::gpuistl::PreconditionerHolder< GpuVector< X::field_type >, GpuVector< Y::field_type > >

Static Public Member Functions

static constexpr bool shouldCallPre ()
 
static constexpr bool shouldCallPost ()
 

Detailed Description

template<class X, class Y, class CudaPreconditionerType>
class Opm::gpuistl::PreconditionerAdapter< X, Y, CudaPreconditionerType >

Makes a CUDA preconditioner available to a CPU simulator.

The use case for this adapter is to use a CUDA preconditioner during a linear solver that works on the CPU. The motivation for this is benchmarking new preconditioners on the GPU.

Template Parameters
Xthe domain type (should be on the CPU). Typicall a Dune::BlockVector
Ythe range type (should be on the CPU). Typicall a Dune::BlockVector
CudaPreconditionerTypethe preconditioner taking GpuVector<real_type> as arguments to apply

Constructor & Destructor Documentation

◆ PreconditionerAdapter()

template<class X , class Y , class CudaPreconditionerType >
Opm::gpuistl::PreconditionerAdapter< X, Y, CudaPreconditionerType >::PreconditionerAdapter ( std::shared_ptr< CudaPreconditionerType > preconditioner)
inlineexplicit

Constructor.

Constructor gets all parameters to operate the prec.

Parameters
AThe matrix to operate on.
wThe relaxation factor.

Member Function Documentation

◆ apply()

template<class X , class Y , class CudaPreconditionerType >
virtual void Opm::gpuistl::PreconditionerAdapter< X, Y, CudaPreconditionerType >::apply ( X & v,
const Y & d )
inlineoverridevirtual

Apply the preconditoner.

◆ getUnderlyingPreconditioner()

template<class X , class Y , class CudaPreconditionerType >
virtual std::shared_ptr< Dune::PreconditionerWithUpdate< GpuVector< field_type >, GpuVector< field_type > > > Opm::gpuistl::PreconditionerAdapter< X, Y, CudaPreconditionerType >::getUnderlyingPreconditioner ( )
inlineoverridevirtual

getUnderlyingPreconditioner gets the underlying preconditioner (preconditioner being held)

Implements Opm::gpuistl::PreconditionerHolder< GpuVector< X::field_type >, GpuVector< Y::field_type > >.

◆ hasPerfectUpdate()

template<class X , class Y , class CudaPreconditionerType >
virtual bool Opm::gpuistl::PreconditionerAdapter< X, Y, CudaPreconditionerType >::hasPerfectUpdate ( ) const
inlineoverridevirtual

◆ post()

template<class X , class Y , class CudaPreconditionerType >
virtual void Opm::gpuistl::PreconditionerAdapter< X, Y, CudaPreconditionerType >::post ( X & x)
inlineoverridevirtual

Clean up.

Currently not supported.

◆ pre()

template<class X , class Y , class CudaPreconditionerType >
virtual void Opm::gpuistl::PreconditionerAdapter< X, Y, CudaPreconditionerType >::pre ( X & x,
Y & b )
inlineoverridevirtual

Prepare the preconditioner.

Currently not supported.

◆ update()

template<class X , class Y , class CudaPreconditionerType >
virtual void Opm::gpuistl::PreconditionerAdapter< X, Y, CudaPreconditionerType >::update ( )
inlineoverridevirtual

Calls update on the underlying CUDA preconditioner.

Implements Dune::PreconditionerWithUpdate< X, Y >.


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