Skip to content

Commit d8b4c8e

Browse files
committed
GPU TPC: improvement for dynamic buffer size for track-model decoding
1 parent e20648c commit d8b4c8e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

GPU/GPUTracking/DataCompression/GPUTPCDecompression.cxx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,11 @@ void GPUTPCDecompression::RegisterMemoryAllocation()
117117

118118
void GPUTPCDecompression::SetMaxData(const GPUTrackingInOutPointers& io)
119119
{
120-
mMaxNativeClustersPerBuffer = *std::max_element(mInputGPU.nSliceRowClusters, mInputGPU.nSliceRowClusters + mInputGPU.nSliceRows);
121-
float clsRatio = mInputGPU.nUnattachedClusters > 0 ? float(mInputGPU.nAttachedClusters) / float(mInputGPU.nUnattachedClusters) : 1.0f;
122-
mMaxNativeClustersPerBuffer *= clsRatio;
123-
mMaxNativeClustersPerBuffer = std::min(mMaxNativeClustersPerBuffer, mRec->GetProcessingSettings().tpcMaxAttachedClustersPerSectorRow);
120+
uint32_t maxAttachedClsMargin1 = *std::max_element(mInputGPU.nSliceRowClusters, mInputGPU.nSliceRowClusters + mInputGPU.nSliceRows);
121+
float clsRatio1 = std::max(mInputGPU.nUnattachedClusters > 0 ? float(mInputGPU.nAttachedClusters) / float(mInputGPU.nUnattachedClusters) : 1.5f, 1.5f); // minimum raio = 1.5
122+
maxAttachedClsMargin1 *= clsRatio1;
123+
uint32_t maxAttachedClsMargin2 = mInputGPU.nAttachedClusters / mInputGPU.nSliceRows * 3; // mean #attached cls per SectorRow multiplied by tuned number 3
124+
mMaxNativeClustersPerBuffer = std::max({maxAttachedClsMargin1, maxAttachedClsMargin2, 1000u}); // take biggest margin, 1000 clusters minimum
125+
mMaxNativeClustersPerBuffer = std::min(mMaxNativeClustersPerBuffer, mRec->GetProcessingSettings().tpcMaxAttachedClustersPerSectorRow); // upperbound given by configurable param
124126
}
127+

0 commit comments

Comments
 (0)