opm-simulators
Loading...
Searching...
No Matches
Opm::gpuistl::OpmGpuILU0< CPUMatrixT, X, Y, l > Class Template Reference

ILU0 preconditioner on the GPU. More...

#include <OpmGpuILU0.hpp>

Inheritance diagram for Opm::gpuistl::OpmGpuILU0< CPUMatrixT, X, Y, l >:
Dune::PreconditionerWithUpdate< X, Y >

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.
using GpuMatrix = GpuSparseMatrixWrapper<field_type>
 The GPU matrix type.
using FloatMat = GpuSparseMatrixWrapper<float>
 The Float matrix type for mixed precision.
using matrix_type = GpuMatrix
 The matrix type the preconditioner is for.

Public Member Functions

 OpmGpuILU0 (const GpuMatrix &gpuMatrix, const CPUMatrixT &cpuMatrix, bool splitMatrix, bool tuneKernels, int mixedPrecisionScheme)
 Constructor.
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
 Post processing.
Dune::SolverCategory::Category category () const override
 Category of the preconditioner (see SolverCategory::Category).
void update () final
 Updates the matrix data.
void reorderAndSplitMatrix (int moveThreadBlockSize)
 perform matrix splitting and reordering
void LUFactorizeMatrix (int factorizationThreadBlockSize)
 Compute LU factorization, and update the data of the reordered matrix.
void tuneThreadBlockSizes ()
 function that will experimentally tune the thread block sizes of the important cuda kernels
virtual bool hasPerfectUpdate () const override

Static Public Member Functions

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

Detailed Description

template<class CPUMatrixT, class X, class Y, int l = 1>
class Opm::gpuistl::OpmGpuILU0< CPUMatrixT, X, Y, l >

ILU0 preconditioner on the GPU.

Template Parameters
CPUMatrixTType of the matrix on the CPU
XType of the update
YType of the defect
lIgnored. Just there to have the same number of template arguments as other preconditioners.
Todo
Remove the reliance on CPUMatrix. We should be able to use the GPU matrix type directly.
Note
We assume X and Y are both GpuVector<real_type>, but we leave them as template arguments in case of future additions.

Constructor & Destructor Documentation

◆ OpmGpuILU0()

template<class CPUMatrixT, class X, class Y, int l = 1>
Opm::gpuistl::OpmGpuILU0< M, X, Y, l >::OpmGpuILU0 ( const GpuMatrix & gpuMatrix,
const CPUMatrixT & cpuMatrix,
bool splitMatrix,
bool tuneKernels,
int mixedPrecisionScheme )
explicit

Constructor.

Constructor gets all parameters to operate the prec.

Parameters
gpuMatrixThe GPU matrix to operate on.
cpuMatrixThe CPU matrix to operate on.
splitMatrixTrue to split matrix
tuneKernelsTrue to tune kernels
mixedPrecisionSchemeMixed precision scheme to use

Member Function Documentation

◆ hasPerfectUpdate()

template<class CPUMatrixT, class X, class Y, int l = 1>
virtual bool Opm::gpuistl::OpmGpuILU0< CPUMatrixT, X, Y, l >::hasPerfectUpdate ( ) const
inlineoverridevirtual

◆ post()

template<class M, class X, class Y, int l>
void Opm::gpuistl::OpmGpuILU0< M, X, Y, l >::post ( X & x)
override

Post processing.

Note
Does nothing at the moment

◆ pre()

template<class M, class X, class Y, int l>
void Opm::gpuistl::OpmGpuILU0< M, X, Y, l >::pre ( X & x,
Y & b )
override

Prepare the preconditioner.

Note
Does nothing at the time being.

◆ shouldCallPost()

template<class CPUMatrixT, class X, class Y, int l = 1>
constexpr bool Opm::gpuistl::OpmGpuILU0< CPUMatrixT, X, Y, l >::shouldCallPost ( )
inlinestaticconstexpr
Returns
false

◆ shouldCallPre()

template<class CPUMatrixT, class X, class Y, int l = 1>
constexpr bool Opm::gpuistl::OpmGpuILU0< CPUMatrixT, X, Y, l >::shouldCallPre ( )
inlinestaticconstexpr
Returns
false

◆ update()

template<class M, class X, class Y, int l>
void Opm::gpuistl::OpmGpuILU0< M, X, Y, l >::update ( )
finalvirtual

Updates the matrix data.

Implements Dune::PreconditionerWithUpdate< X, Y >.


The documentation for this class was generated from the following files:
  • opm/simulators/linalg/gpuistl/OpmGpuILU0.hpp
  • opm/simulators/linalg/gpuistl/OpmGpuILU0.cpp