![]() |
Project
|
GPUCA_GPUCODE. More...
#include <FlatObject.h>
Inherited by o2::gpu::NDPiecewisePolynomials< FDim, FDegree, false >, o2::base::MatLayerCyl, o2::base::MatLayerCylSet, o2::gpu::IrregularSpline1D, o2::gpu::IrregularSpline2D3D, o2::gpu::MultivariatePolynomial< Dim, Degree, InteractionOnly >, o2::gpu::NDPiecewisePolynomials< Dim, Degree, InteractionOnly >, o2::gpu::SemiregularSpline2D3D, o2::gpu::Spline1DContainer< DataT >, o2::gpu::Spline2DContainer< DataT >, o2::gpu::SplineContainer< DataT >, o2::gpu::TPCFastSpaceChargeCorrection, o2::gpu::TPCFastTransform, o2::tpc::CalibdEdxContainer, o2::tpc::CalibdEdxTrackTopologyPol, o2::tpc::CalibdEdxTrackTopologySpline, and o2::trd::GeometryFlat.
Public Member Functions | |
FlatObject ()=default | |
_____________ Constructors / destructors __________________________ | |
~FlatObject () | |
FlatObject (const FlatObject &)=delete | |
FlatObject & | operator= (const FlatObject &)=delete |
void | destroy () |
_______________ Utilities _______________________________________________ | |
size_t | getFlatBufferSize () const |
Gives size of the flat buffer. | |
const char * | getFlatBufferPtr () const |
Gives pointer to the flat buffer. | |
bool | isConstructed () const |
Tells if the object is constructed. | |
bool | isBufferInternal () const |
Tells if the buffer is internal. | |
void | adoptInternalBuffer (char *buf) |
void | clearInternalBufferPtr () |
void | printC () const |
Print the content of the flat buffer. | |
Static Public Member Functions | |
static size_t | alignSize (size_t sizeBytes, size_t alignmentBytes) |
_______________ Generic utilities _______________________________________________ | |
template<class T > | |
static T * | relocatePointer (const char *oldBase, char *newBase, const T *ptr) |
Relocates a pointer inside a buffer to the new buffer address. | |
template<class T , class TFile > | |
static int32_t | writeToFile (T &obj, TFile &outf, const char *name) |
write a child class object to the file | |
template<class T , class TFile > | |
static T * | readFromFile (TFile &inpf, const char *name) |
read a child class object from the file | |
template<class T > | |
static std::string | stressTest (T &obj) |
Test the flat object functionality for a child class T. | |
Protected Types | |
enum | ConstructionState : uint32_t { NotConstructed = 0x0 , Constructed = 0x1 , InProgress = 0x2 } |
GPUCA_GPUCODE. More... | |
Protected Member Functions | |
void | startConstruction () |
_____________ Construction _________ | |
void | finishConstruction (int32_t flatBufferSize) |
void | cloneFromObject (const FlatObject &obj, char *newFlatBufferPtr) |
char * | releaseInternalBuffer () |
_____________ Methods for making the data buffer external __________________________ | |
void | moveBufferTo (char *newBufferPtr) |
void | setActualBufferAddress (char *actualFlatBufferPtr) |
_____________ Methods for moving the class with its external buffer to another location __________________________ | |
void | setFutureBufferAddress (char *futureFlatBufferPtr) |
ClassDefNV (FlatObject, 1) | |
Pointer to the flat buffer. | |
Static Protected Member Functions | |
static constexpr size_t | getClassAlignmentBytes () |
_____________ Memory alignment __________________________ | |
static constexpr size_t | getBufferAlignmentBytes () |
Gives minimal alignment in bytes required for the flat buffer. | |
Protected Attributes | |
int32_t | mFlatBufferSize = 0 |
size of the flat buffer | |
uint32_t | mConstructionMask = ConstructionState::NotConstructed |
mask for constructed object members, first two bytes are used by this class | |
char * | mFlatBufferContainer = nullptr |
char * | mFlatBufferPtr = nullptr |
GPUCA_GPUCODE.
Definition at line 175 of file FlatObject.h.
|
protected |
GPUCA_GPUCODE.
_______________ Data members _______________________________________________ Enumeration of construction states
Enumerator | |
---|---|
NotConstructed | the object is not constructed |
Constructed | the object is constructed, temporary memory is released |
InProgress | construction started: temporary memory is reserved |
Definition at line 316 of file FlatObject.h.
|
default |
_____________ Constructors / destructors __________________________
Default constructor / destructor
|
inline |
========================================================================================================
Inline implementations of methods
========================================================================================================
Definition at line 337 of file FlatObject.h.
|
delete |
Definition at line 534 of file FlatObject.h.
|
inlinestatic |
_______________ Generic utilities _______________________________________________
Increases given size to achieve required alignment
Definition at line 277 of file FlatObject.h.
|
protected |
Pointer to the flat buffer.
|
inline |
Definition at line 541 of file FlatObject.h.
|
inlineprotected |
Initializes from another object, copies data to newBufferPtr When newBufferPtr==nullptr, an internal container will be created, the data will be copied there. A daughter class should relocate pointers inside the buffer.
Initializes from another object, copies data to newBufferPtr When newBufferPtr==nullptr, the internal container will be created, the data will be copied there. obj can be *this (provided it does not own its buffer AND the external buffer is provided, which means
Definition at line 373 of file FlatObject.h.
|
inline |
_______________ Utilities _______________________________________________
Set the object to NotConstructed state, release the buffer
Set the object to NotConstructed state, release the buffer
Definition at line 349 of file FlatObject.h.
|
inlineprotected |
Finishes construction: creates internal flat buffer. A daughter class should put all created variable-size members to this buffer
Finishes construction: creates internal flat buffer. A daughter class should put all created variable-size members to this buffer
Definition at line 358 of file FlatObject.h.
|
inlinestaticconstexprprotected |
Gives minimal alignment in bytes required for the flat buffer.
Definition at line 197 of file FlatObject.h.
|
inlinestaticconstexprprotected |
_____________ Memory alignment __________________________
Gives minimal alignment in bytes required for the class object
Definition at line 194 of file FlatObject.h.
|
inline |
Gives pointer to the flat buffer.
Definition at line 259 of file FlatObject.h.
|
inline |
Gives size of the flat buffer.
Definition at line 256 of file FlatObject.h.
|
inline |
Tells if the buffer is internal.
Definition at line 265 of file FlatObject.h.
|
inline |
Tells if the object is constructed.
Definition at line 262 of file FlatObject.h.
Sets buffer pointer to the new address, move the buffer content there. A daughter class must relocate all the pointers inside th buffer
sets buffer pointer to the new address, move the buffer content there.
Definition at line 396 of file FlatObject.h.
|
delete |
|
inline |
Print the content of the flat buffer.
Print the content of the flat buffer
Definition at line 458 of file FlatObject.h.
|
inlinestatic |
|
inlineprotected |
_____________ Methods for making the data buffer external __________________________
Definition at line 526 of file FlatObject.h.
|
inlinestatic |
Relocates a pointer inside a buffer to the new buffer address.
Definition at line 285 of file FlatObject.h.
_____________ Methods for moving the class with its external buffer to another location __________________________
Sets the actual location of the flat buffer after it has been moved (i.e. to another maschine) It sets mFlatBufferPtr to actualFlatBufferPtr. A daughter class should later update all the pointers inside the buffer to the new location.
Sets the actual location of the external flat buffer after it has been moved (i.e. to another maschine)
It sets mFlatBufferPtr to actualFlatBufferPtr. A daughter class should update all the pointers inside the buffer in the new location.
Definition at line 547 of file FlatObject.h.
Sets a future location of the external flat buffer before moving it to this location (i.e. when copying to GPU).
The object can be used immidiatelly after the move, call of setActualFlatBufferAddress() is not needed.
A daughter class should already relocate all the pointers inside the current buffer to the future location. It should not touch memory in the future location, since it may be not yet available.
!!! Information about the actual buffer location will be lost. !!! Most of the class methods may be called only after the buffer will be moved to its new location. !!! To undo call setActualFlatBufferAddress()
Sets a future location of the external flat buffer before moving it to this location.
A daughter class should already reset all the pointers inside the current buffer to the future location without touching memory in the future location.
Definition at line 557 of file FlatObject.h.
|
inlineprotected |
_____________ Construction _________
Starts the construction procedure. A daughter class should reserve temporary memory.
Starts the construction procedure. A daughter class should reserve temporary memory.
Definition at line 342 of file FlatObject.h.
|
inlinestatic |
Test the flat object functionality for a child class T.
Test the flat object functionality for an object of a child class T the obj is modified here. Check if it is functional after the test.
Definition at line 411 of file FlatObject.h.
|
inlinestatic |
|
protected |
mask for constructed object members, first two bytes are used by this class
Definition at line 323 of file FlatObject.h.
|
protected |
Definition at line 324 of file FlatObject.h.
|
protected |
Definition at line 325 of file FlatObject.h.
|
protected |
size of the flat buffer
Definition at line 322 of file FlatObject.h.