Peano
|
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>
Public Member Functions | |
CellData (inType *QIn_, const tarch::la::Vector< Dimensions, double > &cellCentre_, const tarch::la::Vector< Dimensions, double > &cellSize_, double t_, double dt_, outType *QOut_, tarch::MemoryLocation memoryLocation_=tarch::MemoryLocation::Heap, int targetDevice_=tarch::accelerator::Device::HostDevice) | |
Construct patch data object for one single cell. | |
CellData (int numberOfCells_, tarch::MemoryLocation memoryLocation=tarch::MemoryLocation::Heap, int targetDevice=tarch::accelerator::Device::HostDevice) | |
CellData (const CellData< inType, outType > ©)=delete | |
~CellData () | |
std::string | toString () const |
Data Fields | |
inType ** | 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 |
int * | id |
Id of underlying task. | |
const int | numberOfCells |
As we store data as SoA, we have to know how big the actual arrays are. | |
const tarch::MemoryLocation | memoryLocation |
We might want to allocate data on the heap or an accelerator, therefore we save the target device id. | |
const int | targetDevice |
We might want to allocate data on an accelerator, therefore we save the target device id. | |
outType ** | QOut |
Out values. | |
double * | maxEigenvalue |
Out values. | |
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.
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
but for the time being, I do not offer such a variant.
If you use SYCL, you might be tempted to declare the class as copyable. This is factually wrong: the class is not trivially copyable.
hence makes the file compile, but in all tests that I ran the code then did crash.
Definition at line 77 of file CellData.h.
exahype2::CellData< inType, outType >::CellData | ( | inType * | QIn_, |
const tarch::la::Vector< Dimensions, double > & | cellCentre_, | ||
const tarch::la::Vector< Dimensions, double > & | cellSize_, | ||
double | t_, | ||
double | dt_, | ||
outType * | QOut_, | ||
tarch::MemoryLocation | memoryLocation_ = tarch::MemoryLocation::Heap, | ||
int | targetDevice_ = tarch::accelerator::Device::HostDevice ) |
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 4 of file CellData.cpph.
References exahype2::CellData< inType, outType >::cellCentre, exahype2::CellData< inType, outType >::cellSize, exahype2::CellData< inType, outType >::dt, exahype2::CellData< inType, outType >::QIn, exahype2::CellData< inType, outType >::QOut, and exahype2::CellData< inType, outType >::t.
exahype2::CellData< inType, outType >::CellData | ( | int | numberOfCells_, |
tarch::MemoryLocation | memoryLocation = tarch::MemoryLocation::Heap, | ||
int | targetDevice = tarch::accelerator::Device::HostDevice ) |
Definition at line 25 of file CellData.cpph.
References exahype2::CellData< inType, outType >::cellCentre, exahype2::CellData< inType, outType >::cellSize, exahype2::CellData< inType, outType >::dt, exahype2::CellData< inType, outType >::maxEigenvalue, exahype2::CellData< inType, outType >::QIn, exahype2::CellData< inType, outType >::QOut, and exahype2::CellData< inType, outType >::t.
|
delete |
exahype2::CellData< inType, outType >::~CellData | ( | ) |
Definition at line 44 of file CellData.cpph.
References tarch::freeMemory().
std::string exahype2::CellData< inType, outType >::toString | ( | ) | const |
Definition at line 56 of file CellData.cpph.
tarch::la::Vector<Dimensions,double>* exahype2::CellData< inType, outType >::cellCentre |
Definition at line 83 of file CellData.h.
Referenced by exahype2::fd::tests::CCZ4KernelTest::AppleWithAppleTest(), exahype2::CellData< inType, outType >::CellData(), exahype2::CellData< inType, outType >::CellData(), exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre(), exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre_functors(), applications::exahype2::ccz4::recomputeAuxiliaryVariablesFD4_4thOrder(), exahype2::fd::fd4::reconstruct_first_derivatives(), exahype2::dg::reduceMaxEigenvalue_patchwise_functors(), exahype2::fd::reduceMaxEigenvalue_patchwise_functors(), runBenchmarks(), exahype2::fd::fd4::omp::internal::timeStep_batched_heap_multicore_static_calls(), exahype2::fd::fd4::internal::timeStep_batched_static_calls(), exahype2::fd::fd4::timeStep_patchwise_heap_functors(), exahype2::fd::fd4::internal::timeStep_patchwise_static_calls(), and exahype2::fv::musclhancock::timeStepWithMusclHancock_patchwise_heap_functors().
tarch::la::Vector<Dimensions,double>* exahype2::CellData< inType, outType >::cellSize |
Definition at line 84 of file CellData.h.
Referenced by exahype2::fd::tests::CCZ4KernelTest::AppleWithAppleTest(), exahype2::CellData< inType, outType >::CellData(), exahype2::CellData< inType, outType >::CellData(), exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre(), exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre_functors(), exahype2::dg::multiplyWithInvertedMassMatrix_GaussLegendre(), applications::exahype2::ccz4::recomputeAuxiliaryVariablesFD4_4thOrder(), exahype2::fd::fd4::reconstruct_first_derivatives(), exahype2::dg::reduceMaxEigenvalue_patchwise_functors(), exahype2::fd::reduceMaxEigenvalue_patchwise_functors(), runBenchmarks(), exahype2::fd::fd4::omp::internal::timeStep_batched_heap_multicore_static_calls(), exahype2::fd::fd4::internal::timeStep_batched_static_calls(), exahype2::fd::fd4::timeStep_patchwise_heap_functors(), exahype2::fd::fd4::internal::timeStep_patchwise_static_calls(), and exahype2::fv::musclhancock::timeStepWithMusclHancock_patchwise_heap_functors().
double* exahype2::CellData< inType, outType >::dt |
Definition at line 87 of file CellData.h.
Referenced by exahype2::CellData< inType, outType >::CellData(), exahype2::CellData< inType, outType >::CellData(), exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre(), exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre_functors(), exahype2::dg::reduceMaxEigenvalue_patchwise_functors(), exahype2::fd::reduceMaxEigenvalue_patchwise_functors(), runBenchmarks(), exahype2::fd::fd4::omp::internal::timeStep_batched_heap_multicore_static_calls(), exahype2::fd::fd4::internal::timeStep_batched_static_calls(), exahype2::fd::fd4::timeStep_patchwise_heap_functors(), exahype2::fd::fd4::internal::timeStep_patchwise_static_calls(), and exahype2::fv::musclhancock::timeStepWithMusclHancock_patchwise_heap_functors().
int* exahype2::CellData< inType, outType >::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 93 of file CellData.h.
double* exahype2::CellData< inType, outType >::maxEigenvalue |
Out values.
Definition at line 121 of file CellData.h.
Referenced by exahype2::CellData< inType, outType >::CellData(), exahype2::dg::reduceMaxEigenvalue_patchwise_functors(), exahype2::fd::reduceMaxEigenvalue_patchwise_functors(), runBenchmarks(), exahype2::fv::musclhancock::timeStepWithMusclHancock_patchwise_heap_functors(), wrapBatchedHeapFunctorHostKernels(), wrapPatchwiseHeapFunctorsHostKernel(), and wrapVolumewiseFunctorHostKernels().
const tarch::MemoryLocation exahype2::CellData< inType, outType >::memoryLocation |
We might want to allocate data on the heap or an accelerator, therefore we save the target device id.
Definition at line 105 of file CellData.h.
const int exahype2::CellData< inType, outType >::numberOfCells |
As we store data as SoA, we have to know how big the actual arrays are.
Definition at line 99 of file CellData.h.
Referenced by exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre(), exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre_functors(), exahype2::dg::multiplyWithInvertedMassMatrix_GaussLegendre(), applications::exahype2::ccz4::recomputeAuxiliaryVariablesFD4_4thOrder(), exahype2::fd::fd4::reconstruct_first_derivatives(), exahype2::dg::reduceMaxEigenvalue_patchwise_functors(), exahype2::fd::reduceMaxEigenvalue_patchwise_functors(), exahype2::fd::fd4::omp::internal::timeStep_batched_heap_multicore_static_calls(), exahype2::fd::fd4::internal::timeStep_batched_static_calls(), exahype2::fd::fd4::timeStep_patchwise_heap_functors(), exahype2::fd::fd4::internal::timeStep_patchwise_static_calls(), and exahype2::fv::musclhancock::timeStepWithMusclHancock_patchwise_heap_functors().
inType** exahype2::CellData< inType, outType >::QIn |
QIn may not be const, as some kernels delete it straightaway once the input data has been handled.
Definition at line 82 of file CellData.h.
Referenced by exahype2::CellData< inType, outType >::CellData(), exahype2::CellData< inType, outType >::CellData(), exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre(), exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre_functors(), applications::exahype2::ccz4::recomputeAuxiliaryVariablesFD4_4thOrder(), exahype2::fd::fd4::reconstruct_first_derivatives(), runBenchmarks(), exahype2::fd::fd4::omp::internal::timeStep_batched_heap_multicore_static_calls(), exahype2::fd::fd4::internal::timeStep_batched_static_calls(), exahype2::fd::fd4::timeStep_patchwise_heap_functors(), exahype2::fd::fd4::internal::timeStep_patchwise_static_calls(), and exahype2::fv::musclhancock::timeStepWithMusclHancock_patchwise_heap_functors().
outType** exahype2::CellData< inType, outType >::QOut |
Out values.
Definition at line 116 of file CellData.h.
Referenced by exahype2::CellData< inType, outType >::CellData(), exahype2::CellData< inType, outType >::CellData(), exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre(), exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre_functors(), exahype2::dg::multiplyWithInvertedMassMatrix_GaussLegendre(), exahype2::fd::fd4::reconstruct_first_derivatives(), exahype2::dg::reduceMaxEigenvalue_patchwise_functors(), exahype2::fd::reduceMaxEigenvalue_patchwise_functors(), runBenchmarks(), exahype2::fd::fd4::omp::internal::timeStep_batched_heap_multicore_static_calls(), exahype2::fd::fd4::internal::timeStep_batched_static_calls(), exahype2::fd::fd4::timeStep_patchwise_heap_functors(), exahype2::fd::fd4::internal::timeStep_patchwise_static_calls(), and exahype2::fv::musclhancock::timeStepWithMusclHancock_patchwise_heap_functors().
double* exahype2::CellData< inType, outType >::t |
Definition at line 86 of file CellData.h.
Referenced by exahype2::CellData< inType, outType >::CellData(), exahype2::CellData< inType, outType >::CellData(), exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre(), exahype2::dg::cellIntegral_patchwise_in_situ_GaussLegendre_functors(), exahype2::dg::reduceMaxEigenvalue_patchwise_functors(), exahype2::fd::reduceMaxEigenvalue_patchwise_functors(), runBenchmarks(), exahype2::fd::fd4::omp::internal::timeStep_batched_heap_multicore_static_calls(), exahype2::fd::fd4::internal::timeStep_batched_static_calls(), exahype2::fd::fd4::timeStep_patchwise_heap_functors(), exahype2::fd::fd4::internal::timeStep_patchwise_static_calls(), and exahype2::fv::musclhancock::timeStepWithMusclHancock_patchwise_heap_functors().
const int exahype2::CellData< inType, outType >::targetDevice |
We might want to allocate data on an accelerator, therefore we save the target device id.
Definition at line 111 of file CellData.h.