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#include "GPUSettings.h"
20#include "GPUDefParametersRuntime.h"
21
25
26#include "CfChargePos.h"
27#include "CfArray2D.h"
28
29using namespace o2::gpu;
30using namespace o2::tpc;
31
36
42
44{
46 return mem;
47}
48
56
65
73
79
100
102{
105
107 if (mRec->GetProcessingSettings().runMC) {
109 }
111
116}
117
119{
122 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
123 if (io.settingsTF && io.settingsTF->hasNHBFPerTF) {
124 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
125 mNMaxClusterPerRow = std::max<uint32_t>(mNMaxClusterPerRow, std::min<uint32_t>(threshold, mNMaxClusterPerRow * 10)); // Relative increased value up until a threshold, for noisy pads
126 mNMaxClusterPerRow = std::max<uint32_t>(mNMaxClusterPerRow, io.settingsTF->nHBFPerTF * 20000 / 256); // Absolute increased value, to have a minimum for noisy pads
127 }
130 }
131 if (mRec->GetProcessingSettings().tpcIncreasedMinClustersPerRow) {
132 mNMaxClusterPerRow = std::max<uint32_t>(mNMaxClusterPerRow, mRec->GetProcessingSettings().tpcIncreasedMinClustersPerRow);
133 }
137 }
138}
139
140void GPUTPCClusterFinder::SetNMaxDigits(size_t nDigits, size_t nPages, size_t nDigitsFragment, size_t nDigitsEndpointMax)
141{
143 mNMaxPages = nPages;
144 mNMaxDigitsFragment = nDigitsFragment;
145 mNMaxDigitsEndpoint = nDigitsEndpointMax;
146}
147
148uint32_t GPUTPCClusterFinder::getNSteps(size_t items) const
149{
150 if (items == 0) {
151 return 0;
152 }
153 uint32_t c = 1;
154 const size_t scanWorkgroupSize = mRec->getGPUParameters(mRec->GetRecoStepsGPU() & GPUDataTypes::RecoStep::TPCClusterFinding).par_CF_SCAN_WORKGROUP_SIZE;
155 size_t capacity = scanWorkgroupSize;
156 while (items > capacity) {
157 capacity *= scanWorkgroupSize;
158 c++;
159 }
160 return c;
161}
162
164{
165 assert(mNMaxClusterPerRow > 0);
166
168 mPindexMap = new uint32_t[TPCMapMemoryLayout<decltype(*mPindexMap)>::items(mRec->GetProcessingSettings().overrideClusterizerFragmentLen)];
170 mPlabelsInRow = new uint32_t[GPUCA_ROW_COUNT];
171}
172
174{
175 delete[] mPindexMap;
176 mPindexMap = nullptr;
177 delete[] mPlabelsByRow;
178 mPlabelsByRow = nullptr;
179 delete[] mPlabelsInRow;
180 mPlabelsInRow = nullptr;
181}
Class of a TPC cluster in TPC-native coordinates (row, time)
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)
static constexpr size_t nextMultipleOf(size_t size)
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
virtual const GPUDefParameters & getGPUParameters(bool doGPU) const =0
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