My Project
|
Makes a CUDA preconditioner available to a CPU simulator. More...
#include <PreconditionerAdapter.hpp>
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 |
Static Public Member Functions | |
static constexpr bool | shouldCallPre () |
static constexpr bool | shouldCallPost () |
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.
X | the domain type (should be on the CPU). Typicall a Dune::BlockVector |
Y | the range type (should be on the CPU). Typicall a Dune::BlockVector |
CudaPreconditionerType | the preconditioner taking GpuVector<real_type> as arguments to apply |
|
inlineexplicit |
Constructor.
Constructor gets all parameters to operate the prec.
A | The matrix to operate on. |
w | The relaxation factor. |
|
inlineoverridevirtual |
Apply the preconditoner.
|
inlineoverridevirtual |
getUnderlyingPreconditioner gets the underlying preconditioner (preconditioner being held)
Implements Opm::gpuistl::PreconditionerHolder< GpuVector< X::field_type >, GpuVector< Y::field_type > >.
|
inlineoverridevirtual |
Implements Dune::PreconditionerWithUpdate< X, Y >.
|
inlineoverridevirtual |
Clean up.
Currently not supported.
|
inlineoverridevirtual |
Prepare the preconditioner.
Currently not supported.
|
inlineoverridevirtual |
Calls update on the underlying CUDA preconditioner.
Implements Dune::PreconditionerWithUpdate< X, Y >.