@@ -25,13 +25,13 @@ namespace o2::its::gpu
2525{
2626
2727template <int nLayers = 7 >
28- class TimeFrameGPU : public TimeFrame <nLayers>
28+ class TimeFrameGPU final : public TimeFrame<nLayers>
2929{
3030 using typename TimeFrame<nLayers>::CellSeedN;
3131 using typename TimeFrame<nLayers>::IndexTableUtilsN;
3232
3333 public:
34- TimeFrameGPU ();
34+ TimeFrameGPU () = default ;
3535 ~TimeFrameGPU () = default ;
3636
3737 // / Most relevant operations
@@ -44,13 +44,13 @@ class TimeFrameGPU : public TimeFrame<nLayers>
4444 void loadTrackingFrameInfoDevice (const int , const int );
4545 void createTrackingFrameInfoDeviceArray (const int );
4646 void loadUnsortedClustersDevice (const int , const int );
47- void createUnsortedClustersDeviceArray (const int );
47+ void createUnsortedClustersDeviceArray (const int , const int = nLayers );
4848 void loadClustersDevice (const int , const int );
49- void createClustersDeviceArray (const int );
49+ void createClustersDeviceArray (const int , const int = nLayers );
5050 void loadClustersIndexTables (const int , const int );
51- void createClustersIndexTablesArray (const int iteration );
51+ void createClustersIndexTablesArray (const int );
5252 void createUsedClustersDevice (const int , const int );
53- void createUsedClustersDeviceArray (const int );
53+ void createUsedClustersDeviceArray (const int , const int = nLayers );
5454 void loadUsedClustersDevice ();
5555 void loadROFrameClustersDevice (const int , const int );
5656 void createROFrameClustersDeviceArray (const int );
@@ -85,6 +85,12 @@ class TimeFrameGPU : public TimeFrame<nLayers>
8585 void downloadCellsDevice ();
8686 void downloadCellsLUTDevice ();
8787
88+ // / Vertexer
89+ void createVtxTrackletsLUTDevice (const int32_t );
90+ void createVtxTrackletsBuffers (const int32_t );
91+ void createVtxLinesLUTDevice (const int32_t );
92+ void createVtxLinesBuffer (const int32_t );
93+
8894 // / synchronization
8995 auto & getStream (const size_t stream) { return mGpuStreams [stream]; }
9096 auto & getStreams () { return mGpuStreams ; }
@@ -98,6 +104,8 @@ class TimeFrameGPU : public TimeFrame<nLayers>
98104 virtual void wipe () final ;
99105
100106 // / interface
107+ virtual bool isGPU () const noexcept final { return true ; }
108+ virtual const char * getName () const noexcept { return " GPU" ; }
101109 int getNClustersInRofSpan (const int , const int , const int ) const ;
102110 IndexTableUtilsN* getDeviceIndexTableUtils () { return mIndexTableUtilsDevice ; }
103111 int * getDeviceROFramesClusters (const int layer) { return mROFramesClustersDevice [layer]; }
@@ -122,7 +130,7 @@ class TimeFrameGPU : public TimeFrame<nLayers>
122130 const Cluster** getDeviceArrayUnsortedClusters () const { return mUnsortedClustersDeviceArray ; }
123131 const int ** getDeviceArrayClustersIndexTables () const { return mClustersIndexTablesDeviceArray ; }
124132 std::vector<unsigned int > getClusterSizes ();
125- const unsigned char ** getDeviceArrayUsedClusters () const { return mUsedClustersDeviceArray ; }
133+ uint8_t ** getDeviceArrayUsedClusters () const { return mUsedClustersDeviceArray ; }
126134 const int ** getDeviceROFrameClusters () const { return mROFramesClustersDeviceArray ; }
127135 Tracklet** getDeviceArrayTracklets () { return mTrackletsDeviceArray ; }
128136 int ** getDeviceArrayTrackletsLUT () const { return mTrackletsLUTDeviceArray ; }
@@ -135,6 +143,19 @@ class TimeFrameGPU : public TimeFrame<nLayers>
135143 int * getDeviceNeighboursIndexTables (const int layer) { return mNeighboursIndexTablesDevice [layer]; }
136144 uint8_t * getDeviceMultCutMask () { return mMultMaskDevice ; }
137145
146+ // Vertexer
147+ auto & getDeviceNTrackletsPerROF () const noexcept { return mNTrackletsPerROFDevice ; }
148+ auto & getDeviceNTrackletsPerCluster () const noexcept { return mNTrackletsPerClusterDevice ; }
149+ auto & getDeviceNTrackletsPerClusterSum () const noexcept { return mNTrackletsPerClusterSumDevice ; }
150+ int32_t ** getDeviceArrayNTrackletsPerROF () const noexcept { return mNTrackletsPerROFDeviceArray ; }
151+ int32_t ** getDeviceArrayNTrackletsPerCluster () const noexcept { return mNTrackletsPerClusterDeviceArray ; }
152+ int32_t ** getDeviceArrayNTrackletsPerClusterSum () const noexcept { return mNTrackletsPerClusterSumDeviceArray ; }
153+ uint8_t * getDeviceUsedTracklets () const noexcept { return mUsedTrackletsDevice ; }
154+ int32_t * getDeviceNLinesPerCluster () const noexcept { return mNLinesPerClusterDevice ; }
155+ int32_t * getDeviceNLinesPerClusterSum () const noexcept { return mNLinesPerClusterSumDevice ; }
156+ Line* getDeviceLines () const noexcept { return mLinesDevice ; }
157+ gsl::span<int *> getDeviceTrackletsPerROFs () { return mNTrackletsPerROFDevice ; }
158+
138159 void setDevicePropagator (const o2::base::PropagatorImpl<float >* p) final { this ->mPropagatorDevice = p; }
139160
140161 // Host-specific getters
@@ -180,7 +201,7 @@ class TimeFrameGPU : public TimeFrame<nLayers>
180201 const Cluster** mClustersDeviceArray ;
181202 const Cluster** mUnsortedClustersDeviceArray ;
182203 const int ** mClustersIndexTablesDeviceArray ;
183- const unsigned char ** mUsedClustersDeviceArray ;
204+ uint8_t ** mUsedClustersDeviceArray ;
184205 const int ** mROFramesClustersDeviceArray ;
185206 std::array<Tracklet*, nLayers - 1 > mTrackletsDevice ;
186207 std::array<int *, nLayers - 1 > mTrackletsLUTDevice ;
@@ -208,6 +229,18 @@ class TimeFrameGPU : public TimeFrame<nLayers>
208229 std::array<TrackingFrameInfo*, nLayers> mTrackingFrameInfoDevice ;
209230 const TrackingFrameInfo** mTrackingFrameInfoDeviceArray ;
210231
232+ // / Vertexer
233+ std::array<int32_t *, 2 > mNTrackletsPerROFDevice ;
234+ std::array<int32_t *, 2 > mNTrackletsPerClusterDevice ;
235+ std::array<int32_t *, 2 > mNTrackletsPerClusterSumDevice ;
236+ uint8_t * mUsedTrackletsDevice ;
237+ int32_t * mNLinesPerClusterDevice ;
238+ int32_t * mNLinesPerClusterSumDevice ;
239+ int32_t ** mNTrackletsPerROFDeviceArray ;
240+ int32_t ** mNTrackletsPerClusterDeviceArray ;
241+ int32_t ** mNTrackletsPerClusterSumDeviceArray ;
242+ Line* mLinesDevice ;
243+
211244 // State
212245 Streams mGpuStreams ;
213246 std::bitset<nLayers + 1 > mPinnedUnsortedClusters {0 };
0 commit comments