Project
Loading...
Searching...
No Matches
o2::gpu::SplineContainer< DataT > Class Template Reference

#include <SplineSpec.h>

Inherits o2::gpu::FlatObject.

Inherited by o2::gpu::SplineSpec< DataT, XdimT, YdimT, 0 >.

Public Types

typedef Spline1D< DataT >::SafetyLevel SafetyLevel
 
typedef Spline1D< DataT >::Knot Knot
 

Public Member Functions

 GPUd () static const expr int32_t getVersion()
 _____________ Version control __________________________
 
 SplineContainer ()=default
 _____________ C++ constructors / destructors __________________________
 
 SplineContainer (const SplineContainer &)=delete
 Disable all other constructors.
 
 ~SplineContainer ()=default
 Destructor.
 
void approximateFunction (const double xMin[], const double xMax[], std::function< void(const double x[], double f[])> F, const int32_t nAuxiliaryDataPoints[]=nullptr)
 _______________ Construction interface ________________________
 
int32_t writeToFile (TFile &outf, const char *name)
 _______________ IO ________________________
 
 GPUd () int32_t getXdimensions() const
 _______________ Getters ________________________
 
 GPUd () int32_t getYdimensions() const
 Get number of Y dimensions.
 
 GPUd () static const expr size_t getParameterAlignmentBytes()
 Get minimal required alignment for the spline parameters.
 
 GPUd () int32_t getNumberOfParameters() const
 Number of parameters.
 
 GPUd () size_t getSizeOfParameters() const
 Size of the parameter array in bytes.
 
 GPUd () int32_t getNumberOfKnots() const
 Get a number of knots.
 
 GPUd () int32_t getNumberOfParametersPerKnot() const
 Number of parameters per knot.
 
 GPUd () const Spline1D< DataT > &getGrid(int32_t dimX) const
 Get 1-D grid for dimX dimension.
 
 GPUd () void getKnotU(int32_t iKnot
 Get u[] coordinate of i-th knot.
 
 GPUd () int32_t getKnotIndex(const int32_t iKnot[]) const
 Get index of a knot (iKnot1,iKnot2,..,iKnotN)
 
 GPUd () DataT *getParameters()
 Get spline parameters.
 
 GPUd () const DataT *getParameters() const
 Get spline parameters const.
 
 GPUd () size_t getGridOffset(int32_t dimX) const
 _______________ Technical stuff ________________________
 
 GPUd () void setXrange(const DataT xMin[]
 Set X range.
 
void print () const
 Print method.
 
 GPUd () int32_t calcNumberOfParameters(int32_t nYdim) const
 _______________ Expert tools _______________
 
 GPUd () int32_t calcNumberOfParametersPerKnot(int32_t nYdim) const
 Number of parameters per knot.
 
void cloneFromObject (const SplineContainer &obj, char *newFlatBufferPtr)
 
void moveBufferTo (char *newBufferPtr)
 
void destroy ()
 
void setActualBufferAddress (char *actualFlatBufferPtr)
 
void setFutureBufferAddress (char *futureFlatBufferPtr)
 
charreleaseInternalBuffer ()
 _____________ Methods for making the data buffer external __________________________
 
- Public Member Functions inherited from o2::gpu::FlatObject
 FlatObject ()=default
 _____________ Constructors / destructors __________________________
 
 ~FlatObject ()
 
 FlatObject (const FlatObject &)=delete
 
FlatObjectoperator= (const FlatObject &)=delete
 
void destroy ()
 _______________ Utilities _______________________________________________
 
size_t getFlatBufferSize () const
 Gives size of the flat buffer.
 
const chargetFlatBufferPtr () 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 SplineContainerreadFromFile (TFile &inpf, const char *name)
 read a class object from the file
 
static int32_t test (const bool draw=0, const bool drawDataPoints=1)
 _______________ Test tools _______________
 
static constexpr size_t getBufferAlignmentBytes ()
 _____________ FlatObject functionality, see FlatObject class for description ____________
 
static constexpr size_t getClassAlignmentBytes ()
 _____________ Memory alignment __________________________
 
- Static Public Member Functions inherited from o2::gpu::FlatObject
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.
 

Public Attributes

int32_t u[] const
 
const DataT xMax []
 

Protected Member Functions

void recreate (int32_t nXdim, int32_t nYdim, const int32_t nKnots[])
 Constructor for a regular spline.
 
void recreate (int32_t nXdim, int32_t nYdim, const int32_t nKnots[], const int32_t *const knotU[])
 Constructor for an irregular spline.
 
 ClassDefNV (SplineContainer, 1)
 (transient!!) F-dependent parameters of the spline
 
- Protected Member Functions inherited from o2::gpu::FlatObject
void startConstruction ()
 _____________ Construction _________
 
void finishConstruction (int32_t flatBufferSize)
 
void cloneFromObject (const FlatObject &obj, char *newFlatBufferPtr)
 
charreleaseInternalBuffer ()
 _____________ 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.
 

Protected Attributes

int32_t mXdim = 0
 _____________ Data members ____________
 
int32_t mYdim = 0
 dimentionality of Y
 
int32_t mNknots = 0
 number of spline knots
 
Spline1D< DataT > * mGrid
 
DataT * mParameters
 (transient!!) mXdim grids
 
- Protected Attributes inherited from o2::gpu::FlatObject
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
 
charmFlatBufferContainer = nullptr
 
charmFlatBufferPtr = nullptr
 

Additional Inherited Members

- Protected Types inherited from o2::gpu::FlatObject
enum  ConstructionState : uint32_t { NotConstructed = 0x0 , Constructed = 0x1 , InProgress = 0x2 }
 GPUCA_GPUCODE. More...
 
- Static Protected Member Functions inherited from o2::gpu::FlatObject
static constexpr size_t getClassAlignmentBytes ()
 _____________ Memory alignment __________________________
 
static constexpr size_t getBufferAlignmentBytes ()
 Gives minimal alignment in bytes required for the flat buffer.
 

Detailed Description

template<typename DataT>
class o2::gpu::SplineContainer< DataT >

================================================================================================== The class SplineContainer is a base Spline class. It contains all the class members and those methods which only depends on the DataT data type. It also contains all non-inlined methods with the implementation in SplineSpec.cxx file.

DataT is a data type, which is supposed to be either double or float. For other possible data types one has to add the corresponding instantiation line at the end of the SplineSpec.cxx file

Definition at line 47 of file SplineSpec.h.

Member Typedef Documentation

◆ Knot

template<typename DataT >
typedef Spline1D<DataT>::Knot o2::gpu::SplineContainer< DataT >::Knot

Definition at line 51 of file SplineSpec.h.

◆ SafetyLevel

template<typename DataT >
typedef Spline1D<DataT>::SafetyLevel o2::gpu::SplineContainer< DataT >::SafetyLevel

Definition at line 50 of file SplineSpec.h.

Constructor & Destructor Documentation

◆ SplineContainer() [1/2]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::SplineContainer ( )
default

_____________ C++ constructors / destructors __________________________

Default constructor

◆ SplineContainer() [2/2]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::SplineContainer ( const SplineContainer< DataT > &  )
delete

Disable all other constructors.

◆ ~SplineContainer()

template<typename DataT >
o2::gpu::SplineContainer< DataT >::~SplineContainer ( )
default

Destructor.

Member Function Documentation

◆ approximateFunction()

template<typename DataT >
void SplineContainer::approximateFunction ( const double  xMin[],
const double  xMax[],
std::function< void(const double x[], double f[])>  F,
const int32_t  nAuxiliaryDataPoints[] = nullptr 
)

_______________ Construction interface ________________________

approximate a function F with this spline

approximate a function F with this spline

Definition at line 199 of file SplineSpec.cxx.

◆ ClassDefNV()

template<typename DataT >
o2::gpu::SplineContainer< DataT >::ClassDefNV ( SplineContainer< DataT >  ,
 
)
protected

(transient!!) F-dependent parameters of the spline

◆ cloneFromObject()

template<typename DataT >
void SplineContainer::cloneFromObject ( const SplineContainer< DataT > &  obj,
char newFlatBufferPtr 
)

See FlatObject for description

Definition at line 100 of file SplineSpec.cxx.

◆ destroy()

template<typename DataT >
void SplineContainer::destroy ( )

See FlatObject for description

Definition at line 46 of file SplineSpec.cxx.

◆ getBufferAlignmentBytes()

template<typename DataT >
static constexpr size_t o2::gpu::FlatObject::getBufferAlignmentBytes ( )
inlinestaticconstexpr

_____________ FlatObject functionality, see FlatObject class for description ____________

Definition at line 197 of file FlatObject.h.

◆ getClassAlignmentBytes()

template<typename DataT >
static constexpr size_t o2::gpu::FlatObject::getClassAlignmentBytes ( )
inlinestaticconstexpr

_____________ Memory alignment __________________________

Gives minimal alignment in bytes required for the class object

Definition at line 194 of file FlatObject.h.

◆ GPUd() [1/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( ) const
inline

Get spline parameters const.

Definition at line 124 of file SplineSpec.h.

◆ GPUd() [2/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( ) const &
inline

Get 1-D grid for dimX dimension.

Definition at line 112 of file SplineSpec.h.

◆ GPUd() [3/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( )
inline

Get spline parameters.

Definition at line 121 of file SplineSpec.h.

◆ GPUd() [4/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( ) const
inline

_______________ Expert tools _______________

Number of parameters for given Y dimensions

Definition at line 140 of file SplineSpec.h.

◆ GPUd() [5/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( ) const
inline

Number of parameters per knot.

Definition at line 146 of file SplineSpec.h.

◆ GPUd() [6/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( ) const

Get index of a knot (iKnot1,iKnot2,..,iKnotN)

◆ GPUd() [7/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( ) const
inline

Get a number of knots.

Definition at line 106 of file SplineSpec.h.

◆ GPUd() [8/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( ) const
inline

Number of parameters.

Definition at line 100 of file SplineSpec.h.

◆ GPUd() [9/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( ) const
inline

Number of parameters per knot.

Definition at line 109 of file SplineSpec.h.

◆ GPUd() [10/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( ) const
inline

_______________ Getters ________________________

Get number of X dimensions

Definition at line 91 of file SplineSpec.h.

◆ GPUd() [11/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( ) const
inline

Get number of Y dimensions.

Definition at line 94 of file SplineSpec.h.

◆ GPUd() [12/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( ) const
inline

_______________ Technical stuff ________________________

Get offset of Grid[dimX] flat data in the flat buffer

Definition at line 129 of file SplineSpec.h.

◆ GPUd() [13/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( ) const
inline

Size of the parameter array in bytes.

Definition at line 103 of file SplineSpec.h.

◆ GPUd() [14/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( ) const
inline

_____________ Version control __________________________

Version control

Definition at line 56 of file SplineSpec.h.

◆ GPUd() [15/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( ) const
inline

Get minimal required alignment for the spline parameters.

Definition at line 97 of file SplineSpec.h.

◆ GPUd() [16/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( )

Get u[] coordinate of i-th knot.

◆ GPUd() [17/17]

template<typename DataT >
o2::gpu::SplineContainer< DataT >::GPUd ( ) const

Set X range.

◆ moveBufferTo()

template<typename DataT >
void SplineContainer::moveBufferTo ( char newBufferPtr)

See FlatObject for description

Definition at line 120 of file SplineSpec.cxx.

◆ print()

template<typename DataT >
void SplineContainer::print ( ) const

Print method.

Definition at line 88 of file SplineSpec.cxx.

◆ readFromFile()

template<typename DataT >
SplineContainer< DataT > * SplineContainer::readFromFile ( TFile &  inpf,
const char name 
)
static

read a class object from the file

read a class object from the file

Definition at line 217 of file SplineSpec.cxx.

◆ recreate() [1/2]

template<typename DataT >
void SplineContainer::recreate ( int32_t  nXdim,
int32_t  nYdim,
const int32_t  nKnots[] 
)
protected

Constructor for a regular spline.

Constructor for a regular spline

Definition at line 187 of file SplineSpec.cxx.

◆ recreate() [2/2]

template<typename DataT >
void SplineContainer::recreate ( int32_t  nXdim,
int32_t  nYdim,
const int32_t  nKnots[],
const int32_t *const  knotU[] 
)
protected

Constructor for an irregular spline.

Constructor for an irregular spline

Definition at line 131 of file SplineSpec.cxx.

◆ releaseInternalBuffer()

template<typename DataT >
char * o2::gpu::FlatObject::releaseInternalBuffer ( )
inline

_____________ Methods for making the data buffer external __________________________

Definition at line 220 of file FlatObject.h.

◆ setActualBufferAddress()

template<typename DataT >
void SplineContainer::setActualBufferAddress ( char actualFlatBufferPtr)

See FlatObject for description

Definition at line 58 of file SplineSpec.cxx.

◆ setFutureBufferAddress()

template<typename DataT >
void SplineContainer::setFutureBufferAddress ( char futureFlatBufferPtr)

See FlatObject for description

Definition at line 75 of file SplineSpec.cxx.

◆ test()

template<typename DataT >
int32_t SplineContainer::test ( const bool  draw = 0,
const bool  drawDataPoints = 1 
)
static

_______________ Test tools _______________

Test the class functionality

Definition at line 225 of file SplineSpec.cxx.

◆ writeToFile()

template<typename DataT >
int32_t SplineContainer::writeToFile ( TFile &  outf,
const char name 
)

_______________ IO ________________________

write a class object to the file

write a class object to the file

Definition at line 210 of file SplineSpec.cxx.

Member Data Documentation

◆ const

template<typename DataT >
int32_t u [] o2::gpu::SplineContainer< DataT >::const

Definition at line 115 of file SplineSpec.h.

◆ mGrid

template<typename DataT >
Spline1D<DataT>* o2::gpu::SplineContainer< DataT >::mGrid
protected

Definition at line 189 of file SplineSpec.h.

◆ mNknots

template<typename DataT >
int32_t o2::gpu::SplineContainer< DataT >::mNknots = 0
protected

number of spline knots

Definition at line 187 of file SplineSpec.h.

◆ mParameters

template<typename DataT >
DataT* o2::gpu::SplineContainer< DataT >::mParameters
protected

(transient!!) mXdim grids

Definition at line 190 of file SplineSpec.h.

◆ mXdim

template<typename DataT >
int32_t o2::gpu::SplineContainer< DataT >::mXdim = 0
protected

_____________ Data members ____________

dimentionality of X

Definition at line 185 of file SplineSpec.h.

◆ mYdim

template<typename DataT >
int32_t o2::gpu::SplineContainer< DataT >::mYdim = 0
protected

dimentionality of Y

Definition at line 186 of file SplineSpec.h.

◆ xMax

template<typename DataT >
const DataT o2::gpu::SplineContainer< DataT >::xMax[]

Definition at line 132 of file SplineSpec.h.


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