13#ifndef TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
14#define TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
36 void* allocate(
size_t size)
override;
39template <
int nLayers = 7>
159 void allocMemAsync(
void**,
size_t,
Stream*,
bool);
160 bool mHostRegistered =
false;
161 std::vector<GpuTimeFrameChunk<nLayers>> mMemChunks;
166 std::array<
int, nLayers - 1> mNTracklets;
167 std::array<
int, nLayers - 2> mNCells;
174 uint8_t* mMultMaskDevice;
175 Vertex* mPrimaryVerticesDevice;
176 int* mROFramesPVDevice;
177 std::array<Cluster*, nLayers> mClustersDevice;
178 std::array<Cluster*, nLayers> mUnsortedClustersDevice;
179 std::array<int*, nLayers> mClustersIndexTablesDevice;
180 std::array<unsigned char*, nLayers> mUsedClustersDevice;
181 std::array<int*, nLayers> mROFramesClustersDevice;
182 const Cluster** mClustersDeviceArray;
183 const Cluster** mUnsortedClustersDeviceArray;
184 const int** mClustersIndexTablesDeviceArray;
185 const unsigned char** mUsedClustersDeviceArray;
186 const int** mROFrameClustersDeviceArray;
187 std::array<
Tracklet*, nLayers - 1> mTrackletsDevice;
189 std::array<
int*, nLayers - 1> mTrackletsLUTDevice;
190 std::array<
int*, nLayers - 2> mCellsLUTDevice;
191 std::array<
int*, nLayers - 3> mNeighboursLUTDevice;
193 int** mCellsLUTDeviceArray;
194 int** mNeighboursCellDeviceArray;
195 int** mNeighboursCellLUTDeviceArray;
196 int** mTrackletsLUTDeviceArray;
197 std::array<
CellSeed*, nLayers - 2> mCellsDevice;
198 std::array<
int*, nLayers - 2> mNeighboursIndexTablesDevice;
203 std::array<
float*, nLayers - 2> mCellSeedsChi2Device;
204 float** mCellSeedsChi2DeviceArray;
206 Road<nLayers - 2>* mRoadsDevice;
208 std::array<gpuPair<int, int>*, nLayers - 2> mNeighbourPairsDevice;
209 std::array<
int*, nLayers - 2> mNeighboursDevice;
210 int** mNeighboursDeviceArray;
211 std::array<TrackingFrameInfo*, nLayers> mTrackingFrameInfoDevice;
212 const TrackingFrameInfo** mTrackingFrameInfoDeviceArray;
215 std::vector<Stream> mGpuStreams;
217 bool mFirstInit =
true;
220 std::vector<std::vector<Vertex>> mVerticesInChunks;
221 std::vector<std::vector<int>> mNVerticesInChunks;
222 std::vector<std::vector<o2::MCCompLabel>> mLabelsInChunks;
225 std::vector<TrackITSExt> mTrackITSExt;
228template <
int nLayers>
234 mMemChunks[chunk].reset(task, mGpuStreams[chunk]);
235 if constexpr ((bool)task) {
236 nRof = mMemChunks[chunk].loadDataOnDevice(
offset, maxRofs, 3, mGpuStreams[chunk]);
238 nRof = mMemChunks[chunk].loadDataOnDevice(
offset, maxRofs, nLayers, mGpuStreams[chunk]);
240 LOGP(
debug,
"In chunk {}: loaded {} readout frames starting from {}", chunk, nRof,
offset);
244template <
int nLayers>
247 return static_cast<int>(mROFramesClusters[layerId][(rofIdstart + rofSpanSize) < mROFramesClusters.size() ? rofIdstart + rofSpanSize : mROFramesClusters.size() - 1] - mROFramesClusters[layerId][rofIdstart]);
250template <
int nLayers>
253 std::vector<unsigned int>
sizes(mUnsortedClusters.size());
254 std::transform(mUnsortedClusters.begin(), mUnsortedClusters.end(),
sizes.begin(),
255 [](
const auto&
v) { return static_cast<unsigned int>(v.size()); });
259template <
int nLayers>
262 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)
Stream & getStream(const size_t stream)
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
GpuTimeFrameChunk< nLayers > & getChunk(const int chunk)
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)
size_t getNChunks() const
void createNeighboursDeviceArray()
std::vector< std::vector< Vertex > > & getVerticesInChunks()
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 initDeviceChunks(const 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)
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)
std::vector< std::vector< int > > & getNVerticesInChunks()
o2::track::TrackParCovF ** getDeviceArrayTrackSeeds()
int getNAllocatedROFs() const
void downloadTrackITSExtDevice(std::vector< CellSeed > &)
int * getDeviceROFramesPV()
gsl::span< int * > getDeviceNeighboursLUTs()
std::vector< unsigned int > getClusterSizes()
StaticTrackingParameters< nLayers > * getDeviceTrackingParameters()
const o2::base::Propagator * getChainPropagator()
int ** getDeviceArrayNeighboursCellLUT() const
void createUsedClustersDevice(const int)
const int ** getDeviceROframeClusters() const
gsl::span< CellSeed * > getDeviceCells()
int ** getDeviceArrayTrackletsLUT() const
size_t loadChunkData(const size_t, const size_t, const size_t)
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)
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()
std::vector< std::vector< o2::MCCompLabel > > & getLabelsInChunks()
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.