Skip to content

Commit 07f1edb

Browse files
committed
GPU: Don't crash processing MC labels of empty events
1 parent ef0c205 commit 07f1edb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ int GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
407407
ClusterNativeAccess* tmpNative = mClusterNativeAccess.get();
408408

409409
// setup MC Labels
410-
bool propagateMCLabels = GetProcessingSettings().runMC && processors()->ioPtrs.tpcPackedDigits->tpcDigitsMC != nullptr;
410+
bool propagateMCLabels = GetProcessingSettings().runMC && processors()->ioPtrs.tpcPackedDigits && processors()->ioPtrs.tpcPackedDigits->tpcDigitsMC;
411411

412412
auto* digitsMC = propagateMCLabels ? processors()->ioPtrs.tpcPackedDigits->tpcDigitsMC : nullptr;
413413

GPU/GPUTracking/Global/GPUChainTrackingMerger.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ int GPUChainTracking::RunTPCTrackingMerger(bool synchronizeOutput)
268268
runKernel<GPUTPCGMO2Output, GPUTPCGMO2Output::sort>(GetGridAuto(0, deviceType), krnlRunRangeNone, krnlEventNone);
269269
runKernel<GPUTPCGMO2Output, GPUTPCGMO2Output::output>(GetGridAuto(0, deviceType), krnlRunRangeNone, krnlEventNone);
270270

271-
if (GetProcessingSettings().runMC && mIOPtrs.clustersNative->clustersMCTruth) {
271+
if (GetProcessingSettings().runMC && mIOPtrs.clustersNative && mIOPtrs.clustersNative->clustersMCTruth) {
272272
AllocateRegisteredMemory(Merger.MemoryResOutputO2MC(), mSubOutputControls[GPUTrackingOutputs::getIndex(&GPUTrackingOutputs::tpcTracksO2Labels)]);
273273
TransferMemoryResourcesToHost(RecoStep::TPCMerging, &Merger, -1, true);
274274
runKernel<GPUTPCGMO2Output, GPUTPCGMO2Output::mc>(GetGridAuto(0, GPUReconstruction::krnlDeviceType::CPU), krnlRunRangeNone, krnlEventNone);

0 commit comments

Comments
 (0)