Peano
Loading...
Searching...
No Matches
CellData.h
Go to the documentation of this file.
1// This file is part of the ExaHyPE2 project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5#include "tarch/la/Vector.h"
7#include "config.h"
8
9#include <functional>
10#include <string>
11
12namespace exahype2 {
76 template<typename inType=double, typename outType=double>
77 struct CellData {
82 inType** QIn;
85
86 double* t;
87 double* dt;
93 int* id;
94
99 const int numberOfCells;
100
106
111 const int targetDevice;
112
116 outType** QOut;
117
122
133 CellData(
134 inType* QIn_,
135 const tarch::la::Vector<Dimensions,double>& cellCentre_,
137 double t_,
138 double dt_,
139 outType* QOut_,
142 );
143
144 CellData(
145 int numberOfCells_,
148 );
149
150 CellData(const CellData<inType,outType>& copy) = delete;
151
152 ~CellData();
153
154 std::string toString() const;
155 };
156
157// using CellData = CellData<double, double>;
158}
159
160#include "CellData.cpph"
static constexpr int HostDevice
Accelerator devices (GPUs) are enumerated starting from 0.
Definition Device.h:48
For the generic kernels that I use here most of the time.
Definition CellAccess.h:13
MemoryLocation
Definition accelerator.h:58
@ Heap
Create data on the heap of the local device.
Representation of a number of cells which contains all information that's required to process the sto...
Definition CellData.h:77
outType ** QOut
Out values.
Definition CellData.h:116
const tarch::MemoryLocation memoryLocation
We might want to allocate data on the heap or an accelerator, therefore we save the target device id.
Definition CellData.h:105
inType ** QIn
QIn may not be const, as some kernels delete it straightaway once the input data has been handled.
Definition CellData.h:82
const int numberOfCells
As we store data as SoA, we have to know how big the actual arrays are.
Definition CellData.h:99
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.
Definition CellData.cpph:4
std::string toString() const
Definition CellData.cpph:56
CellData(const CellData< inType, outType > &copy)=delete
int * id
Id of underlying task.
Definition CellData.h:93
const int targetDevice
We might want to allocate data on an accelerator, therefore we save the target device id.
Definition CellData.h:111
double * maxEigenvalue
Out values.
Definition CellData.h:121
tarch::la::Vector< Dimensions, double > * cellCentre
Definition CellData.h:83
tarch::la::Vector< Dimensions, double > * cellSize
Definition CellData.h:84
Simple vector class.
Definition Vector.h:134