Peano
Loading...
Searching...
No Matches
benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository Class Reference

Manages GPU data for a sparse subset of active leaf cells. More...

#include <EnclaveDataRepository.h>

Collaboration diagram for benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository:

Public Member Functions

 EnclaveDataRepository (const EnclaveDataRepository &)=delete
 
EnclaveDataRepositoryoperator= (const EnclaveDataRepository &)=delete
 
 EnclaveDataRepository (EnclaveDataRepository &&)=delete
 
EnclaveDataRepositoryoperator= (EnclaveDataRepository &&)=delete
 
 ~EnclaveDataRepository ()
 
void startCollection ()
 
void bookmarkCell (const tarch::la::Vector< DIMENSIONS, double > &cellCentre, const tarch::la::Vector< DIMENSIONS, double > &cellSize)
 
void buildFromBookmarks ()
 
void clear ()
 
void syncCellsDeviceToHost ()
 
void syncFacesDeviceToHost ()
 
void syncCellsHostToDevice ()
 
void syncFacesHostToDevice ()
 
double * getQ ()
 
double * getQReconstructed ()
 
uint64_t * getFaceIndices ()
 
double * getFacePool ()
 
uint64_t * getBoundaryFaceIndices ()
 
uint8_t * getBoundaryFaceNumbers ()
 
uint64_t * getBoundaryCellIndices ()
 
tarch::la::Vector< DIMENSIONS, double > * getCellCentres ()
 
tarch::la::Vector< DIMENSIONS, double > * getCellSizes ()
 
int getNumberOfEnclaveCells () const
 
int getNumberOfBoundaryFaces () const
 
bool isReady () const
 
double getMinVolumeH () const
 
double getMaxVolumeH () const
 

Static Public Member Functions

static EnclaveDataRepositorygetInstance ()
 

Private Types

using FaceKey = std::tuple<int, int, int>
 

Private Member Functions

 EnclaveDataRepository ()
 

Private Attributes

double * _combinedQBlockDevice = nullptr
 
double _minVolumeH
 
double _maxVolumeH
 
bool _isReady
 
int _numberOfEnclaveCells
 
int _numberOfBoundaryFaces
 
double * _QDevice
 
double * _QReconstructedDevice
 
tarch::la::Vector< DIMENSIONS, double > * _cellCentresDevice
 
tarch::la::Vector< DIMENSIONS, double > * _cellSizesDevice
 
double * _globalFacePoolDevice
 A single, contiguous block of memory holding all unique face data.
 
uint64_t * _indicesOfFacesDevice
 
uint64_t * _indicesOfBoundaryFacesDevice
 
uint8_t * _boundaryFaceNumbersDevice
 
uint64_t * _boundaryCellIndicesDevice
 
std::map< FaceKey, uint64_t > _uniqueFaceMap
 
std::vector< tarch::la::Vector< DIMENSIONS, double > > _bookmarkedCellCentres
 
std::vector< tarch::la::Vector< DIMENSIONS, double > > _bookmarkedCellSizes
 

Detailed Description

Manages GPU data for a sparse subset of active leaf cells.

This repository holds data for "enclave" cells designated for GPU offloading. It is designed to be rebuilt whenever the mesh changes. Data is stored in a Structure-of-Arrays (SoA) layout for coalesced memory access on the GPU.

The lifecycle is as follows:

  1. startCollection() - Clears old data and prepares for a new build.
  2. bookmarkCell() - Called repeatedly during a traversal to collect leaf cells.
  3. buildFromBookmarks() - Allocates GPU memory and copies data from host.
  4. [COMPUTE ON GPU]
  5. syncDeviceToHost() - Copies results from GPU back to the host repository.
  6. clear() - Frees all GPU resources.

Definition at line 32 of file EnclaveDataRepository.h.

Member Typedef Documentation

◆ FaceKey

Definition at line 86 of file EnclaveDataRepository.h.

Constructor & Destructor Documentation

◆ EnclaveDataRepository() [1/3]

benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::EnclaveDataRepository ( const EnclaveDataRepository & )
delete

◆ EnclaveDataRepository() [2/3]

benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::EnclaveDataRepository ( EnclaveDataRepository && )
delete

◆ ~EnclaveDataRepository()

benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::~EnclaveDataRepository ( )

Definition at line 23 of file EnclaveDataRepository.cpp.

References clear().

Here is the call graph for this function:

