Peano
Loading...
Searching...
No Matches
EnclaveDataRepository.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 "Constants.h"
6#include "tarch/la/Vector.h"
7
8#include <algorithm>
9#include <iostream>
10#include <map>
11#include <string>
12#include <vector>
13
15
33 public:
35
40
42
43 void startCollection();
44
45 void bookmarkCell(
46 const tarch::la::Vector<DIMENSIONS, double>& cellCentre,
47 const tarch::la::Vector<DIMENSIONS, double>& cellSize
48 );
49
50 void buildFromBookmarks();
51
52 void clear();
53
56
59
60 // --- GPU Data Accessors ---
61 double* getQ();
62 double* getQReconstructed();
63
64 uint64_t* getFaceIndices();
65 double* getFacePool();
66
67 uint64_t* getBoundaryFaceIndices();
68 uint8_t* getBoundaryFaceNumbers();
69 uint64_t* getBoundaryCellIndices();
70
71 tarch::la::Vector<DIMENSIONS, double>* getCellCentres();
72 tarch::la::Vector<DIMENSIONS, double>* getCellSizes();
73
74 int getNumberOfEnclaveCells() const;
75 int getNumberOfBoundaryFaces() const;
76 bool isReady() const;
77
78 double getMinVolumeH() const;
79 double getMaxVolumeH() const;
80
81 private:
83
84 double* _combinedQBlockDevice = nullptr;
85
86 using FaceKey = std::tuple<int, int, int>;
87
90
91 // --- State Management ---
95
96 // --- GPU Device Pointers ---
97 double* _QDevice;
99
100 tarch::la::Vector<DIMENSIONS, double>* _cellCentresDevice;
101 tarch::la::Vector<DIMENSIONS, double>* _cellSizesDevice;
102
103 // --- Face Data Management ---
109
113
114 std::map<FaceKey, uint64_t> _uniqueFaceMap;
115
116 // --- Host-side Bookmarking Data (temporary) ---
117 std::vector<tarch::la::Vector<DIMENSIONS, double>> _bookmarkedCellCentres;
118 std::vector<tarch::la::Vector<DIMENSIONS, double>> _bookmarkedCellSizes;
119 };
120} // namespace benchmarks::exahype2::kernelbenchmarks
const tarch::la::Vector< DIMENSIONS, double > cellSize
Manages GPU data for a sparse subset of active leaf cells.
EnclaveDataRepository(const EnclaveDataRepository &)=delete
EnclaveDataRepository & operator=(const EnclaveDataRepository &)=delete
void bookmarkCell(const tarch::la::Vector< DIMENSIONS, double > &cellCentre, const tarch::la::Vector< DIMENSIONS, double > &cellSize)
EnclaveDataRepository & operator=(EnclaveDataRepository &&)=delete
double * _globalFacePoolDevice
A single, contiguous block of memory holding all unique face data.
std::vector< tarch::la::Vector< DIMENSIONS, double > > _bookmarkedCellSizes
std::vector< tarch::la::Vector< DIMENSIONS, double > > _bookmarkedCellCentres