13#ifndef TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
14#define TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
27template <
int nLayers = 7>
159 void allocMemAsync(
void**,
size_t,
Stream&,
bool);
160 void allocMem(
void**,
size_t,
bool);
164 std::
array<
int, nLayers - 1> mNTracklets;
165 std::
array<
int, nLayers - 2> mNCells;
166 std::
array<
int, nLayers - 3> mNNeighbours;
172 uint8_t* mMultMaskDevice;
173 Vertex* mPrimaryVerticesDevice;
174 int* mROFramesPVDevice;
177 std::
array<
int*, nLayers> mClustersIndexTablesDevice;
178 std::
array<
unsigned char*, nLayers> mUsedClustersDevice;
179 std::
array<
int*, nLayers> mROFramesClustersDevice;
180 const
Cluster** mClustersDeviceArray;
181 const
Cluster** mUnsortedClustersDeviceArray;
182 const
int** mClustersIndexTablesDeviceArray;
183 const
unsigned char** mUsedClustersDeviceArray;
184 const
int** mROFramesClustersDeviceArray;
186 std::
array<
int*, nLayers - 1> mTrackletsLUTDevice;
187 std::
array<
int*, nLayers - 2> mCellsLUTDevice;
188 std::
array<
int*, nLayers - 3> mNeighboursLUTDevice;
190 Tracklet** mTrackletsDeviceArray{
nullptr};
191 int** mCellsLUTDeviceArray{
nullptr};
192 int** mNeighboursCellDeviceArray{
nullptr};
193 int** mNeighboursCellLUTDeviceArray{
nullptr};
194 int** mTrackletsLUTDeviceArray{
nullptr};
197 std::array<
int*,
nLayers - 3> mNeighboursIndexTablesDevice;
201 std::array<
float*,
nLayers - 2> mCellSeedsChi2Device;
202 float** mCellSeedsChi2DeviceArray;
204 Road<
nLayers - 2>* mRoadsDevice;
205 TrackITSExt* mTrackITSExtDevice;
206 std::array<gpuPair<int, int>*,
nLayers - 2> mNeighbourPairsDevice;
207 std::array<
int*,
nLayers - 2> mNeighboursDevice;
208 std::array<TrackingFrameInfo*, nLayers> mTrackingFrameInfoDevice;
209 const TrackingFrameInfo** mTrackingFrameInfoDeviceArray;
213 std::bitset<nLayers + 1> mPinnedUnsortedClusters{0};
214 std::bitset<nLayers + 1> mPinnedClusters{0};
215 std::bitset<nLayers + 1> mPinnedClustersIndexTables{0};
216 std::bitset<nLayers + 1> mPinnedUsedClusters{0};
217 std::bitset<nLayers + 1> mPinnedROFramesClusters{0};
218 std::bitset<nLayers + 1> mPinnedTrackingFrameInfo{0};
221 bounded_vector<TrackITSExt> mTrackITSExt;
224template <
int nLayers>
227 return static_cast<int>(this->mROFramesClusters[layerId][(rofIdstart + rofSpanSize) < this->mROFramesClusters.size() ? rofIdstart + rofSpanSize : this->mROFramesClusters.size() - 1] - this->mROFramesClusters[layerId][rofIdstart]);
230template <
int nLayers>
233 std::vector<unsigned int>
sizes(this->mUnsortedClusters.size());
234 std::transform(this->mUnsortedClusters.begin(), this->mUnsortedClusters.end(),
sizes.begin(),
235 [](
const auto&
v) { return static_cast<unsigned int>(v.size()); });
239template <
int nLayers>
242 return std::accumulate(mNTracklets.begin(), mNTracklets.end(), 0);
245template <
int nLayers>
248 return std::accumulate(mNCells.begin(), mNCells.end(), 0);
251template <
int nLayers>
254 return std::accumulate(mNNeighbours.begin(), mNNeighbours.end(), 0);
void loadCellsLUTDevice()
const TrackingFrameInfo ** getDeviceArrayTrackingFrameInfo() const
gsl::span< int * > getDeviceCellLUTs()
void initialise(const int, const TrackingParameters &, const int, IndexTableUtilsN *utils=nullptr, const TimeFrameGPUParameters *pars=nullptr)
gsl::span< CellSeedN * > getDeviceCells()
void createCellsBuffersArray(const int)
const unsigned char ** getDeviceArrayUsedClusters() const
void loadTrackSeedsDevice(bounded_vector< CellSeedN > &)
const int ** getDeviceArrayClustersIndexTables() const
void initDeviceSAFitting()
const Cluster ** getDeviceArrayUnsortedClusters() const
int * getDeviceNeighbours(const int layer)
void loadTrackSeedsChi2Device()
int * getDeviceNeighboursIndexTables(const int layer)
void loadIndexTableUtils(const int)
virtual void wipe() final
cleanup
const int ** getDeviceROFrameClusters() const
float ** getDeviceArrayTrackSeedsChi2()
auto & getArrayNNeighbours()
void loadTrackletsLUTDevice()
void loadTrackSeedsDevice()
void createNeighboursLUTDevice(const int, const unsigned int)
Tracklet ** getDeviceArrayTracklets()
void createClustersIndexTablesArray(const int iteration)
TrackingFrameInfo * getDeviceTrackingFrameInfo(const int)
void downloadCellsDevice()
void createTrackletsBuffersArray(const int)
int ** getDeviceNeighboursArray()
uint8_t * getDeviceMultCutMask()
int getNClustersInRofSpan(const int, const int, const int) const
interface
gsl::span< int, nLayers - 2 > getNCells()
void loadTrackingFrameInfoDevice(const int, const int)
void syncStreams(const bool=true)
std::array< int *, nLayers - 2 > & getDeviceNeighboursAll()
void loadUsedClustersDevice()
void downloadNeighboursLUTDevice(bounded_vector< int > &, const int)
void loadVertices(const int)
void createCellsLUTDevice(const int)
int * getDeviceNeighboursLUT(const int layer)
void waitEvent(const int, const int)
Road< nLayers - 2 > * getDeviceRoads()
void createTrackITSExtDevice(bounded_vector< CellSeedN > &)
void loadClustersDevice(const int, const int)
void initDevice(IndexTableUtilsN *, const TrackingParameters &trkParam, const TimeFrameGPUParameters &, const int, const int)
void createUsedClustersDeviceArray(const int)
void registerHostMemory(const int)
Most relevant operations.
o2::track::TrackParCovF ** getDeviceArrayTrackSeeds()
int getNumberOfCells() const final
void createUnsortedClustersDeviceArray(const int)
int * getDeviceROFramesPV()
void loadClustersIndexTables(const int, const int)
gsl::span< int * > getDeviceNeighboursLUTs()
std::vector< unsigned int > getClusterSizes()
const o2::base::Propagator * getChainPropagator()
void syncStream(const size_t stream)
void createClustersDeviceArray(const int)
int ** getDeviceArrayNeighboursCellLUT() const
CellSeedN ** getDeviceArrayCells()
void recordEvents(const int=0, const int=nLayers)
int ** getDeviceArrayTrackletsLUT() const
void setDevicePropagator(const o2::base::PropagatorImpl< float > *p) final
int getNumberOfTracklets() const final
gsl::span< int * > getDeviceTrackletsLUTs()
void downloadCellsNeighboursDevice(std::vector< bounded_vector< std::pair< int, int > > > &, const int)
void recordEvent(const int)
void createCellsBuffers(const int)
void createTrackingFrameInfoDeviceArray(const int)
void downloadCellsLUTDevice()
unsigned char * getDeviceUsedClusters(const int)
gpuPair< int, int > * getDeviceNeighbourPairs(const int layer)
void createTrackletsLUTDevice(const int, const int)
void createTrackletsBuffers(const int)
void downloadTrackITSExtDevice(bounded_vector< CellSeedN > &)
gsl::span< Tracklet * > getDeviceTracklets()
TrackITSExt * getDeviceTrackITSExt()
void loadMultiplicityCutMask(const int)
void loadUnsortedClustersDevice(const int, const int)
auto & getStream(const size_t stream)
synchronization
int ** getDeviceArrayCellsLUT() const
IndexTableUtilsN * getDeviceIndexTableUtils()
void createNeighboursDevice(const unsigned int layer)
gsl::span< int, nLayers - 3 > getNNeighbours()
int * getDeviceROFramesClusters(const int layer)
const Cluster ** getDeviceArrayClusters() const
void createTrackletsLUTDeviceArray(const int)
CellSeedN * getDeviceTrackSeeds()
void unregisterHostMemory(const int)
int getNumberOfNeighbours() const final
void createUsedClustersDevice(const int, const int)
void createNeighboursIndexTablesDevice(const int)
Vertex * getDeviceVertices()
gsl::span< int, nLayers - 1 > getNTracklets()
void loadTrackletsDevice()
void createROFrameClustersDeviceArray(const int)
void createCellsLUTDeviceArray(const int)
void loadROFrameClustersDevice(const int, const int)
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
GLenum GLuint GLint GLint layer
std::pair< T1, T2 > gpuPair
std::pmr::vector< T > bounded_vector
TrackParametrizationWithError< float > TrackParCovF
Defining DataPointCompositeObject explicitly as copiable.
Common utility functions.
const o2::base::PropagatorImpl< float > * mPropagatorDevice
CellSeed< nLayers > CellSeedN
IndexTableUtils< nLayers > IndexTableUtilsN