Skip to content

Commit e20648c

Browse files
committed
GPU TPC: added dynamic buffer allocation during track-model decoding
1 parent 171586d commit e20648c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

GPU/GPUTracking/DataCompression/GPUTPCDecompression.cxx

Lines changed: 5 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,8 @@ void GPUTPCDecompression::RegisterMemoryAllocation()
116117

117118
void GPUTPCDecompression::SetMaxData(const GPUTrackingInOutPointers& io)
118119
{
119-
mMaxNativeClustersPerBuffer = mRec->GetProcessingSettings().tpcMaxAttachedClustersPerSectorRow;
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);
120124
}

0 commit comments

Comments
 (0)