Loading...
Searching...
No Matches
Opm::gpuistl::PreconditionerCPUMatrixToGPUMatrix< X, Y, CudaPreconditionerType, CPUMatrixType > Class Template Reference

Convert a CPU matrix to a GPU matrix and use a CUDA preconditioner on the GPU. More...

`#include <PreconditionerCPUMatrixToGPUMatrix.hpp>`

Inheritance diagram for Opm::gpuistl::PreconditionerCPUMatrixToGPUMatrix< X, Y, CudaPreconditionerType, CPUMatrixType >:

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

template<typename... Args>
| PreconditionerCPUMatrixToGPUMatrix (const CPUMatrixType &A, Args &&... args)
void | pre (X &x, Y &b) override
| Prepare the preconditioner.
void | apply (X &v, const Y &d) override
| Apply the preconditoner.
void | post (X &x) override
| Clean up.
Dune::SolverCategory::Category | category () const override
| Category of the preconditioner (see SolverCategory::Category).
void | update () override
| Copies the CPU matrix to the GPU matrix then calls the GPU preconditioner update function.
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 CPUMatrixType>
class Opm::gpuistl::PreconditionerCPUMatrixToGPUMatrix< X, Y, CudaPreconditionerType, CPUMatrixType >

Convert a CPU matrix to a GPU matrix and use a CUDA preconditioner on the GPU.

The use case is having a CPU matrix created by a CPU simulator being solved by a GPU BICGSTAB solver.

Template Parameters

  X | the domain type (should be on the GPU). Typicall a GpuVector
  Y | the range type (should be on the GPU). Typicall a GpuVector
  CudaPreconditionerType | the preconditioner taking GpuVector<real_type> as arguments to apply and expecting a GPU matrix as the first argument to its constructor.
  CPUMatrixType | the type of the CPU matrix. This is the type that will be copied to the GPU.

## Member Function Documentation

## apply()

template<class X, class Y, class CudaPreconditionerType, class CPUMatrixType>

void Opm::gpuistl::PreconditionerCPUMatrixToGPUMatrix< X, Y, CudaPreconditionerType, CPUMatrixType >::apply | ( | X & | v,
|  | const Y & | d )

inline override

Apply the preconditoner.

## hasPerfectUpdate()

template<class X, class Y, class CudaPreconditionerType, class CPUMatrixType>

virtual bool Opm::gpuistl::PreconditionerCPUMatrixToGPUMatrix< X, Y, CudaPreconditionerType, CPUMatrixType >::hasPerfectUpdate | ( |  | ) | const

inline override virtual

Implements Dune::PreconditionerWithUpdate< X, Y >.

## post()

template<class X, class Y, class CudaPreconditionerType, class CPUMatrixType>

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

inline override

Clean up.

Currently not supported.

## pre()

template<class X, class Y, class CudaPreconditionerType, class CPUMatrixType>

void Opm::gpuistl::PreconditionerCPUMatrixToGPUMatrix< X, Y, CudaPreconditionerType, CPUMatrixType >::pre | ( | X & | x,
|  | Y & | b )

inline override

Prepare the preconditioner.

Currently not supported.

## update()

template<class X, class Y, class CudaPreconditionerType, class CPUMatrixType>

void Opm::gpuistl::PreconditionerCPUMatrixToGPUMatrix< X, Y, CudaPreconditionerType, CPUMatrixType >::update | ( |  | ) |

inline override virtual

Copies the CPU matrix to the GPU matrix then calls the GPU preconditioner update function.

Implements Dune::PreconditionerWithUpdate< X, Y >.

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

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