1818#include " ITStrackingGPU/TrackerTraitsGPU.h"
1919#include " ITStrackingGPU/TrackingKernels.h"
2020#include " ITStracking/TrackingConfigParam.h"
21+ #include " ITStracking/Constants.h"
2122
2223namespace o2 ::its
2324{
24- constexpr int UnusedIndex{-1 };
2525
2626template <int nLayers>
2727void TrackerTraitsGPU<nLayers>::initialiseTimeFrame(const int iteration)
@@ -48,10 +48,8 @@ void TrackerTraitsGPU<nLayers>::adoptTimeFrame(TimeFrame<nLayers>* tf)
4848template <int nLayers>
4949void TrackerTraitsGPU<nLayers>::computeLayerTracklets(const int iteration, int iROFslice, int iVertex)
5050{
51- auto & conf = o2::its::ITSGpuTrackingParamConfig::Instance ();
51+ const auto & conf = o2::its::ITSGpuTrackingParamConfig::Instance ();
5252
53- const Vertex diamondVert ({this ->mTrkParams [iteration].Diamond [0 ], this ->mTrkParams [iteration].Diamond [1 ], this ->mTrkParams [iteration].Diamond [2 ]}, {25 .e -6f , 0 .f , 0 .f , 25 .e -6f , 0 .f , 36 .f }, 1 , 1 .f );
54- gsl::span<const Vertex> diamondSpan (&diamondVert, 1 );
5553 int startROF{this ->mTrkParams [iteration].nROFsPerIterations > 0 ? iROFslice * this ->mTrkParams [iteration].nROFsPerIterations : 0 };
5654 int endROF{o2::gpu::CAMath::Min (this ->mTrkParams [iteration].nROFsPerIterations > 0 ? (iROFslice + 1 ) * this ->mTrkParams [iteration].nROFsPerIterations + this ->mTrkParams [iteration].DeltaROF : mTimeFrameGPU ->getNrof (), mTimeFrameGPU ->getNrof ())};
5755
@@ -128,6 +126,7 @@ void TrackerTraitsGPU<nLayers>::computeLayerCells(const int iteration)
128126
129127 for (int iLayer = 0 ; iLayer < this ->mTrkParams [iteration].CellsPerRoad (); ++iLayer) {
130128 if (!mTimeFrameGPU ->getNTracklets ()[iLayer + 1 ] || !mTimeFrameGPU ->getNTracklets ()[iLayer]) {
129+ mTimeFrameGPU ->getNCells ()[iLayer] = 0 ;
131130 continue ;
132131 }
133132 const int currentLayerTrackletsNum{static_cast <int >(mTimeFrameGPU ->getNTracklets ()[iLayer])};
@@ -173,9 +172,10 @@ void TrackerTraitsGPU<nLayers>::findCellsNeighbours(const int iteration)
173172 mTimeFrameGPU ->createNeighboursIndexTablesDevice ();
174173 const auto & conf = o2::its::ITSGpuTrackingParamConfig::Instance ();
175174 for (int iLayer{0 }; iLayer < this ->mTrkParams [iteration].CellsPerRoad () - 1 ; ++iLayer) {
175+ const int currentLayerCellsNum{static_cast <int >(mTimeFrameGPU ->getNCells ()[iLayer])};
176176 const int nextLayerCellsNum{static_cast <int >(mTimeFrameGPU ->getNCells ()[iLayer + 1 ])};
177-
178- if (!nextLayerCellsNum) {
177+ if (!nextLayerCellsNum || !currentLayerCellsNum) {
178+ mTimeFrameGPU -> getNNeighbours ()[iLayer] = 0 ;
179179 continue ;
180180 }
181181
@@ -188,7 +188,7 @@ void TrackerTraitsGPU<nLayers>::findCellsNeighbours(const int iteration)
188188 this ->mTrkParams [0 ].MaxChi2ClusterAttachment ,
189189 this ->mBz ,
190190 iLayer,
191- mTimeFrameGPU -> getNCells ()[iLayer] ,
191+ currentLayerCellsNum ,
192192 nextLayerCellsNum,
193193 1e2 ,
194194 conf.nBlocks ,
@@ -204,7 +204,7 @@ void TrackerTraitsGPU<nLayers>::findCellsNeighbours(const int iteration)
204204 this ->mTrkParams [0 ].MaxChi2ClusterAttachment ,
205205 this ->mBz ,
206206 iLayer,
207- mTimeFrameGPU -> getNCells ()[iLayer] ,
207+ currentLayerCellsNum ,
208208 nextLayerCellsNum,
209209 1e2 ,
210210 conf.nBlocks ,
@@ -251,8 +251,8 @@ void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
251251 conf.nThreads );
252252 }
253253 // fixme: I don't want to move tracks back and forth, but I need a way to use a thrust::allocator that is aware of our managed memory.
254- if (! trackSeeds.size ()) {
255- LOGP (info , " No track seeds found, skipping track finding" );
254+ if (trackSeeds.empty ()) {
255+ LOGP (debug , " No track seeds found, skipping track finding" );
256256 continue ;
257257 }
258258 mTimeFrameGPU ->createTrackITSExtDevice (trackSeeds);
@@ -283,7 +283,7 @@ void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
283283 int nShared = 0 ;
284284 bool isFirstShared{false };
285285 for (int iLayer{0 }; iLayer < this ->mTrkParams [0 ].NLayers ; ++iLayer) {
286- if (track.getClusterIndex (iLayer) == UnusedIndex) {
286+ if (track.getClusterIndex (iLayer) == constants:: UnusedIndex) {
287287 continue ;
288288 }
289289 nShared += int (mTimeFrameGPU ->isClusterUsed (iLayer, track.getClusterIndex (iLayer)));
@@ -296,7 +296,7 @@ void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
296296
297297 std::array<int , 3 > rofs{INT_MAX, INT_MAX, INT_MAX};
298298 for (int iLayer{0 }; iLayer < this ->mTrkParams [0 ].NLayers ; ++iLayer) {
299- if (track.getClusterIndex (iLayer) == UnusedIndex) {
299+ if (track.getClusterIndex (iLayer) == constants:: UnusedIndex) {
300300 continue ;
301301 }
302302 mTimeFrameGPU ->markUsedCluster (iLayer, track.getClusterIndex (iLayer));
@@ -320,9 +320,6 @@ void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
320320 }
321321 mTimeFrameGPU ->loadUsedClustersDevice ();
322322 }
323- if (iteration == this ->mTrkParams .size () - 1 ) {
324- mTimeFrameGPU ->unregisterHostMemory (0 );
325- }
326323};
327324
328325template <int nLayers>
0 commit comments