Project
Loading...
Searching...
No Matches
GPUTPCDecompression.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#include "GPUTPCDecompression.h"
16#include "GPUTPCCompression.h"
17#include "GPUReconstruction.h"
18#include "GPUO2DataTypes.h"
20#include "GPULogging.h"
21#include <algorithm>
22
23using namespace o2::gpu;
24
26
32
33template <class T>
34void GPUTPCDecompression::SetPointersCompressedClusters(void*& mem, T& c, uint32_t nClA, uint32_t nTr, uint32_t nClU, bool reducedClA)
35{
36 computePointerWithAlignment(mem, c.qTotU, nClU); // Do not reorder, qTotU ist used as first address in GPUChainTracking::RunTPCCompression
37 computePointerWithAlignment(mem, c.qMaxU, nClU);
38 computePointerWithAlignment(mem, c.flagsU, nClU);
39 computePointerWithAlignment(mem, c.padDiffU, nClU);
40 computePointerWithAlignment(mem, c.timeDiffU, nClU);
41 computePointerWithAlignment(mem, c.sigmaPadU, nClU);
42 computePointerWithAlignment(mem, c.sigmaTimeU, nClU);
43 computePointerWithAlignment(mem, c.nSliceRowClusters, GPUCA_ROW_COUNT * NSECTORS);
44
45 uint32_t nClAreduced = reducedClA ? nClA - nTr : nClA;
46
47 if (!(c.nComppressionModes & GPUSettings::CompressionTrackModel)) {
48 return; // Track model disabled, do not allocate memory
49 }
50 computePointerWithAlignment(mem, c.qTotA, nClA);
51 computePointerWithAlignment(mem, c.qMaxA, nClA);
52 computePointerWithAlignment(mem, c.flagsA, nClA);
53 computePointerWithAlignment(mem, c.rowDiffA, nClAreduced);
54 computePointerWithAlignment(mem, c.sliceLegDiffA, nClAreduced);
55 computePointerWithAlignment(mem, c.padResA, nClAreduced);
56 computePointerWithAlignment(mem, c.timeResA, nClAreduced);
57 computePointerWithAlignment(mem, c.sigmaPadA, nClA);
58 computePointerWithAlignment(mem, c.sigmaTimeA, nClA);
59
60 computePointerWithAlignment(mem, c.qPtA, nTr);
61 computePointerWithAlignment(mem, c.rowA, nTr);
62 computePointerWithAlignment(mem, c.sliceA, nTr);
63 computePointerWithAlignment(mem, c.timeA, nTr);
64 computePointerWithAlignment(mem, c.padA, nTr);
65
66 computePointerWithAlignment(mem, c.nTrackClusters, nTr);
67}
68
74
80
87
93
99
105
107{
116}
117
119{
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
126}
#define GPUCA_ROW_COUNT
uint32_t c
Definition RawData.h:2
GPUReconstruction * mRec
static void computePointerWithAlignment(T *&basePtr, S *&objPtr, size_t nEntries=1)
int16_t RegisterMemoryAllocation(T *proc, void *(T::*setPtr)(void *), int32_t type, const char *name="", const GPUMemoryReuse &re=GPUMemoryReuse())
const GPUSettingsProcessing & GetProcessingSettings() const
void * SetPointersInputClusterNativeAccess(void *mem)
void * SetPointersTmpNativeBuffersGPU(void *mem)
void * SetPointersTmpNativeBuffersInput(void *mem)
o2::tpc::CompressedClusters mInputGPU
void * SetPointersTmpClusterNativeAccessForFiltering(void *mem)
void SetPointersCompressedClusters(void *&mem, T &c, uint32_t nClA, uint32_t nTr, uint32_t nClU, bool reducedClA)
void * SetPointersTmpNativeBuffersOutput(void *mem)
void * SetPointersNClusterPerSectorRow(void *mem)
o2::tpc::ClusterNative * mTmpNativeClusters
void SetMaxData(const GPUTrackingInOutPointers &io)
static constexpr uint32_t NSECTORS
o2::tpc::ClusterNative * mNativeClustersBuffer
o2::tpc::ClusterNativeAccess * mClusterNativeAccess