Opm::cuistl::CuOwnerOverlapCopy< field_type, block_size, OwnerOverlapCopyCommunicationType > Class Template Reference

CUDA compatiable variant of Dune::OwnerOverlapCopyCommunication. More...

#include <CuOwnerOverlapCopy.hpp>

Public Types

using X = CuVector< field_type >
 

Public Member Functions

 CuOwnerOverlapCopy (const OwnerOverlapCopyCommunicationType &cpuOwnerOverlapCopy)
 
void dot (const X &x, const X &y, field_type &output) const
 dot will carry out the dot product between x and y on the owned indices, then sum up the result across MPI processes. More...
 
field_type norm (const X &x) const
 norm computes the l^2-norm of x across processes. More...
 
void project (X &x) const
 project will project x to the owned subspace More...
 
void copyOwnerToAll (const X &source, X &dest) const
 copyOwnerToAll will copy source to the CPU, then call OwnerOverlapCopyCommunicationType::copyOwnerToAll on the copied data, and copy the result back to the GPU More...
 

Detailed Description

template<class field_type, int block_size, class OwnerOverlapCopyCommunicationType>
class Opm::cuistl::CuOwnerOverlapCopy< field_type, block_size, OwnerOverlapCopyCommunicationType >

CUDA compatiable variant of Dune::OwnerOverlapCopyCommunication.

This class can essentially be seen as an adapter around Dune::OwnerOverlapCopyCommunication, and should work as a Dune::OwnerOverlapCopyCommunication on CuVectors

Note
This currently only has the functionality to parallelize the linear solve.
Template Parameters
field_typeshould be a field_type supported by CuVector (double, float)
block_sizethe block size used (this is relevant for say figuring out the correct indices)
OwnerOverlapCopyCommunicationTypeshould mimic Dune::OwnerOverlapCopyCommunication.

Member Typedef Documentation

◆ X

template<class field_type , int block_size, class OwnerOverlapCopyCommunicationType >
using Opm::cuistl::CuOwnerOverlapCopy< field_type, block_size, OwnerOverlapCopyCommunicationType >::X = CuVector<field_type>

Constructor & Destructor Documentation

◆ CuOwnerOverlapCopy()

template<class field_type , int block_size, class OwnerOverlapCopyCommunicationType >
Opm::cuistl::CuOwnerOverlapCopy< field_type, block_size, OwnerOverlapCopyCommunicationType >::CuOwnerOverlapCopy ( const OwnerOverlapCopyCommunicationType &  cpuOwnerOverlapCopy)
inline

Member Function Documentation

◆ copyOwnerToAll()

template<class field_type , int block_size, class OwnerOverlapCopyCommunicationType >
void Opm::cuistl::CuOwnerOverlapCopy< field_type, block_size, OwnerOverlapCopyCommunicationType >::copyOwnerToAll ( const X source,
X dest 
) const
inline

copyOwnerToAll will copy source to the CPU, then call OwnerOverlapCopyCommunicationType::copyOwnerToAll on the copied data, and copy the result back to the GPU

Parameters
[in]source
[out]dest

◆ dot()

template<class field_type , int block_size, class OwnerOverlapCopyCommunicationType >
void Opm::cuistl::CuOwnerOverlapCopy< field_type, block_size, OwnerOverlapCopyCommunicationType >::dot ( const X x,
const X y,
field_type &  output 
) const
inline

dot will carry out the dot product between x and y on the owned indices, then sum up the result across MPI processes.

Parameters
[out]outputresult will be stored here
Note
This uses the same interface as its DUNE equivalent.

Referenced by Opm::cuistl::CuOwnerOverlapCopy< field_type, block_size, OwnerOverlapCopyCommunicationType >::norm().

◆ norm()

template<class field_type , int block_size, class OwnerOverlapCopyCommunicationType >
field_type Opm::cuistl::CuOwnerOverlapCopy< field_type, block_size, OwnerOverlapCopyCommunicationType >::norm ( const X x) const
inline

norm computes the l^2-norm of x across processes.

This will compute the dot product of x with itself on owned indices, then sum the result across process and return the square root of the sum.

References Opm::cuistl::CuOwnerOverlapCopy< field_type, block_size, OwnerOverlapCopyCommunicationType >::dot().

◆ project()

template<class field_type , int block_size, class OwnerOverlapCopyCommunicationType >
void Opm::cuistl::CuOwnerOverlapCopy< field_type, block_size, OwnerOverlapCopyCommunicationType >::project ( X x) const
inline

project will project x to the owned subspace

For each component i which is not owned, x_i will be set to 0

Parameters
[in,out]xthe vector to project

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