Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType > Class Template Referenceabstract

GPUSender is a wrapper class for classes which will implement copOwnerToAll This is implemented with the intention of creating communicators with generic GPUSender To hide implementation that will either use GPU aware MPI or not. More...

#include <CuOwnerOverlapCopy.hpp>

Inheritance diagram for Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >:
Inheritance graph

Public Types

using X = CuVector< field_type >
 

Public Member Functions

 GPUSender (const OwnerOverlapCopyCommunicationType &cpuOwnerOverlapCopy)
 
virtual void copyOwnerToAll (const X &source, X &dest) const =0
 copyOwnerToAll will copy source to the CPU, then call OwnerOverlapCopyCommunicationType::copyOwnerToAll on the copied data, and copy the result back to the GPU More...
 
virtual void initIndexSet () const =0
 
void project (X &x) const
 project will project x to the owned subspace More...
 
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...
 

Protected Attributes

std::once_flag m_initializedIndices
 
std::unique_ptr< CuVector< int > > m_indicesOwner
 
std::unique_ptr< CuVector< int > > m_indicesCopy
 
const OwnerOverlapCopyCommunicationType & m_cpuOwnerOverlapCopy
 

Detailed Description

template<class field_type, class OwnerOverlapCopyCommunicationType>
class Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >

GPUSender is a wrapper class for classes which will implement copOwnerToAll This is implemented with the intention of creating communicators with generic GPUSender To hide implementation that will either use GPU aware MPI or not.

Template Parameters
field_typeis float or double
OwnerOverlapCopyCommunicationTypeis typically a Dune::LinearOperator::communication_type

Member Typedef Documentation

◆ X

template<class field_type , class OwnerOverlapCopyCommunicationType >
using Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::X = CuVector<field_type>

Constructor & Destructor Documentation

◆ GPUSender()

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

Member Function Documentation

◆ copyOwnerToAll()

template<class field_type , class OwnerOverlapCopyCommunicationType >
virtual void Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::copyOwnerToAll ( const X source,
X dest 
) const
pure virtual

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

Implemented in Opm::cuistl::GPUObliviousMPISender< field_type, block_size, OwnerOverlapCopyCommunicationType >, and Opm::cuistl::GPUAwareMPISender< field_type, block_size, OwnerOverlapCopyCommunicationType >.

◆ dot()

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

◆ initIndexSet()

template<class field_type , class OwnerOverlapCopyCommunicationType >
virtual void Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::initIndexSet ( ) const
pure virtual

◆ norm()

template<class field_type , class OwnerOverlapCopyCommunicationType >
field_type Opm::cuistl::GPUSender< field_type, 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::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::dot().

◆ project()

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

Member Data Documentation

◆ m_cpuOwnerOverlapCopy

template<class field_type , class OwnerOverlapCopyCommunicationType >
const OwnerOverlapCopyCommunicationType& Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::m_cpuOwnerOverlapCopy
protected

◆ m_indicesCopy

template<class field_type , class OwnerOverlapCopyCommunicationType >
std::unique_ptr<CuVector<int> > Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::m_indicesCopy
mutableprotected

◆ m_indicesOwner

template<class field_type , class OwnerOverlapCopyCommunicationType >
std::unique_ptr<CuVector<int> > Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::m_indicesOwner
mutableprotected

◆ m_initializedIndices

template<class field_type , class OwnerOverlapCopyCommunicationType >
std::once_flag Opm::cuistl::GPUSender< field_type, OwnerOverlapCopyCommunicationType >::m_initializedIndices
mutableprotected

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