13#ifndef TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
14#define TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
36 static constexpr int MaxTransitions = TrackingTopologyN::MaxTransitions;
37 static constexpr int MaxCells = TrackingTopologyN::MaxCells;
38 static constexpr int MaxStreams = MaxCells > NLayers ? MaxCells : NLayers;
112 virtual
bool isGPU() const noexcept final {
return true; }
113 virtual const char*
getName() const noexcept override final {
return "GPU"; }
174 void allocMemAsync(
void**,
size_t,
Stream&,
bool, int32_t =
o2::gpu::GPUMemoryResource::MEMORY_GPU);
175 void allocMem(
void**,
size_t,
bool, int32_t =
o2::gpu::GPUMemoryResource::MEMORY_GPU);
178 std::
array<
int, MaxTransitions> mNTracklets{};
179 std::array<int, MaxCells> mNCells{};
180 std::array<int, MaxCells> mNNeighbours{};
185 ROFOverlapTableN::View mDeviceROFOverlapTableView;
186 ROFVertexLookupTableN::View mDeviceROFVertexLookupTableView;
187 ROFMaskTableN::View mDeviceROFMaskTableView;
188 std::vector<typename TrackingTopologyN::View> mDeviceTrackerTopologyViews;
189 typename TrackingTopologyN::View mDeviceTrackingTopologyView;
192 Vertex* mPrimaryVerticesDevice;
193 int* mROFramesPVDevice;
194 std::array<Cluster*, NLayers> mClustersDevice;
195 std::array<Cluster*, NLayers> mUnsortedClustersDevice;
196 std::array<int*, NLayers> mClustersIndexTablesDevice;
197 std::array<unsigned char*, NLayers> mUsedClustersDevice;
198 std::array<int*, NLayers> mROFramesClustersDevice;
199 const Cluster** mClustersDeviceArray;
200 const Cluster** mUnsortedClustersDeviceArray;
201 const int** mClustersIndexTablesDeviceArray;
202 uint8_t** mUsedClustersDeviceArray;
203 const int** mROFramesClustersDeviceArray;
204 std::array<Tracklet*, MaxTransitions> mTrackletsDevice{};
205 std::array<int*, MaxTransitions> mTrackletsLUTDevice{};
206 std::array<int*, MaxCells> mCellsLUTDevice{};
207 std::array<int*, MaxCells> mNeighboursLUTDevice{};
209 Tracklet** mTrackletsDeviceArray{
nullptr};
210 int** mCellsLUTDeviceArray{
nullptr};
211 int** mNeighboursCellLUTDeviceArray{
nullptr};
212 int** mTrackletsLUTDeviceArray{
nullptr};
213 std::array<CellSeed*, MaxCells> mCellsDevice{};
214 CellSeed** mCellsDeviceArray;
215 std::array<int*, MaxCells> mNeighboursIndexTablesDevice{};
217 int* mTrackSeedsLUTDevice{
nullptr};
218 unsigned int mNTracks{0};
219 std::array<o2::track::TrackParCovF*, MaxCells> mCellSeedsDevice{};
221 std::array<float*, MaxCells> mCellSeedsChi2Device{};
222 float** mCellSeedsChi2DeviceArray;
224 TrackITSExt* mTrackITSExtDevice;
225 std::array<CellNeighbour*, MaxCells> mNeighboursDevice{};
226 CellNeighbour** mNeighboursDeviceArray{
nullptr};
227 std::array<TrackingFrameInfo*, NLayers> mTrackingFrameInfoDevice;
228 const TrackingFrameInfo** mTrackingFrameInfoDeviceArray;
232 std::bitset<NLayers + 1> mPinnedUnsortedClusters{0};
233 std::bitset<NLayers + 1> mPinnedClusters{0};
234 std::bitset<NLayers + 1> mPinnedClustersIndexTables{0};
235 std::bitset<NLayers + 1> mPinnedUsedClusters{0};
236 std::bitset<NLayers + 1> mPinnedROFramesClusters{0};
237 std::bitset<NLayers + 1> mPinnedTrackingFrameInfo{0};
240 bounded_vector<TrackITSExt> mTrackITSExt;
243template <
int NLayers>
246 std::vector<unsigned int>
sizes(this->mUnsortedClusters.size());
247 std::transform(this->mUnsortedClusters.begin(), this->mUnsortedClusters.end(),
sizes.begin(),
248 [](
const auto&
v) { return static_cast<unsigned int>(v.size()); });
252template <
int NLayers>
255 return std::accumulate(mNTracklets.begin(), mNTracklets.begin() + this->mTrackingTopologyView.nTransitions, 0);
258template <
int NLayers>
261 return std::accumulate(mNCells.begin(), mNCells.begin() + this->mTrackingTopologyView.nCells, 0);
264template <
int NLayers>
267 return std::accumulate(mNNeighbours.begin(), mNNeighbours.begin() + this->mTrackingTopologyView.nCells, 0);
HMPID cluster implementation.
CellSeed: connections of three clusters.
void loadTrackletsDevice()
gsl::span< Tracklet * > getDeviceTracklets()
size_t getNumberOfTracklets() const final
o2::track::TrackParCovF ** getDeviceArrayTrackSeeds()
virtual const char * getName() const noexcept override final
void loadTrackletsLUTDevice()
virtual bool isGPU() const noexcept final
interface
void downloadTrackITSExtDevice()
void createUsedClustersDevice(const int)
int * getDeviceROFramesClusters(const int layer)
void loadROFOverlapTable()
void createNeighboursIndexTablesDevice(const int)
void createCellsLUTDeviceArray()
void pushMemoryStack(const int)
Most relevant operations.
void downloadNeighboursLUTDevice(bounded_vector< int > &, const int)
void downloadCellsLUTDevice()
void loadTrackingTopologies()
const auto getDeviceROFOverlapTableView()
void loadClustersIndexTables(const int)
void loadCellsLUTDevice()
TrackITSExt * getDeviceTrackITSExt()
TrackSeedN * getDeviceTrackSeeds()
void loadTrackSeedsDevice()
void createROFrameClustersDeviceArray()
auto & getArrayNNeighbours()
void initialise(const TrackingParameters &, int maxLayers, int iteration)
void unregisterHostMemory(const int)
const auto getDeviceROFMaskTableView()
unsigned char * getDeviceUsedClusters(const int)
float ** getDeviceArrayTrackSeedsChi2()
virtual void wipe() final
cleanup
size_t getNumberOfNeighbours() const final
void createTrackletsLUTDevice(bool, const int)
uint8_t ** getDeviceArrayUsedClusters() const
const int ** getDeviceArrayClustersIndexTables() const
void registerHostMemory(const int)
void recordEvent(const int)
int ** getDeviceArrayCellsLUT() const
auto getNTrackSeeds() const
CellSeed ** getDeviceArrayCells()
gsl::span< CellSeed * > getDeviceCells()
Vertex * getDeviceVertices()
void downloadCellsNeighboursDevice(std::vector< bounded_vector< CellNeighbour > > &, const int)
const auto getDeviceTrackingTopologyView() const
void waitEvent(const int, const int)
void createClustersIndexTablesArray()
gsl::span< int * > getDeviceTrackletsLUTs()
void popMemoryStack(const int)
void loadTrackSeedsDevice(bounded_vector< TrackSeedN > &)
void syncStreams(const bool=true)
void createTrackletsBuffersArray()
void createTrackletsBuffers(const int)
~TimeFrameGPU() override=default
int * getDeviceNeighboursLUT(const int layer)
const int ** getDeviceROFrameClusters() const
void createNeighboursDevice(const unsigned int layer)
int * getDeviceTrackSeedsLUT()
int * getDeviceROFramesPV()
void updateROFVertexLookupTable()
void loadTrackingFrameInfoDevice(const int)
void loadClustersDevice(const int)
int * getDeviceNeighboursIndexTables(const int layer)
void createUnsortedClustersDeviceArray(const int=NLayers)
const auto getDeviceROFVertexLookupTableView()
Tracklet ** getDeviceArrayTracklets()
size_t getNumberOfCells() const final
auto & getStream(const size_t stream)
synchronization
void loadTrackSeedsChi2Device()
void createTrackingFrameInfoDeviceArray()
void loadUnsortedClustersDevice(const int)
void createTrackletsLUTDeviceArray()
void loadROFCutMask(const int)
void createClustersDeviceArray(const int=NLayers)
void createCellsLUTDevice(const int)
void syncStream(const size_t stream)
const Cluster ** getDeviceArrayUnsortedClusters() const
gsl::span< int * > getDeviceNeighboursLUTs()
CellNeighbour ** getDeviceArrayNeighbours()
CellNeighbour * getDeviceNeighbours(const int layer)
void createCellsBuffersArray()
void setDevicePropagator(const o2::base::PropagatorImpl< float > *p) final
int ** getDeviceArrayTrackletsLUT() const
gsl::span< int > getNCells()
int ** getDeviceArrayNeighboursCellLUT() const
const o2::base::Propagator * getChainPropagator()
const Cluster ** getDeviceArrayClusters() const
void recordEvents(const int=0, const int=NLayers)
gsl::span< int > getNNeighbours()
const TrackingFrameInfo ** getDeviceArrayTrackingFrameInfo() const
IndexTableUtilsN * getDeviceIndexTableUtils()
void createNeighboursLUTDevice(const int, const unsigned int)
void loadROFVertexLookupTable()
void loadROFrameClustersDevice(const int)
void loadUsedClustersDevice()
std::array< CellNeighbour *, MaxCells > & getDeviceNeighboursAll()
void createUsedClustersDeviceArray(const int=NLayers)
gsl::span< int * > getDeviceCellLUTs()
void downloadCellsDevice()
void initialise(const TrackingParameters &, int maxLayers)
TrackingFrameInfo * getDeviceTrackingFrameInfo(const int)
void createCellsBuffers(const int)
gsl::span< int > getNTracklets()
void createTrackITSExtDevice(const size_t)
void loadIndexTableUtils()
std::vector< unsigned int > getClusterSizes()
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
GLenum GLuint GLint GLint layer
std::pmr::vector< T > bounded_vector
o2::dataformats::Vertex< o2::its::TimeEstBC > Vertex
TrackParametrizationWithError< float > TrackParCovF
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
ROFVertexLookupTable< NLayers > ROFVertexLookupTableN
TrackSeed< NLayers > TrackSeedN
IndexTableUtils< NLayers > IndexTableUtilsN
const o2::base::PropagatorImpl< float > * mPropagatorDevice
TrackingTopologyN::View mTrackingTopologyView
TrackingTopology< NLayers > TrackingTopologyN
ROFOverlapTable< NLayers > ROFOverlapTableN
ROFMaskTable< NLayers > ROFMaskTableN