@@ -91,13 +91,12 @@ template <int nLayers>
9191void TrackerTraitsGPU<nLayers>::computeTrackletsHybrid(const int iteration, int iROFslice, int iVertex)
9292{
9393 auto & conf = o2::its::ITSGpuTrackingParamConfig::Instance ();
94- // TrackerTraits::computeLayerTracklets(iteration, iROFslice, iVertex);
9594 mTimeFrameGPU ->createTrackletsLUTDevice (iteration);
9695
9796 const Vertex diamondVert ({mTrkParams [iteration].Diamond [0 ], mTrkParams [iteration].Diamond [1 ], mTrkParams [iteration].Diamond [2 ]}, {25 .e -6f , 0 .f , 0 .f , 25 .e -6f , 0 .f , 36 .f }, 1 , 1 .f );
9897 gsl::span<const Vertex> diamondSpan (&diamondVert, 1 );
9998 int startROF{mTrkParams [iteration].nROFsPerIterations > 0 ? iROFslice * mTrkParams [iteration].nROFsPerIterations : 0 };
100- int endROF{mTrkParams [iteration].nROFsPerIterations > 0 ? (iROFslice + 1 ) * mTrkParams [iteration].nROFsPerIterations + mTrkParams [iteration].DeltaROF : mTimeFrameGPU ->getNrof ()};
99+ int endROF{o2::gpu::CAMath::Min ( mTrkParams [iteration].nROFsPerIterations > 0 ? (iROFslice + 1 ) * mTrkParams [iteration].nROFsPerIterations + mTrkParams [iteration].DeltaROF : mTimeFrameGPU ->getNrof (), mTimeFrameGPU -> getNrof () )};
101100
102101 countTrackletsInROFsHandler<nLayers>(mTimeFrameGPU ->getDeviceIndexTableUtils (),
103102 mTimeFrameGPU ->getDeviceMultCutMask (),
@@ -214,7 +213,7 @@ void TrackerTraitsGPU<nLayers>::computeCellsHybrid(const int iteration)
214213template <int nLayers>
215214void TrackerTraitsGPU<nLayers>::findCellsNeighboursHybrid(const int iteration)
216215{
217- mTimeFrameGPU ->createNeighboursDevice ();
216+ mTimeFrameGPU ->createNeighboursIndexTablesDevice ();
218217 auto & conf = o2::its::ITSGpuTrackingParamConfig::Instance ();
219218 std::vector<std::vector<std::pair<int , int >>> cellsNeighboursLayer (mTrkParams [iteration].CellsPerRoad () - 1 );
220219 for (int iLayer{0 }; iLayer < mTrkParams [iteration].CellsPerRoad () - 1 ; ++iLayer) {
@@ -228,17 +227,16 @@ void TrackerTraitsGPU<nLayers>::findCellsNeighboursHybrid(const int iteration)
228227 continue ;
229228 }
230229
231- int layerCellsNum{static_cast <int >(mTimeFrameGPU ->getCells ()[iLayer].size ())};
232230 mTimeFrameGPU ->createNeighboursLUTDevice (iLayer, nextLayerCellsNum);
233231 countCellNeighboursHandler (mTimeFrameGPU ->getDeviceArrayCells (),
234232 mTimeFrameGPU ->getDeviceNeighboursLUT (iLayer), // LUT is initialised here.
235233 mTimeFrameGPU ->getDeviceArrayCellsLUT (),
236- mTimeFrameGPU ->getDeviceNeighbours (iLayer),
234+ mTimeFrameGPU ->getDeviceNeighbourPairs (iLayer),
237235 mTimeFrameGPU ->getDeviceNeighboursIndexTables (iLayer),
238236 mTrkParams [0 ].MaxChi2ClusterAttachment ,
239237 mBz ,
240238 iLayer,
241- layerCellsNum ,
239+ mTimeFrameGPU -> getNCells ()[iLayer] ,
242240 nextLayerCellsNum,
243241 1e2 ,
244242 conf.nBlocks ,
@@ -250,12 +248,12 @@ void TrackerTraitsGPU<nLayers>::findCellsNeighboursHybrid(const int iteration)
250248 computeCellNeighboursHandler (mTimeFrameGPU ->getDeviceArrayCells (),
251249 mTimeFrameGPU ->getDeviceNeighboursLUT (iLayer),
252250 mTimeFrameGPU ->getDeviceArrayCellsLUT (),
253- mTimeFrameGPU ->getDeviceNeighbours (iLayer),
251+ mTimeFrameGPU ->getDeviceNeighbourPairs (iLayer),
254252 mTimeFrameGPU ->getDeviceNeighboursIndexTables (iLayer),
255253 mTrkParams [0 ].MaxChi2ClusterAttachment ,
256254 mBz ,
257255 iLayer,
258- layerCellsNum ,
256+ mTimeFrameGPU -> getNCells ()[iLayer] ,
259257 nextLayerCellsNum,
260258 1e2 ,
261259 conf.nBlocks ,
@@ -264,24 +262,46 @@ void TrackerTraitsGPU<nLayers>::findCellsNeighboursHybrid(const int iteration)
264262 mTimeFrameGPU ->getCellsNeighbours ()[iLayer].reserve (cellsNeighboursLayer[iLayer].size ());
265263
266264 filterCellNeighboursHandler (mTimeFrameGPU ->getCellsNeighbours ()[iLayer],
265+ mTimeFrameGPU ->getDeviceNeighbourPairs (iLayer),
267266 mTimeFrameGPU ->getDeviceNeighbours (iLayer),
268267 cellsNeighboursLayer[iLayer].size ());
269268 }
269+ mTimeFrameGPU ->createNeighboursDeviceArray ();
270270 mTimeFrameGPU ->downloadCellsDevice ();
271271 mTimeFrameGPU ->unregisterRest ();
272272};
273273
274274template <int nLayers>
275275void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
276276{
277+ auto & conf = o2::its::ITSGpuTrackingParamConfig::Instance ();
277278 for (int startLevel{mTrkParams [iteration].CellsPerRoad ()}; startLevel >= mTrkParams [iteration].CellMinimumLevel (); --startLevel) {
278279 const int minimumLayer{startLevel - 1 };
279280 std::vector<CellSeed> trackSeeds;
280281 for (int startLayer{mTrkParams [iteration].CellsPerRoad () - 1 }; startLayer >= minimumLayer; --startLayer) {
282+ if ((mTrkParams [iteration].StartLayerMask & (1 << (startLayer + 2 ))) == 0 ) {
283+ continue ;
284+ }
281285 std::vector<int > lastCellId, updatedCellId;
282286 std::vector<CellSeed> lastCellSeed, updatedCellSeed;
283287
284- processNeighbours (startLayer, startLevel, mTimeFrameGPU ->getCells ()[startLayer], lastCellId, updatedCellSeed, updatedCellId);
288+ processNeighboursHandler<nLayers>(startLayer,
289+ startLevel,
290+ mTimeFrameGPU ->getDeviceArrayCells (),
291+ mTimeFrameGPU ->getDeviceCells ()[startLayer],
292+ mTimeFrameGPU ->getNCells ()[startLayer],
293+ mTimeFrameGPU ->getDeviceArrayUsedClusters (),
294+ mTimeFrameGPU ->getDeviceNeighbours (startLayer - 1 ),
295+ mTimeFrameGPU ->getDeviceNeighboursLUTs (),
296+ mTimeFrameGPU ->getDeviceArrayTrackingFrameInfo (),
297+ mBz ,
298+ mTrkParams [0 ].MaxChi2ClusterAttachment , // float maxChi2ClusterAttachment
299+ mTimeFrameGPU ->getDevicePropagator (),
300+ mCorrType ,
301+ updatedCellId, // temporary host vectors
302+ updatedCellSeed, // temporary host vectors
303+ conf.nBlocks ,
304+ conf.nThreads );
285305
286306 int level = startLevel;
287307 for (int iLayer{startLayer - 1 }; iLayer > 0 && level > 2 ; --iLayer) {
@@ -304,15 +324,16 @@ void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
304324 }
305325 mTimeFrameGPU ->createTrackITSExtDevice (trackSeeds);
306326 mTimeFrameGPU ->loadTrackSeedsDevice (trackSeeds);
307- auto & conf = o2::its::ITSGpuTrackingParamConfig::Instance ();
308- trackSeedHandler (mTimeFrameGPU ->getDeviceTrackSeeds (), // CellSeed* trackSeeds,
309- mTimeFrameGPU ->getDeviceArrayTrackingFrameInfo (), // TrackingFrameInfo** foundTrackingFrameInfo,
310- mTimeFrameGPU ->getDeviceTrackITSExt (), // o2::its::TrackITSExt* tracks,
311- trackSeeds.size (), // const size_t nSeeds,
312- mBz , // const float Bz,
327+
328+ trackSeedHandler (mTimeFrameGPU ->getDeviceTrackSeeds (), // CellSeed* trackSeeds
329+ mTimeFrameGPU ->getDeviceArrayTrackingFrameInfo (), // TrackingFrameInfo** foundTrackingFrameInfo
330+ mTimeFrameGPU ->getDeviceTrackITSExt (), // o2::its::TrackITSExt* tracks
331+ mTrkParams [iteration].MinPt , // std::vector<float>& minPtsHost,
332+ trackSeeds.size (), // const size_t nSeeds
333+ mBz , // const float Bz
313334 startLevel, // const int startLevel,
314- mTrkParams [0 ].MaxChi2ClusterAttachment , // float maxChi2ClusterAttachment,
315- mTrkParams [0 ].MaxChi2NDF , // float maxChi2NDF,
335+ mTrkParams [0 ].MaxChi2ClusterAttachment , // float maxChi2ClusterAttachment
336+ mTrkParams [0 ].MaxChi2NDF , // float maxChi2NDF
316337 mTimeFrameGPU ->getDevicePropagator (), // const o2::base::Propagator* propagator
317338 mCorrType , // o2::base::PropagatorImpl<float>::MatCorrType
318339 conf.nBlocks ,
@@ -367,8 +388,8 @@ void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
367388 }
368389 mTimeFrameGPU ->getTracks (std::min (rofs[0 ], rofs[1 ])).emplace_back (track);
369390 }
391+ mTimeFrameGPU ->loadUsedClustersDevice ();
370392 }
371- mTimeFrameGPU ->loadUsedClustersDevice ();
372393 if (iteration == mTrkParams .size () - 1 ) {
373394 mTimeFrameGPU ->unregisterHostMemory (0 );
374395 }
0 commit comments