Skip to content

Commit 03da3ee

Browse files
ktfdavidrohr
authored andcommitted
GPU Clusterizer: synchronize the cluster transfer to the host before sorting the clusters
In deterministic mode (or with debugLevel >= 4), the clusters are copied from the GPU to the host on the last stream, sorted on the host, and copied back to the GPU. The copy to the host was only waited for with synchronizeOutput, which RunTPCClusterizer gets as false, so the host sorted a partially transferred buffer, still holding the previous time frame's clusters, and uploaded the result: the clusters seen by the tracking, and the track counts, changed from run to run.
1 parent 47101dc commit 03da3ee

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
15821582
mInputsHost->mPclusterNativeAccess->setOffsetPtrs();
15831583
TransferMemoryResourceLinkToGPU(RecoStep::TPCClusterFinding, mInputsHost->mResourceClusterNativeAccess, 0);
15841584
}
1585-
if (doGPU && synchronizeOutput) {
1585+
if (doGPU && (synchronizeOutput || sortClusters)) { // SortClusters works on the host copy of the clusters, which is transferred on this stream
15861586
SynchronizeStream(mRec->NStreams() - 1);
15871587
}
15881588
if (doGPU && synchronizeCalibUpdate) {

0 commit comments

Comments
 (0)