Skip to content

Commit f6f9e1f

Browse files
committed
ITS: cell neighbour step use atomicMax
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 0364324 commit f6f9e1f

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
@@ -596,20 +596,14 @@ void TrackerTraits<nLayers>::findCellsNeighbours(const int iteration)
596596
mTimeFrame->getCellsNeighbours()[iLayer].reserve(cellsNeighbours.size());
597597
std::ranges::transform(cellsNeighbours, std::back_inserter(mTimeFrame->getCellsNeighbours()[iLayer]), [](const auto& neigh) { return neigh.cell; });
598598

599-
auto it = cellsNeighbours.begin();
600-
int current = it->nextCell;
601-
int maxLvl = it->level;
602-
++it;
603-
for (; it != cellsNeighbours.end(); ++it) {
604-
if (it->nextCell == current) {
599+
for (auto it = cellsNeighbours.begin(); it != cellsNeighbours.end();) {
600+
int cellIdx = it->nextCell;
601+
int maxLvl = it->level;
602+
while (++it != cellsNeighbours.end() && it->nextCell == cellIdx) {
605603
maxLvl = std::max(maxLvl, it->level);
606-
} else {
607-
mTimeFrame->getCells()[iLayer + 1][current].setLevel(maxLvl);
608-
current = it->nextCell;
609-
maxLvl = it->level;
610604
}
605+
o2::gpu::CAMath::AtomicMax(mTimeFrame->getCells()[iLayer + 1][cellIdx].getLevelPtr(), maxLvl);
611606
}
612-
mTimeFrame->getCells()[iLayer + 1][current].setLevel(maxLvl);
613607
}
614608
});
615609
}

0 commit comments

Comments
 (0)