|
opm-simulators
|
Convert a CPU matrix to a GPU matrix and use a CUDA preconditioner on the GPU. More...
#include <PreconditionerCPUMatrixToGPUMatrix.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 | |
| 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 () |
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.
| 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. |
|
inlineoverride |
Apply the preconditoner.
|
inlineoverridevirtual |
Implements Dune::PreconditionerWithUpdate< X, Y >.
|
inlineoverride |
Clean up.
Currently not supported.
|
inlineoverride |
Prepare the preconditioner.
Currently not supported.
|
inlineoverridevirtual |
Copies the CPU matrix to the GPU matrix then calls the GPU preconditioner update function.
Implements Dune::PreconditionerWithUpdate< X, Y >.