Skip to content

Commit e9ddc04

Browse files
committed
Fixes
1 parent b79d921 commit e9ddc04

6 files changed

Lines changed: 21 additions & 21 deletions

File tree

GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
13751375
if (doGPU && propagateMCLabels) {
13761376
TransferMemoryResourceLinkToHost(RecoStep::TPCClusterFinding, clusterer.mScratchId, lane);
13771377
SynchronizeStream(lane);
1378-
runKernel<GPUTPCCFClusterizer>({GetGrid(GPUTPCGeometry::NROWS, lane, GPUReconstruction::krnlDeviceType::CPU), {iSector}}, 1); // Computes MC labels
1378+
runKernel<GPUTPCCFHIPClusterizer>({GetGrid(GPUTPCGeometry::NROWS, lane, GPUReconstruction::krnlDeviceType::CPU), {iSector}}, 1); // Computes MC labels
13791379
}
13801380
}
13811381

GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ GPUd() void GPUTPCCFHIPClusterizer::Thread<0>(int32_t nBlocks, int32_t nThreads,
550550
tailStart = CAMath::Min<uint32_t>(tailStart, tail->tailStart);
551551
tailEnd = CAMath::Max<uint32_t>(tailEnd, tail->tailEnd);
552552

553-
CPU_ONLY(labelAcc.collectTail(clusterer, row, tail->pad, tail->tailStart, tail->tailEnd));
553+
CPU_ONLY(labelAcc.collectTail(row, tail->pad, tail->tailStart, tail->tailEnd));
554554
}
555555

556556
const float weightSum = CAMath::Max(qTot, 1.f);
@@ -569,7 +569,7 @@ GPUd() void GPUTPCCFHIPClusterizer::Thread<0>(int32_t nBlocks, int32_t nThreads,
569569

570570
if (cn.qMax >= 1023) {
571571

572-
uint32_t index = 0;
572+
uint32_t index;
573573

574574
if (!onlyMC) {
575575
// Cut off clusters where the tail connection failed for some reason

GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.inc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ GPUdii() void GPUTPCCFClusterizer::computeClustersImpl(int32_t nBlocks, int32_t
3939
Charge charge = chargeMap[pos].unpack();
4040

4141
ClusterAccumulator pc;
42-
CPU_ONLY(labelAcc->collect(pos, charge));
42+
CPU_ONLY(labelAcc->collect(pos));
4343

4444
buildCluster(
4545
calib,
@@ -112,8 +112,7 @@ GPUdii() void GPUTPCCFClusterizer::updateClusterInner(
112112
PackedCharge p = buf[N * lid + i];
113113

114114
Charge q = cluster->updateInner(p, d);
115-
116-
CPU_ONLY(labelAcc->collect(pos.delta(d), q));
115+
CPU_ONLY(labelAcc->collect(pos.delta(d)));
117116

118117
aboveThreshold |= (uint8_t(q > calib.tpc.cfInnerThreshold) << i);
119118
}
@@ -139,10 +138,8 @@ GPUdii() void GPUTPCCFClusterizer::updateClusterOuter(
139138

140139
Delta2 d = cfconsts::OuterNeighbors[i];
141140

142-
Charge q = cluster->updateOuter(p, d);
143-
static_cast<void>(q); // Avoid unused varible warning on GPU.
144-
145-
CPU_ONLY(labelAcc->collect(pos.delta(d), q));
141+
cluster->updateOuter(p, d);
142+
CPU_ONLY(labelAcc->collect(pos.delta(d)));
146143
}
147144
}
148145

GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinder.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ void GPUTPCClusterFinder::PrepareMC()
172172
assert(mNMaxClusterPerRow > 0);
173173

174174
clearMCMemory();
175-
mPindexMap = new uint32_t[TPCMapMemoryLayout<decltype(*mPindexMap)>::items(mRec->GetProcessingSettings().overrideClusterizerFragmentLen)];
175+
size_t nItems = TPCMapMemoryLayout<decltype(*mPindexMap)>::items(mRec->GetProcessingSettings().overrideClusterizerFragmentLen);
176+
mPindexMap = new uint32_t[nItems];
177+
std::fill_n(mPindexMap, nItems, uint32_t(-1)); // TODO check performance of this call!
176178
mPlabelsByRow = new GPUTPCClusterMCInterimArray[GPUTPCGeometry::NROWS];
177179
mPlabelsInRow = new uint32_t[GPUTPCGeometry::NROWS];
178180
}

GPU/GPUTracking/TPCClusterFinder/MCLabelAccumulator.cxx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include "GPUHostDataTypes.h"
1818
#include "GPUTPCClusterFinder.h"
19-
#include "PackedCharge.h"
2019
#include "SimulationDataFormat/MCTruthContainer.h"
2120

2221
using namespace o2::gpu;
@@ -29,13 +28,18 @@ MCLabelAccumulator::MCLabelAccumulator(GPUTPCClusterFinder& clusterer)
2928

3029
MCLabelAccumulator::~MCLabelAccumulator() {}
3130

32-
void MCLabelAccumulator::collect(const CfChargePos& pos, Charge q)
31+
void MCLabelAccumulator::collect(const CfChargePos& pos)
3332
{
34-
if (q == 0 || !engaged()) {
33+
if (!engaged()) {
3534
return;
3635
}
3736

37+
// Use -1 as sentinel to indicate a missing label.
38+
// Can't use zero charge, as HIP filter will zero existing digits.
3839
uint32_t index = mIndexMap[pos];
40+
if (index == uint32_t(-1)) {
41+
return;
42+
}
3943

4044
const auto& labels = mLabels->getLabels(index);
4145

@@ -54,16 +58,13 @@ void MCLabelAccumulator::collect(const CfChargePos& pos, Charge q)
5458
}
5559
}
5660

57-
void MCLabelAccumulator::collectTail(GPUTPCClusterFinder& clusterer, tpccf::Row row, tpccf::Pad pad, uint16_t tailStart, uint16_t tailEnd)
61+
void MCLabelAccumulator::collectTail(tpccf::Row row, tpccf::Pad pad, uint16_t tailStart, uint16_t tailEnd)
5862
{
59-
CfArray2D<const PackedCharge> chargeMap(reinterpret_cast<PackedCharge*>(clusterer.mPchargeMap));
60-
6163
const auto basePos = CfChargePos{row, pad, 0};
6264

6365
for (uint16_t t = tailStart; t < tailEnd; t++) {
6466
const auto pos = basePos.delta({0, (int16_t)t});
65-
const auto q = chargeMap[pos].unpack();
66-
collect(pos, q);
67+
collect(pos);
6768
}
6869
}
6970

GPU/GPUTracking/TPCClusterFinder/MCLabelAccumulator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ class MCLabelAccumulator
4545
MCLabelAccumulator(GPUTPCClusterFinder&);
4646
~MCLabelAccumulator(); // Explicit destructor to allow forward declaring MCCompLabel with std::vector
4747

48-
void collect(const CfChargePos& pos, tpccf::Charge q);
48+
void collect(const CfChargePos& pos);
4949

50-
void collectTail(GPUTPCClusterFinder& clusterer, tpccf::Row row, tpccf::Pad pad, uint16_t tailStart, uint16_t tailEnd);
50+
void collectTail(tpccf::Row row, tpccf::Pad pad, uint16_t tailStart, uint16_t tailEnd);
5151

5252
bool engaged() const { return mLabels != nullptr && mOutput != nullptr; }
5353

0 commit comments

Comments
 (0)