13#ifndef TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
14#define TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
30 void* allocate(
size_t size)
override;
33template <
int nLayers = 7>
86 return *mGpuStreams[
stream];
145 void allocMemAsync(
void**,
size_t,
Stream*,
bool);
146 bool mHostRegistered =
false;
150 std::array<
int, nLayers - 1> mNTracklets;
151 std::array<
int, nLayers - 2> mNCells;
157 uint8_t* mMultMaskDevice;
158 Vertex* mPrimaryVerticesDevice;
159 int* mROFramesPVDevice;
160 std::array<Cluster*, nLayers> mClustersDevice;
161 std::array<Cluster*, nLayers> mUnsortedClustersDevice;
162 std::array<int*, nLayers> mClustersIndexTablesDevice;
163 std::array<unsigned char*, nLayers> mUsedClustersDevice;
164 std::array<int*, nLayers> mROFramesClustersDevice;
165 const Cluster** mClustersDeviceArray;
166 const Cluster** mUnsortedClustersDeviceArray;
167 const int** mClustersIndexTablesDeviceArray;
168 const unsigned char** mUsedClustersDeviceArray;
169 const int** mROFrameClustersDeviceArray;
170 std::array<
Tracklet*, nLayers - 1> mTrackletsDevice;
172 std::array<
int*, nLayers - 1> mTrackletsLUTDevice;
173 std::array<
int*, nLayers - 2> mCellsLUTDevice;
174 std::array<
int*, nLayers - 3> mNeighboursLUTDevice;
176 int** mCellsLUTDeviceArray;
177 int** mNeighboursCellDeviceArray;
178 int** mNeighboursCellLUTDeviceArray;
179 int** mTrackletsLUTDeviceArray;
180 std::array<
CellSeed*, nLayers - 2> mCellsDevice;
181 std::array<
int*, nLayers - 2> mNeighboursIndexTablesDevice;
186 std::array<
float*, nLayers - 2> mCellSeedsChi2Device;
187 float** mCellSeedsChi2DeviceArray;
189 Road<nLayers - 2>* mRoadsDevice;
191 std::array<gpuPair<int, int>*, nLayers - 2> mNeighbourPairsDevice;
192 std::array<
int*, nLayers - 2> mNeighboursDevice;
193 int** mNeighboursDeviceArray;
194 std::array<TrackingFrameInfo*, nLayers> mTrackingFrameInfoDevice;
198 std::vector<Stream*> mGpuStreams;
200 bool mFirstInit =
true;
206template <
int nLayers>
209 return static_cast<int>(this->mROFramesClusters[layerId][(rofIdstart + rofSpanSize) < this->mROFramesClusters.size() ? rofIdstart + rofSpanSize : this->mROFramesClusters.size() - 1] - this->mROFramesClusters[layerId][rofIdstart]);
212template <
int nLayers>
215 std::vector<unsigned int>
sizes(this->mUnsortedClusters.size());
216 std::transform(this->mUnsortedClusters.begin(), this->mUnsortedClusters.end(),
sizes.begin(),
217 [](
const auto&
v) { return static_cast<unsigned int>(v.size()); });
221template <
int nLayers>
224 return std::accumulate(mNCells.begin(), mNCells.end(), 0);
void loadCellsLUTDevice()
const TrackingFrameInfo ** getDeviceArrayTrackingFrameInfo() const
gsl::span< int * > getDeviceCellLUTs()
void createNeighboursDevice(const unsigned int layer, const unsigned int nNeighbours)
void loadROframeClustersDevice(const int)
IndexTableUtils * getDeviceIndexTableUtils()
const unsigned char ** getDeviceArrayUsedClusters() const
const int ** getDeviceArrayClustersIndexTables() const
void createCellsLUTDevice()
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
void loadTrackingFrameInfoDevice(const int)
int * getDeviceNeighbours(const int layer)
void loadTrackSeedsChi2Device()
int * getDeviceNeighboursIndexTables(const int layer)
void loadIndexTableUtils(const int)
float ** getDeviceArrayTrackSeedsChi2()
void loadTrackletsLUTDevice()
void loadTrackSeedsDevice()
void createNeighboursLUTDevice(const int, const unsigned int)
Tracklet ** getDeviceArrayTracklets()
TrackingFrameInfo * getDeviceTrackingFrameInfo(const int)
void createNeighboursDeviceArray()
void downloadCellsDevice()
void createTrackletsLUTDevice(const int)
int ** getDeviceNeighboursArray()
uint8_t * getDeviceMultCutMask()
int getNClustersInRofSpan(const int, const int, const int) const
interface
gsl::span< int, nLayers - 2 > getNCells()
void setDevicePropagator(const o2::base::PropagatorImpl< float > *) override
std::array< int *, nLayers - 2 > & getDeviceNeighboursAll()
gsl::span< Tracklet * > getDeviceTracklet()
CellSeed ** getDeviceArrayCells() const
void loadUsedClustersDevice()
void createTrackITSExtDevice(bounded_vector< CellSeed > &)
int getNumberOfCells() const
void downloadNeighboursLUTDevice(bounded_vector< int > &, const int)
void createNeighboursDevice(const unsigned int layer, std::vector< std::pair< int, int > > &neighbours)
void loadVertices(const int)
int * getDeviceNeighboursLUT(const int layer)
Road< nLayers - 2 > * getDeviceRoads()
CellSeed * getDeviceTrackSeeds()
void createTrackletsBuffers()
void registerHostMemory(const int)
Most relevant operations.
void loadClustersIndexTables(const int iteration)
o2::track::TrackParCovF ** getDeviceArrayTrackSeeds()
int * getDeviceROFramesPV()
gsl::span< int * > getDeviceNeighboursLUTs()
std::vector< unsigned int > getClusterSizes()
const o2::base::Propagator * getChainPropagator()
int ** getDeviceArrayNeighboursCellLUT() const
void createUsedClustersDevice(const int)
const int ** getDeviceROframeClusters() const
gsl::span< CellSeed * > getDeviceCells()
int ** getDeviceArrayTrackletsLUT() const
void loadTrackSeedsDevice(bounded_vector< CellSeed > &)
gsl::span< int * > getDeviceTrackletsLUTs()
void downloadCellsNeighboursDevice(std::vector< bounded_vector< std::pair< int, int > > > &, const int)
void createCellsBuffers(const int)
void downloadCellsLUTDevice()
unsigned char * getDeviceUsedClusters(const int)
gpuPair< int, int > * getDeviceNeighbourPairs(const int layer)
std::array< int, nLayers - 2 > & getArrayNCells()
void loadClustersDevice(const int)
Stream & getStream(const size_t stream)
TrackITSExt * getDeviceTrackITSExt()
void loadMultiplicityCutMask(const int)
int ** getDeviceArrayCellsLUT() const
void loadUnsortedClustersDevice(const int)
int * getDeviceROFramesClusters(const int layer)
const Cluster ** getDeviceArrayClusters() const
void createNeighboursIndexTablesDevice()
void unregisterHostMemory(const int)
Vertex * getDeviceVertices()
void downloadTrackITSExtDevice(bounded_vector< CellSeed > &)
gsl::span< int, nLayers - 1 > getNTracklets()
void loadTrackletsDevice()
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
GLenum GLuint GLint GLint layer
std::pmr::vector< T > bounded_vector
TrackParametrizationWithError< float > TrackParCovF
Common utility functions.