@@ -51,9 +51,19 @@ class TimeFrameGPU : public TimeFrame
5151 void initialise (const int , const TrackingParameters&, const int , IndexTableUtils* utils = nullptr , const TimeFrameGPUParameters* pars = nullptr );
5252 void initDevice (IndexTableUtils*, const TrackingParameters& trkParam, const TimeFrameGPUParameters&, const int , const int );
5353 void initDeviceSAFitting ();
54+ void loadIndexTableUtils (const int );
5455 void loadTrackingFrameInfoDevice (const int );
5556 void loadUnsortedClustersDevice (const int );
5657 void loadClustersDevice (const int );
58+ void loadClustersIndexTables (const int iteration);
59+ void createUsedClustersDevice (const int );
60+ void loadUsedClustersDevice ();
61+ void loadROframeClustersDevice (const int );
62+ void loadMultiplicityCutMask (const int );
63+ void loadVertices (const int );
64+
65+ // /
66+ void createTrackletsLUTDevice (const int );
5767 void loadTrackletsDevice ();
5868 void loadTrackletsLUTDevice ();
5969 void loadCellsDevice ();
@@ -62,6 +72,7 @@ class TimeFrameGPU : public TimeFrame
6272 void loadTrackSeedsChi2Device ();
6373 void loadRoadsDevice ();
6474 void loadTrackSeedsDevice (std::vector<CellSeed>&);
75+ void createTrackletsBuffers ();
6576 void createCellsBuffers (const int );
6677 void createCellsDevice ();
6778 void createCellsLUTDevice ();
@@ -93,7 +104,7 @@ class TimeFrameGPU : public TimeFrame
93104 std::vector<std::vector<o2::MCCompLabel>>& getLabelsInChunks () { return mLabelsInChunks ; }
94105 int getNAllocatedROFs () const { return mNrof ; } // Allocated means maximum nROF for each chunk while populated is the number of loaded ones.
95106 StaticTrackingParameters<nLayers>* getDeviceTrackingParameters () { return mTrackingParamsDevice ; }
96- Vertex* getDeviceVertices () { return mVerticesDevice ; }
107+ Vertex* getDeviceVertices () { return mPrimaryVerticesDevice ; }
97108 int * getDeviceROFramesPV () { return mROFramesPVDevice ; }
98109 unsigned char * getDeviceUsedClusters (const int );
99110 const o2::base::Propagator* getChainPropagator ();
@@ -107,26 +118,32 @@ class TimeFrameGPU : public TimeFrame
107118 const TrackingFrameInfo** getDeviceArrayTrackingFrameInfo () const { return mTrackingFrameInfoDeviceArray ; }
108119 const Cluster** getDeviceArrayClusters () const { return mClustersDeviceArray ; }
109120 const Cluster** getDeviceArrayUnsortedClusters () const { return mUnsortedClustersDeviceArray ; }
110- const Tracklet** getDeviceArrayTracklets () const { return mTrackletsDeviceArray ; }
111- const int ** getDeviceArrayTrackletsLUT () const { return mTrackletsLUTDeviceArray ; }
121+ const int ** getDeviceArrayClustersIndexTables () const { return mClustersIndexTablesDeviceArray ; }
122+ std::vector<unsigned int > getClusterSizes ();
123+ const unsigned char ** getDeviceArrayUsedClusters () const { return mUsedClustersDeviceArray ; }
124+ const int ** getDeviceROframeClusters () const { return mROFrameClustersDeviceArray ; }
125+ Tracklet** getDeviceArrayTracklets () { return mTrackletsDeviceArray ; }
126+ int ** getDeviceArrayTrackletsLUT () const { return mTrackletsLUTDeviceArray ; }
112127 int ** getDeviceArrayCellsLUT () const { return mCellsLUTDeviceArray ; }
113128 int ** getDeviceArrayNeighboursCellLUT () const { return mNeighboursCellLUTDeviceArray ; }
114129 CellSeed** getDeviceArrayCells () const { return mCellsDeviceArray ; }
115130 CellSeed* getDeviceTrackSeeds () { return mTrackSeedsDevice ; }
116131 o2::track::TrackParCovF** getDeviceArrayTrackSeeds () { return mCellSeedsDeviceArray ; }
117132 float ** getDeviceArrayTrackSeedsChi2 () { return mCellSeedsChi2DeviceArray ; }
118133 int * getDeviceNeighboursIndexTables (const int layer) { return mNeighboursIndexTablesDevice [layer]; }
134+ uint8_t * getDeviceMultCutMask () { return mMultMaskDevice ; }
119135
120136 void setDevicePropagator (const o2::base::PropagatorImpl<float >*) override ;
121137
122138 // Host-specific getters
123- gsl::span<int > getHostNTracklets ( const int chunkId);
124- gsl::span<int > getHostNCells ( const int chunkId);
139+ gsl::span<int , nLayers - 1 > getNTracklets () { return mNTracklets ; }
140+ gsl::span<int , nLayers - 2 > getNCells () { return mNCells ; }
125141
126142 // Host-available device getters
143+ gsl::span<int *> getDeviceTrackletsLUTs () { return mTrackletsLUTDevice ; }
127144 gsl::span<int *> getDeviceCellLUTs () { return mCellsLUTDevice ; }
145+ gsl::span<Tracklet*> getDeviceTracklet () { return mTrackletsDevice ; }
128146 gsl::span<CellSeed*> getDeviceCells () { return mCellsDevice ; }
129- gsl::span<int , nLayers - 2 > getNCellsDevice () { return mNCells ; }
130147
131148 private:
132149 void allocMemAsync (void **, size_t , Stream*, bool ); // Abstract owned and unowned memory allocations
@@ -136,31 +153,37 @@ class TimeFrameGPU : public TimeFrame
136153 StaticTrackingParameters<nLayers> mStaticTrackingParams ;
137154
138155 // Host-available device buffer sizes
156+ std::array<int , nLayers - 1 > mNTracklets ;
139157 std::array<int , nLayers - 2 > mNCells ;
140158
141159 // Device pointers
142160 StaticTrackingParameters<nLayers>* mTrackingParamsDevice ;
143161 IndexTableUtils* mIndexTableUtilsDevice ;
144- std::array<int *, nLayers> mROFramesClustersDevice ;
145- std::array<unsigned char *, nLayers> mUsedClustersDevice ;
146- Vertex* mVerticesDevice ;
147- int * mROFramesPVDevice ;
148162
149163 // Hybrid pref
164+ uint8_t * mMultMaskDevice ;
165+ Vertex* mPrimaryVerticesDevice ;
166+ int * mROFramesPVDevice ;
150167 std::array<Cluster*, nLayers> mClustersDevice ;
151168 std::array<Cluster*, nLayers> mUnsortedClustersDevice ;
169+ std::array<int *, nLayers> mClustersIndexTablesDevice ;
170+ std::array<unsigned char *, nLayers> mUsedClustersDevice ;
171+ std::array<int *, nLayers> mROFramesClustersDevice ;
152172 const Cluster** mClustersDeviceArray ;
153173 const Cluster** mUnsortedClustersDeviceArray ;
174+ const int ** mClustersIndexTablesDeviceArray ;
175+ const unsigned char ** mUsedClustersDeviceArray ;
176+ const int ** mROFrameClustersDeviceArray ;
154177 std::array<Tracklet*, nLayers - 1 > mTrackletsDevice ;
155- const Tracklet** mTrackletsDeviceArray ;
156- const int ** mTrackletsLUTDeviceArray ;
157- std::array<int *, nLayers - 2 > mTrackletsLUTDevice ;
178+ Tracklet** mTrackletsDeviceArray ;
179+ std::array<int *, nLayers - 1 > mTrackletsLUTDevice ;
158180 std::array<int *, nLayers - 2 > mCellsLUTDevice ;
159181 std::array<int *, nLayers - 3 > mNeighboursLUTDevice ;
160182
161183 int ** mCellsLUTDeviceArray ;
162184 int ** mNeighboursCellDeviceArray ;
163185 int ** mNeighboursCellLUTDeviceArray ;
186+ int ** mTrackletsLUTDeviceArray ;
164187 std::array<CellSeed*, nLayers - 2 > mCellsDevice ;
165188 std::array<int *, nLayers - 2 > mNeighboursIndexTablesDevice ;
166189 CellSeed* mTrackSeedsDevice ;
@@ -186,10 +209,6 @@ class TimeFrameGPU : public TimeFrame
186209 std::vector<std::vector<int >> mNVerticesInChunks ;
187210 std::vector<std::vector<o2::MCCompLabel>> mLabelsInChunks ;
188211
189- // Host memory used only in GPU tracking
190- std::vector<int > mHostNTracklets ;
191- std::vector<int > mHostNCells ;
192-
193212 // Temporary buffer for storing output tracks from GPU tracking
194213 std::vector<TrackITSExt> mTrackITSExt ;
195214};
@@ -215,6 +234,16 @@ inline int TimeFrameGPU<nLayers>::getNClustersInRofSpan(const int rofIdstart, co
215234{
216235 return static_cast <int >(mROFramesClusters [layerId][(rofIdstart + rofSpanSize) < mROFramesClusters .size () ? rofIdstart + rofSpanSize : mROFramesClusters .size () - 1 ] - mROFramesClusters [layerId][rofIdstart]);
217236}
237+
238+ template <int nLayers>
239+ inline std::vector<unsigned int > TimeFrameGPU<nLayers>::getClusterSizes()
240+ {
241+ std::vector<unsigned int > sizes (mUnsortedClusters .size ());
242+ std::transform (mUnsortedClusters .begin (), mUnsortedClusters .end (), sizes.begin (),
243+ [](const auto & v) { return static_cast <unsigned int >(v.size ()); });
244+ return sizes;
245+ }
246+
218247} // namespace gpu
219248} // namespace its
220249} // namespace o2
0 commit comments