13#ifndef TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
14#define TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
34 void* allocate(
size_t size)
override;
37template <
int nLayers = 7>
90 return *mGpuStreams[
stream];
149 void allocMemAsync(
void**,
size_t,
Stream*,
bool);
150 bool mHostRegistered =
false;
154 std::array<
int, nLayers - 1> mNTracklets;
155 std::array<
int, nLayers - 2> mNCells;
161 uint8_t* mMultMaskDevice;
162 Vertex* mPrimaryVerticesDevice;
163 int* mROFramesPVDevice;
164 std::array<Cluster*, nLayers> mClustersDevice;
165 std::array<Cluster*, nLayers> mUnsortedClustersDevice;
166 std::array<int*, nLayers> mClustersIndexTablesDevice;
167 std::array<unsigned char*, nLayers> mUsedClustersDevice;
168 std::array<int*, nLayers> mROFramesClustersDevice;
169 const Cluster** mClustersDeviceArray;
170 const Cluster** mUnsortedClustersDeviceArray;
171 const int** mClustersIndexTablesDeviceArray;
172 const unsigned char** mUsedClustersDeviceArray;
173 const int** mROFrameClustersDeviceArray;
174 std::array<
Tracklet*, nLayers - 1> mTrackletsDevice;
176 std::array<
int*, nLayers - 1> mTrackletsLUTDevice;
177 std::array<
int*, nLayers - 2> mCellsLUTDevice;
178 std::array<
int*, nLayers - 3> mNeighboursLUTDevice;
180 int** mCellsLUTDeviceArray;
181 int** mNeighboursCellDeviceArray;
182 int** mNeighboursCellLUTDeviceArray;
183 int** mTrackletsLUTDeviceArray;
184 std::array<
CellSeed*, nLayers - 2> mCellsDevice;
185 std::array<
int*, nLayers - 2> mNeighboursIndexTablesDevice;
190 std::array<
float*, nLayers - 2> mCellSeedsChi2Device;
191 float** mCellSeedsChi2DeviceArray;
193 Road<nLayers - 2>* mRoadsDevice;
195 std::array<gpuPair<int, int>*, nLayers - 2> mNeighbourPairsDevice;
196 std::array<
int*, nLayers - 2> mNeighboursDevice;
197 int** mNeighboursDeviceArray;
198 std::array<TrackingFrameInfo*, nLayers> mTrackingFrameInfoDevice;
199 const TrackingFrameInfo** mTrackingFrameInfoDeviceArray;
202 std::vector<Stream*> mGpuStreams;
204 bool mFirstInit =
true;
207 std::vector<TrackITSExt> mTrackITSExt;
210template <
int nLayers>
213 return static_cast<int>(mROFramesClusters[layerId][(rofIdstart + rofSpanSize) < mROFramesClusters.size() ? rofIdstart + rofSpanSize : mROFramesClusters.size() - 1] - mROFramesClusters[layerId][rofIdstart]);
216template <
int nLayers>
219 std::vector<unsigned int>
sizes(mUnsortedClusters.size());
220 std::transform(mUnsortedClusters.begin(), mUnsortedClusters.end(),
sizes.begin(),
221 [](
const auto&
v) { return static_cast<unsigned int>(v.size()); });
225template <
int nLayers>
228 return std::accumulate(mNCells.begin(), mNCells.end(), 0);
GPU-compliant version of ClusterLines, for the moment separated, might create a common traits for Clu...
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 downloadNeighboursLUTDevice(std::vector< int > &, const int)
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
void createTrackITSExtDevice(std::vector< CellSeed > &)
std::array< int *, nLayers - 2 > & getDeviceNeighboursAll()
gsl::span< Tracklet * > getDeviceTracklet()
CellSeed ** getDeviceArrayCells() const
void loadUsedClustersDevice()
int getNumberOfCells() const
void createNeighboursDevice(const unsigned int layer, std::vector< std::pair< int, int > > &neighbours)
void loadVertices(const int)
int * getDeviceNeighboursLUT(const int layer)
std::vector< o2::its::TrackITSExt > & getTrackITSExt()
Road< nLayers - 2 > * getDeviceRoads()
CellSeed * getDeviceTrackSeeds()
void createTrackletsBuffers()
void registerHostMemory(const int)
Most relevant operations.
void loadClustersIndexTables(const int iteration)
o2::track::TrackParCovF ** getDeviceArrayTrackSeeds()
void downloadTrackITSExtDevice(std::vector< CellSeed > &)
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
gsl::span< int * > getDeviceTrackletsLUTs()
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)
void loadTrackSeedsDevice(std::vector< CellSeed > &)
int * getDeviceROFramesClusters(const int layer)
const Cluster ** getDeviceArrayClusters() const
void createNeighboursIndexTablesDevice()
void downloadCellsNeighboursDevice(std::vector< std::vector< std::pair< int, int > > > &, const int)
void unregisterHostMemory(const int)
Vertex * getDeviceVertices()
gsl::span< int, nLayers - 1 > getNTracklets()
void loadTrackletsDevice()
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
GLenum GLuint GLint GLint layer
TrackParametrizationWithError< float > TrackParCovF
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Common utility functions.