◆ EnclaveDataRepository() [3/3]

benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::EnclaveDataRepository ( )
private

Definition at line 14 of file EnclaveDataRepository.cpp.

Member Function Documentation

◆ bookmarkCell()

void benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::bookmarkCell ( const tarch::la::Vector< DIMENSIONS, double > & cellCentre,
const tarch::la::Vector< DIMENSIONS, double > & cellSize )

Definition at line 35 of file EnclaveDataRepository.cpp.

References _bookmarkedCellCentres, _bookmarkedCellSizes, and cellSize.

Referenced by main().

Here is the caller graph for this function:

◆ buildFromBookmarks()

◆ clear()

◆ getBoundaryCellIndices()

uint64_t * benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::getBoundaryCellIndices ( )

Definition at line 353 of file EnclaveDataRepository.cpp.

References _boundaryCellIndicesDevice.

Referenced by main().

Here is the caller graph for this function:

◆ getBoundaryFaceIndices()

uint64_t * benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::getBoundaryFaceIndices ( )

Definition at line 351 of file EnclaveDataRepository.cpp.

References _indicesOfBoundaryFacesDevice.

Referenced by main().

Here is the caller graph for this function:

◆ getBoundaryFaceNumbers()

uint8_t * benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::getBoundaryFaceNumbers ( )

Definition at line 352 of file EnclaveDataRepository.cpp.

References _boundaryFaceNumbersDevice.

Referenced by main().

Here is the caller graph for this function:

◆ getCellCentres()

tarch::la::Vector< DIMENSIONS, double > * benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::getCellCentres ( )

Definition at line 354 of file EnclaveDataRepository.cpp.

References _cellCentresDevice.

Referenced by main().

Here is the caller graph for this function:

◆ getCellSizes()

tarch::la::Vector< DIMENSIONS, double > * benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::getCellSizes ( )

Definition at line 355 of file EnclaveDataRepository.cpp.

References _cellSizesDevice.

Referenced by main().

Here is the caller graph for this function:

◆ getFaceIndices()

uint64_t * benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::getFaceIndices ( )

Definition at line 350 of file EnclaveDataRepository.cpp.

References _indicesOfFacesDevice.

Referenced by main().

Here is the caller graph for this function:

◆ getFacePool()

double * benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::getFacePool ( )

Definition at line 349 of file EnclaveDataRepository.cpp.

References _globalFacePoolDevice.

Referenced by main().

Here is the caller graph for this function:

◆ getInstance()

EnclaveDataRepository & benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::getInstance ( )
static

Definition at line 9 of file EnclaveDataRepository.cpp.

Referenced by main().

Here is the caller graph for this function:

◆ getMaxVolumeH()

double benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::getMaxVolumeH ( ) const

Definition at line 360 of file EnclaveDataRepository.cpp.

References _maxVolumeH.

Referenced by main().

Here is the caller graph for this function:

◆ getMinVolumeH()

double benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::getMinVolumeH ( ) const

Definition at line 359 of file EnclaveDataRepository.cpp.

References _minVolumeH.

Referenced by main().

Here is the caller graph for this function:

◆ getNumberOfBoundaryFaces()

int benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::getNumberOfBoundaryFaces ( ) const

Definition at line 357 of file EnclaveDataRepository.cpp.

References _numberOfBoundaryFaces.

Referenced by main().

Here is the caller graph for this function:

◆ getNumberOfEnclaveCells()

int benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::getNumberOfEnclaveCells ( ) const

Definition at line 356 of file EnclaveDataRepository.cpp.

References _numberOfEnclaveCells.

Referenced by main().

Here is the caller graph for this function:

◆ getQ()

double * benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::getQ ( )

Definition at line 347 of file EnclaveDataRepository.cpp.

References _QDevice.

Referenced by main().

Here is the caller graph for this function:

◆ getQReconstructed()

double * benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::getQReconstructed ( )

Definition at line 348 of file EnclaveDataRepository.cpp.

References _QReconstructedDevice.

Referenced by main().

Here is the caller graph for this function:

◆ isReady()

bool benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::isReady ( ) const

Definition at line 358 of file EnclaveDataRepository.cpp.

References _isReady.

◆ operator=() [1/2]

EnclaveDataRepository & benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::operator= ( const EnclaveDataRepository & )
delete

◆ operator=() [2/2]

EnclaveDataRepository & benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::operator= ( EnclaveDataRepository && )
delete

