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 >:

## 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 ()

## 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

  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

## Constructor & Destructor Documentation

## PreconditionerAdapter()

template<class X, class Y, class CudaPreconditionerType>

Opm::gpuistl::PreconditionerAdapter< X, Y, CudaPreconditionerType >::PreconditionerAdapter | ( | std::shared_ptr< CudaPreconditionerType > | preconditioner | ) |

inline explicit

Constructor.

Constructor gets all parameters to operate the prec.

Parameters

  preconditioner | Preconditioner to use in adapter

## 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 )

inline override virtual

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 | ( |  | ) |

inline override virtual

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

inline override virtual

Implements Dune::PreconditionerWithUpdate< X, Y >.

## post()

template<class X, class Y, class CudaPreconditionerType>

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

inline override virtual

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 )

inline override virtual

Prepare the preconditioner.

Currently not supported.

## update()

template<class X, class Y, class CudaPreconditionerType>

virtual void Opm::gpuistl::PreconditionerAdapter< X, Y, CudaPreconditionerType >::update | ( |  | ) |

inline override virtual

Calls update on the underlying CUDA preconditioner.

Implements Dune::PreconditionerWithUpdate< X, Y >.

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

- opm/simulators/linalg/gpuistl/PreconditionerAdapter.hpp