Skip to content

Commit 95b425a

Browse files
authored
GPU TPC: added dynamic buffer allocation during track-model decoding (#14747)
* GPU TPC: added dynamic buffer allocation during track-model decoding * GPU TPC: improvement for dynamic buffer size for track-model decoding * GPU TPC: increased margins for track-model decoding buffers
1 parent 3fbf253 commit 95b425a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

GPU/GPUTracking/DataCompression/GPUTPCDecompression.cxx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "GPUO2DataTypes.h"
1919
#include "GPUMemorySizeScalers.h"
2020
#include "GPULogging.h"
21+
#include <algorithm>
2122

2223
using namespace o2::gpu;
2324

@@ -116,5 +117,10 @@ void GPUTPCDecompression::RegisterMemoryAllocation()
116117

117118
void GPUTPCDecompression::SetMaxData(const GPUTrackingInOutPointers& io)
118119
{
119-
mMaxNativeClustersPerBuffer = mRec->GetProcessingSettings().tpcMaxAttachedClustersPerSectorRow;
120+
uint32_t maxAttachedClsMargin1 = *std::max_element(mInputGPU.nSliceRowClusters, mInputGPU.nSliceRowClusters + mInputGPU.nSliceRows);
121+
float clsRatio1 = (mInputGPU.nUnattachedClusters > 0 ? float(mInputGPU.nAttachedClusters) / float(mInputGPU.nUnattachedClusters) : 1.0f) * 1.5f;
122+
maxAttachedClsMargin1 *= clsRatio1;
123+
uint32_t maxAttachedClsMargin2 = mInputGPU.nAttachedClusters / mInputGPU.nSliceRows * 3.5; // mean #attached cls per SectorRow multiplied by 3.5 (tuned)
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
120126
}

0 commit comments

Comments
 (0)