forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGPUTPCTrackletConstructor.h
More file actions
99 lines (81 loc) · 4.38 KB
/
GPUTPCTrackletConstructor.h
File metadata and controls
99 lines (81 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file GPUTPCTrackletConstructor.h
/// \author Sergey Gorbunov, David Rohr
#ifndef GPUTPCTRACKLETCONSTRUCTOR_H
#define GPUTPCTRACKLETCONSTRUCTOR_H
#include "GPUTPCDef.h"
#include "GPUTPCTrackParam.h"
#include "GPUGeneralKernels.h"
#include "GPUConstantMem.h"
namespace o2::gpu
{
/**
* @class GPUTPCTrackletConstructor
*
*/
class GPUTPCTracker;
class GPUTPCTrackletConstructor : public GPUKernelTemplate
{
public:
class GPUTPCThreadMemory
{
friend class GPUTPCTrackletConstructor; //! friend class
public:
#if !defined(GPUCA_GPUCODE)
GPUTPCThreadMemory() : mISH(0), mFirstRow(0), mLastRow(0), mStartRow(0), mEndRow(0), mCurrIH(0), mGo(0), mStage(0), mNHits(0), mNHitsEndRow(0), mNMissed(0), mLastY(0), mLastZ(0)
{
}
GPUTPCThreadMemory(const GPUTPCThreadMemory& /*dummy*/) : mISH(0), mFirstRow(0), mLastRow(0), mStartRow(0), mEndRow(0), mCurrIH(0), mGo(0), mStage(0), mNHits(0), mNHitsEndRow(0), mNMissed(0), mLastY(0), mLastZ(0) {}
GPUTPCThreadMemory& operator=(const GPUTPCThreadMemory& /*dummy*/) { return *this; }
#endif //! GPUCA_GPUCODE
protected:
// WARNING: This data is copied element by element in CopyTrackletTempData. Changes to members of this class must be reflected in CopyTrackletTempData!!!
int32_t mISH; // track index
int32_t mFirstRow; // first row index
int32_t mLastRow; // last row index
int32_t mStartRow; // row index of first hit in seed
int32_t mEndRow; // row index of last hit in seed
calink mCurrIH; // indef of the current hit
int8_t mGo; // do fit/searching flag
int32_t mStage; // reco stage
int32_t mNHits; // n track hits
int32_t mNHitsEndRow; // n hits at end row
int32_t mNMissed; // n missed hits during search
float mLastY; // Y of the last fitted cluster
float mLastZ; // Z of the last fitted cluster
};
struct GPUSharedMemory {
CA_SHARED_STORAGE(GPUTPCRow mRows[GPUCA_ROW_COUNT]); // rows
int32_t mNStartHits; // Total number of start hits
#ifdef GPUCA_TRACKLET_CONSTRUCTOR_DO_PROFILE
int32_t fMaxSync; // temporary shared variable during profile creation
#endif // GPUCA_TRACKLET_CONSTRUCTOR_DO_PROFILE
};
GPUd() static void InitTracklet(GPUTPCTrackParam& tParam);
template <class T>
GPUd() static void UpdateTracklet(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() T& s, GPUTPCThreadMemory& r, GPUconstantref() GPUTPCTracker& tracker, GPUTPCTrackParam& tParam, int32_t iRow, calink& rowHit, calink* rowHits);
GPUd() static void StoreTracklet(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& s, GPUTPCThreadMemory& r, GPUconstantref() GPUTPCTracker& tracker, GPUTPCTrackParam& tParam, calink* rowHits);
GPUd() static bool CheckCov(GPUTPCTrackParam& tParam);
GPUd() static void DoTracklet(GPUconstantref() GPUTPCTracker& tracker, GPUsharedref() GPUTPCTrackletConstructor::GPUSharedMemory& sMem, GPUTPCThreadMemory& rMem);
template <class T>
GPUd() static int32_t GPUTPCTrackletConstructorExtrapolationTracking(GPUconstantref() GPUTPCTracker& tracker, GPUsharedref() T& sMem, GPUTPCTrackParam& tParam, int32_t startrow, int32_t increment, int32_t iTracklet, calink* rowHits);
typedef GPUconstantref() GPUTPCTracker processorType;
GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCSectorTracking; }
GPUhdi() static processorType* Processor(GPUConstantMem& processors)
{
return processors.tpcTrackers;
}
template <int32_t iKernel = GPUKernelTemplate::defaultKernel>
GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& tracker);
};
} // namespace o2::gpu
#endif // GPUTPCTRACKLETCONSTRUCTOR_H