13#ifndef TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H 
   14#define TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H 
   27template <
int nLayers = 7>
 
  107  virtual 
bool isGPU() const noexcept final { 
return true; }
 
  108  virtual const char* 
getName() const noexcept { 
return "GPU"; }
 
  180  void allocMemAsync(
void**, 
size_t, 
Stream&, 
bool); 
 
  181  void allocMem(
void**, 
size_t, 
bool);               
 
  185  std::
array<
int, nLayers - 1> mNTracklets;
 
  186  std::
array<
int, nLayers - 2> mNCells;
 
  187  std::
array<
int, nLayers - 3> mNNeighbours;
 
  193  uint8_t* mMultMaskDevice;
 
  194  Vertex* mPrimaryVerticesDevice;
 
  195  int* mROFramesPVDevice;
 
  198  std::
array<
int*, nLayers> mClustersIndexTablesDevice;
 
  199  std::
array<
unsigned char*, nLayers> mUsedClustersDevice;
 
  200  std::
array<
int*, nLayers> mROFramesClustersDevice;
 
  201  const 
Cluster** mClustersDeviceArray;
 
  202  const 
Cluster** mUnsortedClustersDeviceArray;
 
  203  const 
int** mClustersIndexTablesDeviceArray;
 
  204  uint8_t** mUsedClustersDeviceArray;
 
  205  const 
int** mROFramesClustersDeviceArray;
 
  207  std::
array<
int*, nLayers - 1> mTrackletsLUTDevice;
 
  208  std::
array<
int*, nLayers - 2> mCellsLUTDevice;
 
  209  std::
array<
int*, nLayers - 3> mNeighboursLUTDevice;
 
  211  Tracklet** mTrackletsDeviceArray{
nullptr};
 
  212  int** mCellsLUTDeviceArray{
nullptr};
 
  213  int** mNeighboursCellDeviceArray{
nullptr};
 
  214  int** mNeighboursCellLUTDeviceArray{
nullptr};
 
  215  int** mTrackletsLUTDeviceArray{
nullptr};
 
  218  std::array<
int*, 
nLayers - 3> mNeighboursIndexTablesDevice;
 
  222  std::array<
float*, 
nLayers - 2> mCellSeedsChi2Device;
 
  223  float** mCellSeedsChi2DeviceArray;
 
  225  Road<
nLayers - 2>* mRoadsDevice;
 
  226  TrackITSExt* mTrackITSExtDevice;
 
  227  std::array<gpuPair<int, int>*, 
nLayers - 2> mNeighbourPairsDevice;
 
  228  std::array<
int*, 
nLayers - 2> mNeighboursDevice;
 
  229  std::array<TrackingFrameInfo*, nLayers> mTrackingFrameInfoDevice;
 
  230  const TrackingFrameInfo** mTrackingFrameInfoDeviceArray;
 
  233  std::array<int32_t*, 2> mNTrackletsPerROFDevice;
 
  234  std::array<int32_t*, 2> mNTrackletsPerClusterDevice;
 
  235  std::array<int32_t*, 2> mNTrackletsPerClusterSumDevice;
 
  237  int32_t* mNLinesPerClusterDevice;
 
  238  int32_t* mNLinesPerClusterSumDevice;
 
  239  int32_t** mNTrackletsPerROFDeviceArray;
 
  240  int32_t** mNTrackletsPerClusterDeviceArray;
 
  241  int32_t** mNTrackletsPerClusterSumDeviceArray;
 
  246  std::bitset<nLayers + 1> mPinnedUnsortedClusters{0};
 
  247  std::bitset<nLayers + 1> mPinnedClusters{0};
 
  248  std::bitset<nLayers + 1> mPinnedClustersIndexTables{0};
 
  249  std::bitset<nLayers + 1> mPinnedUsedClusters{0};
 
  250  std::bitset<nLayers + 1> mPinnedROFramesClusters{0};
 
  251  std::bitset<nLayers + 1> mPinnedTrackingFrameInfo{0};
 
  254  bounded_vector<TrackITSExt> mTrackITSExt;
 
  257template <
int nLayers>
 
  260  return static_cast<int>(this->mROFramesClusters[layerId][(rofIdstart + rofSpanSize) < this->mROFramesClusters.size() ? rofIdstart + rofSpanSize : this->mROFramesClusters.size() - 1] - this->mROFramesClusters[layerId][rofIdstart]);
 
 
  263template <
