Peano 4
Loading...
Searching...
No Matches
exahype2::CellData Struct Reference

Representation of a number of cells which contains all information that's required to process the stored patches or polynomial shape functions (given you know the semantics of the data). More...

#include <CellData.h>

Collaboration diagram for exahype2::CellData:

Public Member Functions

 CellData (double *QIn, const tarch::la::Vector< Dimensions, double > &cellCentre_, const tarch::la::Vector< Dimensions, double > &cellSize_, double t, double dt, double *QOut)
 Construct patch data object for one single cell.
 
 CellData (int numberOfCells_)
 
 CellData (const CellData &copy)=delete
 
 ~CellData ()
 
std::string toString () const
 

Data Fields

double ** QIn
 QIn may not be const, as some kernels delete it straightaway once the input data has been handled.
 
tarch::la::Vector< Dimensions, double > * cellCentre
 
tarch::la::Vector< Dimensions, double > * cellSize
 
double * t
 
double * dt
 
intid
 Id of underlying task.
 
const int numberOfCells
 As we store data as SoA, we have to know how big the actual arrays are.
 
double ** QOut
 Out values.
 
double * maxEigenvalue
 Out values.
 

Detailed Description

Representation of a number of cells which contains all information that's required to process the stored patches or polynomial shape functions (given you know the semantics of the data).

This struct is a mixture of AoS and SoA. All data besides the Qin and result are SoA. The reason for this "inconsistent" model is that we want to transfer the patch data to accelerators quickly, while we also want to avoid to copy too much stuff around. So we leave the big input fields and basically manage just pointers to that. All scalar or small vector data are converted in SoA which makes it fairly straightforward later to move them over to an accelerator.

Memory responsibility

The PatchData object is a meta object. It does not administer any major heap data itself. That is, its QIn data has to be redirected to the reconstructed data, i.e. the patch data including the halos, by the user. This happens for example in applyKernelToCell() where we create a PatchData object over both allocated input and output data.

As the PatchData does maintain some internal tables which are allocated in the constructor and freed in the destructor, I do not provide a copy constructor. This one is explicitly deleted. Some backends might require a copy constructor one day

for (int i=0; i<numberOfCells; i++) {
QIn[i] = copy.QIn[i];
cellCentre[i] = copy.cellCentre[i];
cellSize[i] = copy.cellSize[i];
t[i] = copy.t[i];
dt[i] = copy.dt[i];
id[i] = copy.id[i];
QOut[i] = copy.QOut[i];
maxEigenvalue[i] = copy.maxEigenvalue[i];
}
}
Representation of a number of cells which contains all information that's required to process the sto...
Definition CellData.h:79
CellData(double *QIn, const tarch::la::Vector< Dimensions, double > &cellCentre_, const tarch::la::Vector< Dimensions, double > &cellSize_, double t, double dt, double *QOut)
Construct patch data object for one single cell.
Definition CellData.cpp:5
const int numberOfCells
As we store data as SoA, we have to know how big the actual arrays are.
Definition CellData.h:101
double ** QIn
QIn may not be const, as some kernels delete it straightaway once the input data has been handled.
Definition CellData.h:84

but for the time being, I do not offer such a variant.

SYCL

If you use SYCL, you might be tempted to declare the class as copyable. This is factually wrong: the class is not trivially copyable.

#if defined(SharedSYCL)
template<>
struct sycl::is_device_copyable<exahype2::CellData>: std::true_type {};
#endif
Common routines required for a variety of Riemann solvers.
Definition AderUtils.h:16

hence makes the file compile, but in all tests that I ran the code then did crash.

Definition at line 79 of file CellData.h.

Constructor & Destructor Documentation

◆ CellData() [1/3]

exahype2::CellData::CellData ( double * QIn,
const tarch::la::Vector< Dimensions, double > & cellCentre_,
const tarch::la::Vector< Dimensions, double > & cellSize_,
double t,
double dt,
double * QOut )

Construct patch data object for one single cell.

Usually, I do so only to be able to use the same kernels everywhere: Kernels accept CellData, i.e. multiple patches. Even if we have only one cell, we thus wrap this cell's data into an instance of CellData and pass it in. The id can be set to any dummy in this case, as we know which task has wrapped this single cell, i.e. we usually do not read it later.

Definition at line 5 of file CellData.cpp.

References cellCentre, cellSize, dt, QIn, QOut, and t.

◆ CellData() [2/3]

exahype2::CellData::CellData ( int numberOfCells_)

◆ CellData() [3/3]

exahype2::CellData::CellData ( const CellData & copy)
delete

◆ ~CellData()

exahype2::CellData::~CellData ( )

Definition at line 35 of file CellData.cpp.

References tarch::freeMemory(), and tarch::ManagedSharedAcceleratorDeviceMemory.

Here is the call graph for this function:

Member Function Documentation

◆ toString()

std::string exahype2::CellData::toString ( ) const

Definition at line 46 of file CellData.cpp.

Field Documentation

◆ cellCentre

◆ cellSize

◆ dt

◆ id

int* exahype2::CellData::id

Id of underlying task.

Required when we fuse many enclave tasks and load them off to the GPU, as we have to know afterwards which outcome corresponds to which task.

Definition at line 95 of file CellData.h.

◆ maxEigenvalue

◆ numberOfCells

◆ QIn

◆ QOut

◆ t


The documentation for this struct was generated from the following files: