13#ifndef TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
14#define TRACKINGITSGPU_INCLUDE_TIMEFRAMEGPU_H
37 static constexpr int MaxLinks = TrackingTopologyN::MaxLinks;
38 static constexpr int MaxCells = TrackingTopologyN::MaxCells;
39 static constexpr int MaxStreams = MaxCells > NLayers ? MaxCells : NLayers;
115 virtual
bool isGPU() const noexcept final {
return true; }
116 virtual const char*
getName() const noexcept override final {
return "GPU"; }
181 void allocMemAsync(
void**,
size_t,
Stream&,
bool, int32_t =
o2::gpu::GPUMemoryResource::MEMORY_GPU);
182 void allocMem(
void**,
size_t,
bool, int32_t =
o2::gpu::GPUMemoryResource::MEMORY_GPU);
185 std::
array<
int, MaxLinks> mNTracklets{};
186 std::array<int, MaxCells> mNCells{};
187 std::array<int, MaxCells> mNNeighbours{};
192 ROFOverlapTableN::View mDeviceROFOverlapTableView;
193 ROFVertexLookupTableN::View mDeviceROFVertexLookupTableView;
194 ROFMaskTableN::View mDeviceROFMaskTableView;
195 std::vector<typename TrackingTopologyN::View> mDeviceTrackerTopologyViews;
196 typename TrackingTopologyN::View mDeviceTrackingTopologyView;
199 Vertex* mPrimaryVerticesDevice;
200 int* mROFramesPVDevice;
201 std::array<Cluster*, NLayers> mClustersDevice;
202 std::array<Cluster*, NLayers> mUnsortedClustersDevice;
203 std::array<int*, NLayers> mClustersIndexTablesDevice;
204 std::array<unsigned char*, NLayers> mUsedClustersDevice;
205 std::array<int*, NLayers> mROFramesClustersDevice;
206 const Cluster** mClustersDeviceArray;
207 const Cluster** mUnsortedClustersDeviceArray;
208 const int** mClustersIndexTablesDeviceArray;
209 uint8_t** mUsedClustersDeviceArray;
210 const int** mROFramesClustersDeviceArray;
211 std::array<Tracklet*, MaxLinks> mTrackletsDevice{};
212 std::array<int*, MaxLinks> mTrackletsLUTDevice{};
213 std::array<int*, MaxCells> mCellsLUTDevice{};
214 std::array<int*, MaxCells> mNeighboursLUTDevice{};
216 Tracklet** mTrackletsDeviceArray{
nullptr};
217 int** mCellsLUTDeviceArray{
nullptr};
218 int** mNeighboursCellLUTDeviceArray{
nullptr};
219 int** mTrackletsLUTDeviceArray{
nullptr};
220 std::array<CellSeed*, MaxCells> mCellsDevice{};
221 CellSeed** mCellsDeviceArray;
222 std::array<int*, MaxCells> mNeighboursIndexTablesDevice{};
224 int* mTrackSeedsLUTDevice{
nullptr};
225 unsigned int mNTracks{0};
226 std::array<o2::track::TrackParCovF*, MaxCells> mCellSeedsDevice{};
228 std::array<float*, MaxCells> mCellSeedsChi2Device{};
229 float** mCellSeedsChi2DeviceArray;
231 TrackITSExt* mTrackITSExtDevice;
232 int* mTrackIndicesDevice{
nullptr};
233 TrackExtensionHypothesis<NLayers>* mActiveTrackExtensionHypothesesDevice{
nullptr};
234 TrackExtensionHypothesis<NLayers>* mNextTrackExtensionHypothesesDevice{
nullptr};
235 std::array<CellNeighbour*, MaxCells> mNeighboursDevice{};
236 CellNeighbour** mNeighboursDeviceArray{
nullptr};
237 std::array<TrackingFrameInfo*, NLayers> mTrackingFrameInfoDevice;
238 const TrackingFrameInfo** mTrackingFrameInfoDeviceArray;
242 std::bitset<NLayers + 1> mPinnedUnsortedClusters{0};
243 std::bitset<NLayers + 1> mPinnedClusters{0};
244 std::bitset<NLayers + 1> mPinnedClustersIndexTables{0};
245 std::bitset<NLayers + 1> mPinnedUsedClusters{0};
246 std::bitset<NLayers + 1> mPinnedROFramesClusters{0};
247 std::bitset<NLayers + 1> mPinnedTrackingFrameInfo{0};
250 bounded_vector<TrackITSExt> mTrackITSExt;
251 bounded_vector<int> mTrackIndices;
254template <
int NLayers>
257 std::vector<unsigned int>
sizes(this->mUnsortedClusters.size());
258 std::transform(this->mUnsortedClusters.begin(), this->mUnsortedClusters.end(),
sizes.begin(),
259 [](
const auto&
v) { return static_cast<unsigned int>(v.size()); });
263template <
int NLayers>
266 return std::accumulate(mNTracklets.begin(), mNTracklets.begin() + this->mTrackingTopologyView.nLinks, 0);
269template <
int NLayers>
272 return std::accumulate(mNCells.begin(), mNCells.begin() + this->mTrackingTopologyView.nCells, 0);
275template <
int NLayers>
278 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()
TrackExtensionHypothesis< NLayers > * getDeviceActiveTrackExtensionHypotheses()
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()
int * getDeviceTrackIndices()
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 createTrackExtensionScratchDevice(const int nThreads, const int maxHypotheses)
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)
void downloadTrackIndicesDevice()
~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)
TrackExtensionHypothesis< NLayers > * getDeviceNextTrackExtensionHypotheses()
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
TrackExtensionHypothesis< NLayers > int const int maxHypotheses
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