int nLayers>
 
  266  std::vector<unsigned int> 
sizes(this->mUnsortedClusters.size());
 
  267  std::transform(this->mUnsortedClusters.begin(), this->mUnsortedClusters.end(), 
sizes.begin(),
 
  268                 [](
const auto& 
v) { return static_cast<unsigned int>(v.size()); });
 
 
  272template <
int nLayers>
 
  275  return std::accumulate(mNTracklets.begin(), mNTracklets.end(), 0);
 
 
  278template <
int nLayers>
 
  281  return std::accumulate(mNCells.begin(), mNCells.end(), 0);
 
 
  284template <
int nLayers>
 
  287  return std::accumulate(mNNeighbours.begin(), mNNeighbours.end(), 0);
 
 
 
 
 
 
 
 
void loadCellsLUTDevice()
const TrackingFrameInfo ** getDeviceArrayTrackingFrameInfo() const
gsl::span< int * > getDeviceCellLUTs()
uint8_t * getDeviceUsedTracklets() const noexcept
void initialise(const int, const TrackingParameters &, const int, IndexTableUtilsN *utils=nullptr, const TimeFrameGPUParameters *pars=nullptr)
gsl::span< CellSeedN * > getDeviceCells()
void createCellsBuffersArray(const int)
void loadTrackSeedsDevice(bounded_vector< CellSeedN > &)
const int ** getDeviceArrayClustersIndexTables() const
auto & getDeviceNTrackletsPerROF() const noexcept
void initDeviceSAFitting()
auto & getDeviceNTrackletsPerClusterSum() const noexcept
virtual const char * getName() const noexcept
auto & getDeviceNTrackletsPerCluster() const noexcept
const Cluster ** getDeviceArrayUnsortedClusters() const
virtual bool isGPU() const noexcept final
interface
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()
TrackingFrameInfo * getDeviceTrackingFrameInfo(const int)
int32_t ** getDeviceArrayNTrackletsPerCluster() const noexcept
void createClustersIndexTablesArray(const int)
void downloadCellsDevice()
void createTrackletsBuffersArray(const int)
int ** getDeviceNeighboursArray()
uint8_t * getDeviceMultCutMask()
int getNClustersInRofSpan(const int, const int, const int) const
gsl::span< int, nLayers - 2 > getNCells()
void loadTrackingFrameInfoDevice(const int, const int)
void syncStreams(const bool=true)
int32_t ** getDeviceArrayNTrackletsPerROF() const noexcept
std::array< int *, nLayers - 2 > & getDeviceNeighboursAll()
void createVtxLinesBuffer(const int32_t)
void loadUsedClustersDevice()
void createUnsortedClustersDeviceArray(const int, const int=nLayers)
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 createVtxTrackletsBuffers(const int32_t)
void createClustersDeviceArray(const int, const int=nLayers)
void createTrackITSExtDevice(bounded_vector< CellSeedN > &)
void loadClustersDevice(const int, const int)
void initDevice(IndexTableUtilsN *, const TrackingParameters &trkParam, const TimeFrameGPUParameters &, const int, const int)
void registerHostMemory(const int)
Most relevant operations.
o2::track::TrackParCovF ** getDeviceArrayTrackSeeds()
int getNumberOfCells() const final
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 createVtxTrackletsLUTDevice(const int32_t)
Vertexer.
void createUsedClustersDeviceArray(const int, const int=nLayers)
int ** getDeviceArrayNeighboursCellLUT() const
CellSeedN ** getDeviceArrayCells()
int32_t * getDeviceNLinesPerClusterSum() const noexcept
void createVtxLinesLUTDevice(const int32_t)
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)
int32_t ** getDeviceArrayNTrackletsPerClusterSum() const noexcept
void loadUnsortedClustersDevice(const int, const int)
auto & getStream(const size_t stream)
synchronization
int ** getDeviceArrayCellsLUT() const
IndexTableUtilsN * getDeviceIndexTableUtils()
int32_t * getDeviceNLinesPerCluster() const noexcept
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()
uint8_t ** getDeviceArrayUsedClusters() const
void unregisterHostMemory(const int)
Line * getDeviceLines() const noexcept
gsl::span< int * > getDeviceTrackletsPerROFs()
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
uint8_t itsSharedClusterMap uint8_t
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
IndexTableUtils< nLayers > IndexTableUtilsN