Project
Loading...
Searching...
No Matches
GPUTPCCFCheckPadBaseline.h
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
18
19#ifndef O2_GPU_GPU_TPC_CF_CHECK_PAD_BASELINE_H
20#define O2_GPU_GPU_TPC_CF_CHECK_PAD_BASELINE_H
21
22#include "GPUGeneralKernels.h"
23#include "GPUConstantMem.h"
24#include "GPUTPCGeometry.h"
25
26#include "clusterFinderDefs.h"
27#include "CfArray2D.h"
28
29namespace o2::gpu
30{
31
33{
34
35 public:
36 enum {
43 // Threads index shared memory as [iThread / MaxNPadsPerRow][iThread % MaxNPadsPerRow].
44 // Rounding up to a multiple of PadsPerCacheline ensures iThread / MaxNPadsPerRow < NumOfCachedTBs
45 // for all threads, avoiding out-of-bounds access.
46 MaxNPadsPerRow = CAMath::nextMultipleOf<PadsPerCacheline>(GPUTPCGeometry::MaxNPadsPerRow()),
47 };
48
52
55 {
56 return processors.tpcClusterer;
57 }
58
59 GPUhdi() constexpr static gpudatatypes::RecoStep GetRecoStep()
60 {
62 }
63
64 static int32_t GetNBlocks(bool isGPU)
65 {
66 const int32_t nBlocks = TPC_PADS_IN_SECTOR / PadsPerCacheline;
67 return isGPU ? GPUCA_ROW_COUNT : nBlocks;
68 }
69
70 template <int32_t iKernel = defaultKernel>
71 GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUSharedMemory& smem, processorType& clusterer);
72
73 private:
74 GPUd() static void CheckBaselineGPU(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUSharedMemory& smem, processorType& clusterer);
75 GPUd() static void CheckBaselineCPU(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUSharedMemory& smem, processorType& clusterer);
76
77 template <int32_t PadsPerBlock>
78 GPUd() static CfChargePos padToCfChargePos(int32_t& pad, const GPUTPCClusterFinder&, int32_t& padsPerRow);
79
80 struct RowInfo {
81 int16_t globalPadOffset;
82 int16_t nPads;
83 };
84 GPUd() static RowInfo GetRowInfo(int16_t row);
85
86 GPUd() static void updatePadBaseline(int32_t pad, const GPUTPCClusterFinder&, int32_t totalCharges, int32_t consecCharges, tpccf::Charge maxCharge);
87};
88
89} // namespace o2::gpu
90
91#endif
#define GPUCA_ROW_COUNT
int32_t int32_t int32_t processorType & processors
GPUhdi() const expr static gpudatatypes
int32_t int32_t int32_t GPUSharedMemory & smem
GPUd() static void Thread(int32_t nBlocks
int32_t int32_t int32_t GPUSharedMemory processorType & clusterer
GPUhdi() static processorType *Processor(GPUConstantMem &processors)
#define TPC_PADS_IN_SECTOR
tpccf::Charge charges[NumOfCachedTBs][MaxNPadsPerRow]
std::vector< int > row