Project
Loading...
Searching...
No Matches
GPUTPCCompression.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 "GPUTPCCompression.h"
16#include "GPUReconstruction.h"
17#include "GPUO2DataTypes.h"
19#include "GPUDefParametersRuntime.h"
20#include "GPUConstantMem.h"
21
22using namespace o2::gpu;
23
25
31
38
40{
41 int32_t gatherMode = mRec->GetProcessingSettings().tpcCompressionGatherMode == -1 ? mRec->getGPUParameters(mRec->GetRecoStepsGPU() & GPUDataTypes::RecoStep::TPCCompression).par_COMP_GATHER_MODE : mRec->GetProcessingSettings().tpcCompressionGatherMode;
43 if (gatherMode >= 2) {
45 }
46 if (gatherMode != 1) {
48 }
49 return mem;
50}
51
53{
54 int32_t gatherMode = mRec->GetProcessingSettings().tpcCompressionGatherMode == -1 ? mRec->getGPUParameters(mRec->GetRecoStepsGPU() & GPUDataTypes::RecoStep::TPCCompression).par_COMP_GATHER_MODE : mRec->GetProcessingSettings().tpcCompressionGatherMode;
56 if (gatherMode == 1) {
58 }
59 return mem;
60}
61
62template <class T>
63void GPUTPCCompression::SetPointersCompressedClusters(void*& mem, T& c, uint32_t nClA, uint32_t nTr, uint32_t nClU, bool reducedClA)
64{
65 computePointerWithAlignment(mem, c.qTotU, nClU); // Do not reorder, qTotU ist used as first address in GPUChainTracking::RunTPCCompression
66 computePointerWithAlignment(mem, c.qMaxU, nClU);
67 computePointerWithAlignment(mem, c.flagsU, nClU);
68 computePointerWithAlignment(mem, c.padDiffU, nClU);
69 computePointerWithAlignment(mem, c.timeDiffU, nClU);
70 computePointerWithAlignment(mem, c.sigmaPadU, nClU);
71 computePointerWithAlignment(mem, c.sigmaTimeU, nClU);
72 computePointerWithAlignment(mem, c.nSliceRowClusters, GPUCA_ROW_COUNT * NSECTORS);
73
74 uint32_t nClAreduced = reducedClA ? nClA - nTr : nClA;
75
76 if (!(mRec->GetParam().rec.tpc.compressionTypeMask & GPUSettings::CompressionTrackModel)) {
77 return; // Track model disabled, do not allocate memory
78 }
79 computePointerWithAlignment(mem, c.qTotA, nClA);
80 computePointerWithAlignment(mem, c.qMaxA, nClA);
81 computePointerWithAlignment(mem, c.flagsA, nClA);
82 computePointerWithAlignment(mem, c.rowDiffA, nClAreduced);
83 computePointerWithAlignment(mem, c.sliceLegDiffA, nClAreduced);
84 computePointerWithAlignment(mem, c.padResA, nClAreduced);
85 computePointerWithAlignment(mem, c.timeResA, nClAreduced);
86 computePointerWithAlignment(mem, c.sigmaPadA, nClA);
87 computePointerWithAlignment(mem, c.sigmaTimeA, nClA);
88
89 computePointerWithAlignment(mem, c.qPtA, nTr);
90 computePointerWithAlignment(mem, c.rowA, nTr);
91 computePointerWithAlignment(mem, c.sliceA, nTr);
92 computePointerWithAlignment(mem, c.timeA, nTr);
93 computePointerWithAlignment(mem, c.padA, nTr);
94
95 computePointerWithAlignment(mem, c.nTrackClusters, nTr);
96}
97
105
121
123{
125 mMaxClusterFactorBase1024 = mMaxClusters > 100000000 ? mRec->MemoryScalers()->NTPCUnattachedHitsBase1024(mRec->GetParam().rec.tpc.rejectionStrategy) : 1024;
127 mMaxTrackClusters = mRec->GetConstantMem().tpcMerger.NOutputTrackClusters(); // TODO: Why is this not using ioPtrs? Could remove GPUConstantMem.h include
128 mMaxTracks = mRec->GetConstantMem().tpcMerger.NOutputTracks();
129 if (mMaxClusters % 16) {
130 mMaxClusters += 16 - (mMaxClusters % 16);
131 }
132}
#define GPUCA_ROW_COUNT
uint32_t c
Definition RawData.h:2
GPUReconstruction * mRec
static void computePointerWithAlignment(T *&basePtr, S *&objPtr, size_t nEntries=1)
static void computePointerWithoutAlignment(T *&basePtr, S *&objPtr, size_t nEntries=1)
RecoStepField GetRecoStepsGPU() const
int16_t RegisterMemoryAllocation(T *proc, void *(T::*setPtr)(void *), int32_t type, const char *name="", const GPUMemoryReuse &re=GPUMemoryReuse())
const GPUParam & GetParam() const
const GPUConstantMem & GetConstantMem() const
GPUMemorySizeScalers * MemoryScalers()
const GPUSettingsProcessing & GetProcessingSettings() const
virtual const GPUDefParameters & getGPUParameters(bool doGPU) const =0
void * SetPointersOutputHost(void *mem)
void SetPointersCompressedClusters(void *&mem, T &c, uint32_t nClA, uint32_t nTr, uint32_t nClU, bool reducedClA)
o2::tpc::CompressedClusters * mOutput
void * SetPointersMemory(void *mem)
void * SetPointersOutputGPU(void *mem)
static constexpr uint32_t NSECTORS
o2::tpc::CompressedClusters * mOutputA
o2::tpc::CompressedClustersPtrs mPtrs
void * SetPointersOutput(void *mem)
o2::tpc::CompressedClustersFlat * mOutputFlat
void SetMaxData(const GPUTrackingInOutPointers &io)
void * SetPointersScratch(void *mem)
size_t NTPCUnattachedHitsBase1024(int32_t type)
const o2::tpc::ClusterNativeAccess * clustersNative