#include <openclWellContributions.hpp>

Inheritance diagram for Opm::WellContributionsOCL< Scalar >:
Inheritance graph

Public Types

using UMFPackIndex = SuiteSparse_long
 

Public Member Functions

void setOpenCLEnv (cl::Context *context_, cl::CommandQueue *queue_)
 
void apply_stdwells (cl::Buffer d_x, cl::Buffer d_y)
 
void apply_mswells (cl::Buffer d_x, cl::Buffer d_y)
 
void apply (cl::Buffer d_x, cl::Buffer d_y)
 
unsigned int getNumWells ()
 
void addNumBlocks (unsigned int numBlocks)
 
void alloc ()
 Allocate memory for the StandardWells. More...
 
void setBlockSize (unsigned int dim, unsigned int dim_wells)
 
void setVectorSize (unsigned N)
 
void addMatrix (MatrixType type, int *colIndices, Scalar *values, unsigned int val_size)
 
void addMultisegmentWellContribution (unsigned int dim, unsigned int dim_wells, unsigned int Mb, std::vector< Scalar > &Bvalues, std::vector< unsigned int > &BcolIndices, std::vector< unsigned int > &BrowPointers, unsigned int DnumBlocks, Scalar *Dvalues, UMFPackIndex *DcolPointers, UMFPackIndex *DrowIndices, std::vector< Scalar > &Cvalues)
 

Static Public Member Functions

static std::unique_ptr< WellContributionscreate (const std::string &accelerator_mode, bool useWellConn)
 

Protected Types

using MatrixType = typename WellContributions< Scalar >::MatrixType
 

Protected Member Functions

void APIalloc () override
 Allocate memory for the StandardWells. More...
 
void APIaddMatrix (MatrixType type, int *colIndices, Scalar *values, unsigned int val_size) override
 Api specific upload of matrix. More...
 

Protected Attributes

cl::Context * context
 
cl::CommandQueue * queue
 
std::vector< cl::Event > events
 
std::unique_ptr< cl::Buffer > d_Cnnzs_ocl
 
std::unique_ptr< cl::Buffer > d_Dnnzs_ocl
 
std::unique_ptr< cl::Buffer > d_Bnnzs_ocl
 
std::unique_ptr< cl::Buffer > d_Ccols_ocl
 
std::unique_ptr< cl::Buffer > d_Bcols_ocl
 
std::unique_ptr< cl::Buffer > d_val_pointers_ocl
 
std::vector< Scalar > h_x
 
std::vector< Scalar > h_y
 
bool allocated = false
 
unsigned int N
 
unsigned int dim
 
unsigned int dim_wells
 
unsigned int num_blocks = 0
 
unsigned int num_std_wells = 0
 
unsigned int num_ms_wells = 0
 
unsigned int num_blocks_so_far = 0
 
unsigned int num_std_wells_so_far = 0
 
std::vector< unsigned int > val_pointers
 
std::vector< std::unique_ptr< MultisegmentWellContribution< Scalar > > > multisegments
 

Member Typedef Documentation

◆ MatrixType

template<class Scalar >
using Opm::WellContributionsOCL< Scalar >::MatrixType = typename WellContributions<Scalar>::MatrixType
protected

◆ UMFPackIndex

template<class Scalar >
using Opm::WellContributions< Scalar >::UMFPackIndex = SuiteSparse_long
inherited

Member Function Documentation

◆ addMatrix()

template<class Scalar >
void Opm::WellContributions< Scalar >::addMatrix ( MatrixType  type,
int *  colIndices,
Scalar *  values,
unsigned int  val_size 
)
inherited

Store a matrix in this object, in blocked csr format, can only be called after alloc() is called

Parameters
[in]typeindicate if C, D or B is sent
[in]colIndicescolumnindices of blocks in C or B, ignored for D
[in]valuesarray of nonzeroes
[in]val_sizenumber of blocks in C or B, ignored for D

◆ addMultisegmentWellContribution()

template<class Scalar >
void Opm::WellContributions< Scalar >::addMultisegmentWellContribution ( unsigned int  dim,
unsigned int  dim_wells,
unsigned int  Mb,
std::vector< Scalar > &  Bvalues,
std::vector< unsigned int > &  BcolIndices,
std::vector< unsigned int > &  BrowPointers,
unsigned int  DnumBlocks,
Scalar *  Dvalues,
UMFPackIndex DcolPointers,
UMFPackIndex DrowIndices,
std::vector< Scalar > &  Cvalues 
)
inherited

Add a MultisegmentWellContribution, actually creates an object on heap that is destroyed in the destructor Matrices C and B are passed in Blocked CSR, matrix D in CSC

Parameters
[in]dimsize of blocks in vectors x and y, equal to MultisegmentWell::numEq
[in]dim_wellssize of blocks of C, B and D, equal to MultisegmentWell::numWellEq
[in]Mbnumber of blockrows in C, B and D
[in]Bvaluesnonzero values of matrix B
[in]BcolIndicescolumnindices of blocks of matrix B
[in]BrowPointersrowpointers of matrix B
[in]DnumBlocksnumber of blocks in D
[in]Dvaluesnonzero values of matrix D
[in]DcolPointerscolumnpointers of matrix D
[in]DrowIndicesrowindices of matrix D
[in]Cvaluesnonzero values of matrix C

◆ addNumBlocks()

template<class Scalar >
void Opm::WellContributions< Scalar >::addNumBlocks ( unsigned int  numBlocks)
inherited

Indicate how large the next StandardWell is, this function cannot be called after alloc() is called

Parameters
[in]numBlocksnumber of blocks in C and B of next StandardWell

◆ alloc()

template<class Scalar >
void Opm::WellContributions< Scalar >::alloc ( )
inherited

