Project
Loading...
Searching...
No Matches
GPUTPCClusterFinder.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 "GPUTPCClusterFinder.h"
16#include "GPUReconstruction.h"
18#include "GPUHostDataTypes.h"
19
22
23#include "ChargePos.h"
24#include "Array2D.h"
25
26using namespace o2::gpu;
27using namespace o2::tpc;
28
33
39
41{
43 return mem;
44}
45
47{
48 if (mNMaxPages == 0 && (mRec->GetRecoStepsGPU() & GPUDataTypes::RecoStep::TPCClusterFinding)) {
50 }
51 return mem;
52}
53
55{
56 const int32_t n = (mRec->GetRecoStepsGPU() & GPUDataTypes::RecoStep::TPCClusterFinding) ? mNMaxPages : GPUTrackingInOutZS::NENDPOINTS;
57 if (n) {
59 }
60 return mem;
61}
62
64{
65 if (mNMaxPages && (mRec->GetRecoStepsGPU() & GPUDataTypes::RecoStep::TPCClusterFinding)) {
67 }
68 return mem;
69}
70
76
96
98{
101
103 if (mRec->GetProcessingSettings().runMC) {
105 }
107
112}
113
115{
118 mNMaxClusterPerRow = 0.01f * mRec->MemoryScalers()->NTPCClusters(mNMaxDigits, true); // TODO: Can save some memory hery by using mNMaxClusters, and copying the computed clusters out after every fragment
119 if (io.settingsTF && io.settingsTF->hasNHBFPerTF) {
120 uint32_t threshold = 300000 * io.settingsTF->nHBFPerTF / 128; // TODO: Probably one would need to do this on a row-basis for a better estimate, but currently not supported
121 mNMaxClusterPerRow = std::max<uint32_t>(mNMaxClusterPerRow, std::min<uint32_t>(threshold, mNMaxClusterPerRow * 10)); // Relative increased value up until a threshold, for noisy pads
122 mNMaxClusterPerRow = std::max<uint32_t>(mNMaxClusterPerRow, io.settingsTF->nHBFPerTF * 20000 / 256); // Absolute increased value, to have a minimum for noisy pads
123 }
126 }
127 if (mRec->GetProcessingSettings().tpcIncreasedMinClustersPerRow) {
128 mNMaxClusterPerRow = std::max<uint32_t>(mNMaxClusterPerRow, mRec->GetProcessingSettings().tpcIncreasedMinClustersPerRow);
129 }
130
131 mBufSize = nextMultipleOf<std::max<int32_t>(GPUCA_MEMALIGN, mScanWorkGroupSize)>(mNMaxDigitsFragment);
133}
134
135void GPUTPCClusterFinder::SetNMaxDigits(size_t nDigits, size_t nPages, size_t nDigitsFragment, size_t nDigitsEndpointMax)
136{
137 mNMaxDigits = nextMultipleOf<std::max<int32_t>(GPUCA_MEMALIGN, mScanWorkGroupSize)>(nDigits);
138 mNMaxPages = nPages;
139 mNMaxDigitsFragment = nDigitsFragment;
140 mNMaxDigitsEndpoint = nDigitsEndpointMax;
141}
142
143uint32_t GPUTPCClusterFinder::getNSteps(size_t items) const
144{
145 if (items == 0) {
146 return 0;
147 }
148 uint32_t c = 1;
149 size_t capacity = mScanWorkGroupSize;
150 while (items > capacity) {
151 capacity *= mScanWorkGroupSize;
152 c++;
153 }
154 return c;
155}
156
158{
159 assert(mNMaxClusterPerRow > 0);
160
162 mPindexMap = new uint32_t[TPCMapMemoryLayout<decltype(*mPindexMap)>::items(mRec->GetProcessingSettings().overrideClusterizerFragmentLen)];
164 mPlabelsInRow = new uint32_t[GPUCA_ROW_COUNT];
165}
166
168{
169 delete[] mPindexMap;
170 mPindexMap = nullptr;
171 delete[] mPlabelsByRow;
172 mPlabelsByRow = nullptr;
173 delete[] mPlabelsInRow;
174 mPlabelsInRow = nullptr;
175}
Definition of the TPC Digit.
#define GPUCA_MEMALIGN
#define GPUCA_ROW_COUNT
uint32_t c
Definition RawData.h:2
Definitions of TPC Zero Suppression Data Headers.
GPUReconstruction * mRec
static void computePointerWithAlignment(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())
GPUMemorySizeScalers * MemoryScalers()
const GPUSettingsProcessing & GetProcessingSettings() const
static constexpr int32_t mScanWorkGroupSize
void SetMaxData(const GPUTrackingInOutPointers &io)
void SetNMaxDigits(size_t nDigits, size_t nPages, size_t nDigitsFragment, size_t nDigitsEndpointMax)
GPUTPCClusterMCInterimArray * mPlabelsByRow
uint32_t getNSteps(size_t items) const
tpc::ClusterNative * mPclusterByRow
#define TPC_PADS_IN_SECTOR
GLdouble n
Definition glcorearb.h:1982
Global TPC definitions and constants.
Definition SimTraits.h:167
size_t NTPCPeaks(size_t tpcDigits, bool perSector=false)
size_t NTPCClusters(size_t tpcDigits, bool perSector=false)
const GPUSettingsTF * settingsTF
static constexpr uint32_t NENDPOINTS
static constexpr size_t TPC_ZS_PAGE_SIZE