13#ifndef TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
14#define TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
29 void* allocate(
size_t size)
override;
32template <
int nLayers = 7>
85 return *mGpuStreams[
stream];
144 void allocMemAsync(
void**,
size_t,
Stream*,
bool);
145 bool mHostRegistered =
false;
149 std::array<
int, nLayers - 1> mNTracklets;
150 std::array<
int, nLayers - 2> mNCells;
156 uint8_t* mMultMaskDevice;
157 Vertex* mPrimaryVerticesDevice;
158 int* mROFramesPVDevice;
159 std::array<Cluster*, nLayers> mClustersDevice;
160 std::array<Cluster*, nLayers> mUnsortedClustersDevice;
161 std::array<int*, nLayers> mClustersIndexTablesDevice;
162 std::array<unsigned char*, nLayers> mUsedClustersDevice;
163 std::array<int*, nLayers> mROFramesClustersDevice;
164 const Cluster** mClustersDeviceArray;
165 const Cluster** mUnsortedClustersDeviceArray;
166 const int** mClustersIndexTablesDeviceArray;
167 const unsigned char** mUsedClustersDeviceArray;
168 const int** mROFrameClustersDeviceArray;
169 std::array<
Tracklet*, nLayers - 1> mTrackletsDevice;
171 std::array<
int*, nLayers - 1> mTrackletsLUTDevice;
172 std::array<
int*, nLayers - 2> mCellsLUTDevice;
173 std::array<
int*, nLayers - 3> mNeighboursLUTDevice;
175 int** mCellsLUTDeviceArray;
176 int** mNeighboursCellDeviceArray;
177 int** mNeighboursCellLUTDeviceArray;
178 int** mTrackletsLUTDeviceArray;
179 std::array<
CellSeed*, nLayers - 2> mCellsDevice;
180 std::array<
int*, nLayers - 2> mNeighboursIndexTablesDevice;
185 std::array<
float*, nLayers - 2> mCellSeedsChi2Device;
186 float** mCellSeedsChi2DeviceArray;
188 Road<nLayers - 2>* mRoadsDevice;
190 std::array<gpuPair<int, int>*, nLayers - 2> mNeighbourPairsDevice;
191 std::array<
int*, nLayers - 2> mNeighboursDevice;
192 int** mNeighboursDeviceArray;
193 std::array<TrackingFrameInfo*, nLayers> mTrackingFrameInfoDevice;
194 const TrackingFrameInfo** mTrackingFrameInfoDeviceArray;
197 std::vector<Stream*> mGpuStreams;
199 bool mFirstInit =
true;
202 std::vector<TrackITSExt> mTrackITSExt;
205template <
int nLayers>
208 return static_cast<int>(mROFramesClusters[layerId][(rofIdstart + rofSpanSize) < mROFramesClusters.size() ? rofIdstart + rofSpanSize : mROFramesClusters.size() - 1] - mROFramesClusters[layerId][rofIdstart]);
211template <
int nLayers>
214 std::vector<unsigned int>
sizes(mUnsortedClusters.size());
215 std::transform(mUnsortedClusters.begin(), mUnsortedClusters.end(),
sizes.begin(),
216 [](
const auto&
v) { return static_cast<unsigned int>(v.size()); });
220template <
int nLayers>
223 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 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
Common utility functions.