◆ startCollection()

void benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::startCollection ( )

Definition at line 25 of file EnclaveDataRepository.cpp.

References _bookmarkedCellCentres, _bookmarkedCellSizes, _isReady, _maxVolumeH, _minVolumeH, _numberOfEnclaveCells, and _uniqueFaceMap.

Referenced by main().

Here is the caller graph for this function:

◆ syncCellsDeviceToHost()

void benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::syncCellsDeviceToHost ( )

◆ syncCellsHostToDevice()

◆ syncFacesDeviceToHost()

void benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::syncFacesDeviceToHost ( )

◆ syncFacesHostToDevice()

void benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::syncFacesHostToDevice ( )

Field Documentation

◆ _bookmarkedCellCentres

std::vector<tarch::la::Vector<DIMENSIONS, double> > benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_bookmarkedCellCentres
private

◆ _bookmarkedCellSizes

std::vector<tarch::la::Vector<DIMENSIONS, double> > benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_bookmarkedCellSizes
private

◆ _boundaryCellIndicesDevice

uint64_t* benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_boundaryCellIndicesDevice
private

Definition at line 112 of file EnclaveDataRepository.h.

Referenced by buildFromBookmarks(), clear(), and getBoundaryCellIndices().

◆ _boundaryFaceNumbersDevice

uint8_t* benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_boundaryFaceNumbersDevice
private

Definition at line 111 of file EnclaveDataRepository.h.

Referenced by buildFromBookmarks(), clear(), and getBoundaryFaceNumbers().

◆ _cellCentresDevice

tarch::la::Vector<DIMENSIONS, double>* benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_cellCentresDevice
private

Definition at line 100 of file EnclaveDataRepository.h.

Referenced by buildFromBookmarks(), clear(), and getCellCentres().

◆ _cellSizesDevice

tarch::la::Vector<DIMENSIONS, double>* benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_cellSizesDevice
private

Definition at line 101 of file EnclaveDataRepository.h.

Referenced by buildFromBookmarks(), clear(), and getCellSizes().

◆ _combinedQBlockDevice

double* benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_combinedQBlockDevice = nullptr
private

Definition at line 84 of file EnclaveDataRepository.h.

Referenced by buildFromBookmarks(), and clear().

◆ _globalFacePoolDevice

double* benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_globalFacePoolDevice
private

A single, contiguous block of memory holding all unique face data.

Definition at line 107 of file EnclaveDataRepository.h.

Referenced by buildFromBookmarks(), clear(), getFacePool(), syncFacesDeviceToHost(), and syncFacesHostToDevice().

◆ _indicesOfBoundaryFacesDevice

uint64_t* benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_indicesOfBoundaryFacesDevice
private

Definition at line 110 of file EnclaveDataRepository.h.

Referenced by buildFromBookmarks(), clear(), and getBoundaryFaceIndices().

◆ _indicesOfFacesDevice

uint64_t* benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_indicesOfFacesDevice
private

Definition at line 108 of file EnclaveDataRepository.h.

Referenced by buildFromBookmarks(), clear(), and getFaceIndices().

◆ _isReady

bool benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_isReady
private

◆ _maxVolumeH

double benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_maxVolumeH
private

Definition at line 89 of file EnclaveDataRepository.h.

Referenced by buildFromBookmarks(), getMaxVolumeH(), and startCollection().

◆ _minVolumeH

double benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_minVolumeH
private

Definition at line 88 of file EnclaveDataRepository.h.

Referenced by buildFromBookmarks(), getMinVolumeH(), and startCollection().

◆ _numberOfBoundaryFaces

int benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_numberOfBoundaryFaces
private

Definition at line 94 of file EnclaveDataRepository.h.

Referenced by buildFromBookmarks(), clear(), and getNumberOfBoundaryFaces().

◆ _numberOfEnclaveCells

int benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_numberOfEnclaveCells
private

◆ _QDevice

double* benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_QDevice
private

◆ _QReconstructedDevice

double* benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_QReconstructedDevice
private

Definition at line 98 of file EnclaveDataRepository.h.

Referenced by buildFromBookmarks(), clear(), and getQReconstructed().

◆ _uniqueFaceMap

std::map<FaceKey, uint64_t> benchmarks::exahype2::kernelbenchmarks::EnclaveDataRepository::_uniqueFaceMap
private

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