77 template<
typename inType=
double,
typename outType=
double>
158 static int in(
int index[Dimensions+2]);
159 static int out(
int index[Dimensions+2]);
186 template<
typename inType=
double,
typename outType=
double>
231 template <
typename inType=
double,
typename outType=
double>
267 template<
typename T,
int Rank>
277 for (
int i = 0; i < Rank; ++i) {
296 desc.
sizes[0] = size;
303 double* flattenedInput =
new double[rows * cols];
304 for (int64_t i = 0; i < rows; ++i) {
306 flattenedInput + i * cols,
308 static_cast<std::size_t
>(cols) *
sizeof(
double)
314 desc.
sizes[0] = rows;
315 desc.
sizes[1] = cols;
324 for (int64_t i = 0; i < rows; ++i) {
330 desc.
sizes[0] = rows;
401#include "CellData.cpph"
static constexpr int HostDevice
Accelerator devices (GPUs) are enumerated starting from 0.
This file is part of the ExaHyPE 2 project within Peano 4.
MemRefDescriptor< double, 2 > MemRefDescriptor2D
MemRefDescriptor< MemRefDescriptor1D, 1 > MemRefDescriptorNested
MemRefDescriptorNested createMemRefDescriptorNested(double **data, int64_t rows, int64_t cols)
MemRefDescriptor< double, 1 > MemRefDescriptor1D
MemRefDescriptor2D createMemRefDescriptor2D(double **data, int64_t rows, int64_t cols)
MemRefDescriptor1D createMemRefDescriptor1D(double *data, int64_t size)
@ Heap
Create data on the heap of the local device.
std::string toString() const
tarch::la::Vector< Dimensions, double > * cellSize
CellDataFlattened(const CellData< inType, outType > &cellData, int inputPatchSize, int outputPatchSize)
const int64_t numberOfCells
tarch::la::Vector< Dimensions, double > * cellCentre
void copyBackAndDestroy()
Representation of a number of cells which contains all information that's required to process the sto...
outType ** QOut
Out values.
const tarch::MemoryLocation memoryLocation
We might want to allocate data on the heap or an accelerator, therefore we save the target device id.
static int out(int index[Dimensions+2])
inType ** QIn
QIn may not be const, as some kernels delete it straightaway once the input data has been handled.
const int numberOfCells
As we store data as SoA, we have to know how big the actual arrays are.
static int in(int index[Dimensions+2])
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.
std::string toString() const
CellData(const CellData< inType, outType > ©)=delete
int * id
Id of underlying task.
const int targetDevice
We might want to allocate data on an accelerator, therefore we save the target device id.
CellData(int numberOfCells_, tarch::MemoryLocation memoryLocation=tarch::MemoryLocation::Heap, int targetDevice=tarch::accelerator::Device::HostDevice)
double * maxEigenvalue
Out values.
tarch::la::Vector< Dimensions, double > * cellCentre
tarch::la::Vector< Dimensions, double > * cellSize
double * maxEigenvalueHost
const tarch::MemoryLocation memoryLocation
tarch::la::Vector< Dimensions, double > * cellCentre
void destroyWithoutCopy()
tarch::la::Vector< Dimensions, double > * cellSize
CopyCellDataGPU(const CellData< inType, outType > &cellData, int inputPatchSize, int outputPatchSize, int device=tarch::accelerator::Device::HostDevice, int currentPatchDevice=tarch::accelerator::Device::HostDevice)
Construct a copy object.
void copyBackAndDestroy()
std::string toString() const
MemRefDescriptor1D maxEigenvalue
MemRefDescriptor2D cellSize
MLIRCellDataFlattened(const CellData< double, double > &cellData, int inputPatchSize, int outputPatchSize)
void copyBackAndDestroy()
const int64_t numberOfCells
std::string toString() const
MemRefDescriptor2D cellCentre
void copyBackAndDestroy()
MLIRCellDataNested(const CellData< double, double > &cellData, int inputPatchSize, int outputPatchSize)
std::string toString() const
MemRefDescriptorNested QIn
MemRefDescriptor1D maxEigenvalue
MemRefDescriptor2D cellCentre
MemRefDescriptor2D cellSize
MemRefDescriptorNested QOut
const int64_t numberOfCells