Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions GPU/GPUTracking/Global/GPUChainTrackingCompression.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ int32_t GPUChainTracking::RunTPCCompression()

int32_t GPUChainTracking::RunTPCDecompression()
{
const bool runFiltering = GetProcessingSettings().tpcApplyCFCutsAtDecoding || (GetProcessingSettings().tpcApplyClusterFilterOnCPU > 0) || (param().tpcCutTimeBin > 0);
if (runFiltering && !GetProcessingSettings().tpcUseOldCPUDecoding) {
const bool runFullFiltering = GetProcessingSettings().tpcApplyCFCutsAtDecoding || (GetProcessingSettings().tpcApplyClusterFilterOnCPU > 0) || (param().tpcCutTimeBin > 0);
if (runFullFiltering && !GetProcessingSettings().tpcUseOldCPUDecoding) {
GPUFatal("tpcApplyCFCutsAtDecoding, tpcApplyClusterFilterOnCPU and tpcCutTimeBin currently require tpcUseOldCPUDecoding");
}

Expand All @@ -219,13 +219,13 @@ int32_t GPUChainTracking::RunTPCDecompression()
return ((tmpBuffer = std::make_unique<ClusterNative[]>(size))).get();
};
auto& decompressTimer = getTimer<TPCClusterDecompressor>("TPCDecompression", 0);
auto allocatorUse = runFiltering ? std::function<ClusterNative*(size_t)>{allocatorTmp} : std::function<ClusterNative*(size_t)>{allocatorFinal};
auto allocatorUse = runFullFiltering ? std::function<ClusterNative*(size_t)>{allocatorTmp} : std::function<ClusterNative*(size_t)>{allocatorFinal};
decompressTimer.Start();
if (decomp.decompress(mIOPtrs.tpcCompressedClusters, *mClusterNativeAccess, allocatorUse, param(), GetProcessingSettings().deterministicGPUReconstruction)) {
GPUError("Error decompressing clusters");
return 1;
}
if (runFiltering) {
if (runFullFiltering) {
RunTPCClusterFilter(mClusterNativeAccess.get(), allocatorFinal, GetProcessingSettings().tpcApplyCFCutsAtDecoding);
}
decompressTimer.Stop();
Expand All @@ -245,7 +245,7 @@ int32_t GPUChainTracking::RunTPCDecompression()
mRec->PushNonPersistentMemory(qStr2Tag("TPCDCMPR"));
RecoStep myStep = RecoStep::TPCDecompression;
bool doGPU = GetRecoStepsGPU() & RecoStep::TPCDecompression;
bool runFiltering = param().tpcCutTimeBin > 0;
bool runTimeBinCutFiltering = param().tpcCutTimeBin > 0;
GPUTPCDecompression& Decompressor = processors()->tpcDecompressor;
GPUTPCDecompression& DecompressorShadow = doGPU ? processorsShadow()->tpcDecompressor : Decompressor;
const auto& threadContext = GetThreadContext();
Expand Down Expand Up @@ -325,7 +325,7 @@ int32_t GPUChainTracking::RunTPCDecompression()
if (decodedAttachedClusters != cmprClsHost.nAttachedClusters) {
GPUWarning("%u / %u clusters failed track model decoding (%f %%)", cmprClsHost.nAttachedClusters - decodedAttachedClusters, cmprClsHost.nAttachedClusters, 100.f * (float)(cmprClsHost.nAttachedClusters - decodedAttachedClusters) / (float)cmprClsHost.nAttachedClusters);
}
if (runFiltering) { // If filtering, allocate a temporary buffer and cluster native access in decompressor context
if (runTimeBinCutFiltering) { // If filtering, allocate a temporary buffer and cluster native access in decompressor context
Decompressor.mNClusterNativeBeforeFiltering = DecompressorShadow.mNClusterNativeBeforeFiltering = decodedAttachedClusters + cmprClsHost.nUnattachedClusters;
AllocateRegisteredMemory(Decompressor.mResourceTmpBufferBeforeFiltering);
AllocateRegisteredMemory(Decompressor.mResourceClusterNativeAccess);
Expand Down Expand Up @@ -362,13 +362,13 @@ int32_t GPUChainTracking::RunTPCDecompression()
int32_t iStream = (iSector / batchSize) % mRec->NStreams();
runKernel<GPUTPCDecompressionKernels, GPUTPCDecompressionKernels::step1unattached>({GetGridAuto(iStream), krnlRunRangeNone, {nullptr, &mEvents->single}}, iSector, batchSize);
uint32_t copySize = std::accumulate(mClusterNativeAccess->nClustersSector + iSector, mClusterNativeAccess->nClustersSector + iSector + batchSize, 0u);
if (!runFiltering) {
if (!runTimeBinCutFiltering) {
GPUMemCpy(RecoStep::TPCDecompression, mInputsHost->mPclusterNativeOutput + mClusterNativeAccess->clusterOffset[iSector][0], DecompressorShadow.mNativeClustersBuffer + mClusterNativeAccess->clusterOffset[iSector][0], sizeof(Decompressor.mNativeClustersBuffer[0]) * copySize, iStream, false);
}
}
SynchronizeGPU();

if (runFiltering) { // If filtering is applied, count how many clusters will remain after filtering and allocate final buffers accordingly
if (runTimeBinCutFiltering) { // If filtering is applied, count how many clusters will remain after filtering and allocate final buffers accordingly
AllocateRegisteredMemory(Decompressor.mResourceNClusterPerSectorRow);
WriteToConstantMemory(myStep, (char*)&processors()->tpcDecompressor - (char*)processors(), &DecompressorShadow, sizeof(DecompressorShadow), unattachedStream);
runKernel<GPUMemClean16>({GetGridAutoStep(unattachedStream, RecoStep::TPCDecompression), krnlRunRangeNone}, DecompressorShadow.mNClusterPerSectorRow, NSECTORS * GPUCA_ROW_COUNT * sizeof(DecompressorShadow.mNClusterPerSectorRow[0]));
Expand Down