Allocate memory for the StandardWells.

◆ APIaddMatrix()

template<class Scalar >
void Opm::WellContributionsOCL< Scalar >::APIaddMatrix ( MatrixType  ,
int *  ,
Scalar *  ,
unsigned int   
)
overrideprotectedvirtual

Api specific upload of matrix.

Reimplemented from Opm::WellContributions< Scalar >.

◆ APIalloc()

template<class Scalar >
void Opm::WellContributionsOCL< Scalar >::APIalloc ( )
overrideprotectedvirtual

Allocate memory for the StandardWells.

Reimplemented from Opm::WellContributions< Scalar >.

◆ apply()

template<class Scalar >
void Opm::WellContributionsOCL< Scalar >::apply ( cl::Buffer  d_x,
cl::Buffer  d_y 
)

◆ apply_mswells()

template<class Scalar >
void Opm::WellContributionsOCL< Scalar >::apply_mswells ( cl::Buffer  d_x,
cl::Buffer  d_y 
)

◆ apply_stdwells()

template<class Scalar >
void Opm::WellContributionsOCL< Scalar >::apply_stdwells ( cl::Buffer  d_x,
cl::Buffer  d_y 
)

◆ create()

template<class Scalar >
static std::unique_ptr< WellContributions > Opm::WellContributions< Scalar >::create ( const std::string &  accelerator_mode,
bool  useWellConn 
)
staticinherited

◆ getNumWells()

template<class Scalar >
unsigned int Opm::WellContributions< Scalar >::getNumWells ( )
inlineinherited

◆ setBlockSize()

template<class Scalar >
void Opm::WellContributions< Scalar >::setBlockSize ( unsigned int  dim,
unsigned int  dim_wells 
)
inherited

Indicate how large the blocks of the StandardWell (C and B) are

Parameters
[in]dimnumber of columns
[in]dim_wellsnumber of rows

◆ setOpenCLEnv()

template<class Scalar >
void Opm::WellContributionsOCL< Scalar >::setOpenCLEnv ( cl::Context *  context_,
cl::CommandQueue *  queue_ 
)

◆ setVectorSize()

template<class Scalar >
void Opm::WellContributions< Scalar >::setVectorSize ( unsigned  N)
inherited

Set size of vector that the wells are applied to

Parameters
[in]Nsize of vector

Member Data Documentation

◆ allocated

template<class Scalar >
bool Opm::WellContributions< Scalar >::allocated = false
protectedinherited

◆ context

template<class Scalar >
cl::Context* Opm::WellContributionsOCL< Scalar >::context
protected

◆ d_Bcols_ocl

template<class Scalar >
std::unique_ptr<cl::Buffer> Opm::WellContributionsOCL< Scalar >::d_Bcols_ocl
protected

◆ d_Bnnzs_ocl

template<class Scalar >
std::unique_ptr<cl::Buffer> Opm::WellContributionsOCL< Scalar >::d_Bnnzs_ocl
protected

◆ d_Ccols_ocl

template<class Scalar >
std::unique_ptr<cl::Buffer> Opm::WellContributionsOCL< Scalar >::d_Ccols_ocl
protected

◆ d_Cnnzs_ocl

template<class Scalar >
std::unique_ptr<cl::Buffer> Opm::WellContributionsOCL< Scalar >::d_Cnnzs_ocl
protected

◆ d_Dnnzs_ocl

template<class Scalar >
std::unique_ptr<cl::Buffer> Opm::WellContributionsOCL< Scalar >::d_Dnnzs_ocl
protected

◆ d_val_pointers_ocl

template<class Scalar >
std::unique_ptr<cl::Buffer> Opm::WellContributionsOCL< Scalar >::d_val_pointers_ocl
protected

◆ dim

template<class Scalar >
unsigned int Opm::WellContributions< Scalar >::dim
protectedinherited

◆ dim_wells

template<class Scalar >
unsigned int Opm::WellContributions< Scalar >::dim_wells
protectedinherited

◆ events

template<class Scalar >
std::vector<cl::Event> Opm::WellContributionsOCL< Scalar >::events
protected

◆ h_x

template<class Scalar >
std::vector<Scalar> Opm::WellContributionsOCL< Scalar >::h_x
protected

◆ h_y

template<class Scalar >
std::vector<Scalar> Opm::WellContributionsOCL< Scalar >::h_y
protected

◆ multisegments

template<class Scalar >
std::vector<std::unique_ptr<MultisegmentWellContribution<Scalar> > > Opm::WellContributions< Scalar >::multisegments
protectedinherited

◆ N

template<class Scalar >
unsigned int Opm::WellContributions< Scalar >::N
protectedinherited

◆ num_blocks

template<class Scalar >
unsigned int Opm::WellContributions< Scalar >::num_blocks = 0
protectedinherited

◆ num_blocks_so_far

template<class Scalar >
unsigned int Opm::WellContributions< Scalar >::num_blocks_so_far = 0
protectedinherited

◆ num_ms_wells

template<class Scalar >
unsigned int Opm::WellContributions< Scalar >::num_ms_wells = 0
protectedinherited

◆ num_std_wells

template<class Scalar >
unsigned int Opm::WellContributions< Scalar >::num_std_wells = 0
protectedinherited

◆ num_std_wells_so_far

template<class Scalar >
unsigned int Opm::WellContributions< Scalar >::num_std_wells_so_far = 0
protectedinherited

◆ queue

template<class Scalar >
cl::CommandQueue* Opm::WellContributionsOCL< Scalar >::queue
protected

◆ val_pointers

template<class Scalar >
std::vector<unsigned int> Opm::WellContributions< Scalar >::val_pointers
protectedinherited

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