Skip to content

Commit 3673ef7

Browse files
authored
ITS: cell neighbour step use atomicMax (#14595)
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent ad2098c commit 3673ef7

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

Detectors/ITSMFT/ITS/tracking/src/TrackerTraits.cxx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -601,20 +601,14 @@ void TrackerTraits<nLayers>::findCellsNeighbours(const int iteration)
601601
mTimeFrame->getCellsNeighbours()[iLayer].reserve(cellsNeighbours.size());
602602
std::ranges::transform(cellsNeighbours, std::back_inserter(mTimeFrame->getCellsNeighbours()[iLayer]), [](const auto& neigh) { return neigh.cell; });
603603

604-
auto it = cellsNeighbours.begin();
605-
int current = it->nextCell;
606-
int maxLvl = it->level;
607-
++it;
608-
for (; it != cellsNeighbours.end(); ++it) {
609-
if (it->nextCell == current) {
604+
for (auto it = cellsNeighbours.begin(); it != cellsNeighbours.end();) {
605+
int cellIdx = it->nextCell;
606+
int maxLvl = it->level;
607+
while (++it != cellsNeighbours.end() && it->nextCell == cellIdx) {
610608
maxLvl = std::max(maxLvl, it->level);
611-
} else {
612-
mTimeFrame->getCells()[iLayer + 1][current].setLevel(maxLvl);
613-
current = it->nextCell;
614-
maxLvl = it->level;
615609
}
610+
o2::gpu::CAMath::AtomicMax(mTimeFrame->getCells()[iLayer + 1][cellIdx].getLevelPtr(), maxLvl);
616611
}
617-
mTimeFrame->getCells()[iLayer + 1][current].setLevel(maxLvl);
618612
}
619613
});
620614
}

0 commit comments

Comments
 (0)