13#ifndef TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
14#define TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
27template <
int nLayers = 7>
158 void allocMemAsync(
void**,
size_t,
Stream&,
bool);
159 void allocMem(
void**,
size_t,
bool);
163 std::
array<
int, nLayers - 1> mNTracklets;
164 std::
array<
int, nLayers - 2> mNCells;
165 std::
array<
int, nLayers - 3> mNNeighbours;
171 uint8_t* mMultMaskDevice;
172 Vertex* mPrimaryVerticesDevice;
173 int* mROFramesPVDevice;
176 std::
array<
int*, nLayers> mClustersIndexTablesDevice;
177 std::
array<
unsigned char*, nLayers> mUsedClustersDevice;
178 std::
array<
int*, nLayers> mROFramesClustersDevice;
179 const
Cluster** mClustersDeviceArray;
180 const
Cluster** mUnsortedClustersDeviceArray;
181 const
int** mClustersIndexTablesDeviceArray;
182 const
unsigned char** mUsedClustersDeviceArray;
183 const
int** mROFramesClustersDeviceArray;
185 std::
array<
int*, nLayers - 1> mTrackletsLUTDevice;
186 std::
array<
int*, nLayers - 2> mCellsLUTDevice;
187 std::
array<
int*, nLayers - 3> mNeighboursLUTDevice;
189 Tracklet** mTrackletsDeviceArray{
nullptr};
190 int** mCellsLUTDeviceArray{
nullptr};
191 int** mNeighboursCellDeviceArray{
nullptr};
192 int** mNeighboursCellLUTDeviceArray{
nullptr};
193 int** mTrackletsLUTDeviceArray{
nullptr};
196 std::array<
int*,
nLayers - 3> mNeighboursIndexTablesDevice;
200 std::array<
float*,
nLayers - 2> mCellSeedsChi2Device;
201 float** mCellSeedsChi2DeviceArray;
203 Road<
nLayers - 2>* mRoadsDevice;
204 TrackITSExt* mTrackITSExtDevice;
205 std::array<gpuPair<int, int>*,
nLayers - 2> mNeighbourPairsDevice;
206 std::array<
int*,
nLayers - 2> mNeighboursDevice;
207 std::array<TrackingFrameInfo*, nLayers> mTrackingFrameInfoDevice;
208 const TrackingFrameInfo** mTrackingFrameInfoDeviceArray;
212 std::bitset<nLayers + 1> mPinnedUnsortedClusters{0};
213 std::bitset<nLayers + 1> mPinnedClusters{0};
214 std::bitset<nLayers + 1> mPinnedClustersIndexTables{0};
215 std::bitset<nLayers + 1> mPinnedUsedClusters{0};
216 std::bitset<nLayers + 1> mPinnedROFramesClusters{0};
217 std::bitset<nLayers + 1> mPinnedTrackingFrameInfo{0};
220 bounded_vector<TrackITSExt> mTrackITSExt;
223template <
int nLayers>
226 return static_cast<int>(this->mROFramesClusters[layerId][(rofIdstart + rofSpanSize) < this->mROFramesClusters.size() ? rofIdstart + rofSpanSize : this->mROFramesClusters.size() - 1] - this->mROFramesClusters[layerId][rofIdstart]);
229template <
int nLayers>
232 std::vector<unsigned int>
sizes(this->mUnsortedClusters.size());
233 std::transform(this->mUnsortedClusters.begin(), this->mUnsortedClusters.end(),
sizes.begin(),
234 [](
const auto&
v) { return static_cast<unsigned int>(v.size()); });
238template <
int nLayers>
241 return std::accumulate(mNTracklets.begin(), mNTracklets.end(), 0);
244template <
int nLayers>
247 return std::accumulate(mNCells.begin(), mNCells.end(), 0);
250template <
int nLayers>
253 return std::accumulate(mNNeighbours.begin(), mNNeighbours.end(), 0);
void loadCellsLUTDevice()
const TrackingFrameInfo ** getDeviceArrayTrackingFrameInfo() const
gsl::span< int * > getDeviceCellLUTs()
gsl::span< CellSeedN * > getDeviceCells()
void createCellsBuffersArray(const int)
IndexTableUtils * getDeviceIndexTableUtils()
const unsigned char ** getDeviceArrayUsedClusters() const
void loadTrackSeedsDevice(bounded_vector< CellSeedN > &)
const int ** getDeviceArrayClustersIndexTables() const
void initDeviceSAFitting()
void initDevice(IndexTableUtils *, const TrackingParameters &trkParam, const TimeFrameGPUParameters &, const int, const int)
void initialise(const int, const TrackingParameters &, const int, IndexTableUtils *utils=nullptr, const TimeFrameGPUParameters *pars=nullptr)
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 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
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
constexpr unsigned int nLayers
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