Project
Loading...
Searching...
No Matches
GPUDataTypes.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
14
15#ifndef GPUDATATYPES_H
16#define GPUDATATYPES_H
17
18#include "GPUCommonDef.h"
19
20// These are basic and non-complex data types, which will also be visible on the GPU.
21// Please add complex data types required on the host but not GPU to GPUHostDataTypes.h and forward-declare!
22#ifndef GPUCA_GPUCODE_DEVICE
23#include <cstddef>
24#endif
25#include "GPUCommonTypeTraits.h"
26#include "GPUTRDDef.h"
27
30namespace o2::tpc
31{
32struct ClusterNativeAccess;
33struct CompressedClustersFlat;
34class Digit;
35class TrackTPC;
36namespace constants
37{
38} // namespace constants
39} // namespace o2::tpc
40
41namespace o2
42{
43class MCCompLabel;
44template <typename T>
45class BaseCluster;
46namespace base
47{
48template <typename T>
49class PropagatorImpl;
50class MatLayerCylSet;
51} // namespace base
52namespace track
53{
54template <typename value_T>
55class TrackParametrizationWithError;
56using TrackParCov = TrackParametrizationWithError<float>;
57} // namespace track
58namespace trd
59{
60class GeometryFlat;
61} // namespace trd
62namespace dataformats
63{
64class TrackTPCITS;
65class MatchInfoTOF;
66template <class T>
68template <class T>
69class ConstMCTruthContainerView;
70} // namespace dataformats
71namespace itsmft
72{
73class CompClusterExt;
74class ROFRecord;
75class TopologyDictionary;
76} // namespace itsmft
77namespace its
78{
79class TrackITS;
80} // namespace its
81namespace tof
82{
83class Cluster;
84} // namespace tof
85namespace tpc
86{
87class CalibdEdxContainer;
88} // namespace tpc
89} // namespace o2
90
91namespace o2::gpu
92{
93class CorrectionMapsHelper;
94class TPCFastTransform;
95struct TPCPadGainCalib;
96struct TPCZSLinkMapping;
97
98#include "utils/bitfield.h"
99#define ENUM_CLASS class
100#define ENUM_UINT : uint32_t
101#define GPUCA_RECO_STEP GPUDataTypes::RecoStep
102
103class GPUTPCTrack;
104class GPUTPCHitId;
105class GPUTPCGMMergedTrack;
106struct GPUTPCGMMergedTrackHit;
107struct GPUTPCGMMergedTrackHitXYZ;
108class GPUTRDTrackletWord;
109class GPUTRDSpacePoint;
110struct GPUTPCMCInfo;
111struct GPUTPCMCInfoCol;
112struct GPUTPCClusterData;
113struct GPUTRDTrackletLabels;
114struct GPUTPCDigitsMCInput;
115struct GPUSettingsTF;
116
118{
119 public:
120 enum ENUM_CLASS GeometryType ENUM_UINT{RESERVED_GEOMETRY = 0, ALIROOT = 1, O2 = 2};
121 enum DeviceType ENUM_UINT { INVALID_DEVICE = 0,
122 CPU = 1,
123 CUDA = 2,
124 HIP = 3,
125 OCL = 4 };
126 enum ENUM_CLASS GeneralStep { Prepare = 1,
127 QA = 2 };
128
129 enum ENUM_CLASS RecoStep { TPCConversion = 1,
138 Refit = 512,
139 AllRecoSteps = 0x7FFFFFFF,
140 NoRecoStep = 0 };
141 enum ENUM_CLASS InOutType { TPCClusters = 1,
147 TPCRaw = 64,
149 ITSTracks = 256 };
150#ifndef __OPENCL__
151 static constexpr const char* const DEVICE_TYPE_NAMES[] = {"INVALID", "CPU", "CUDA", "HIP", "OCL"};
152 static constexpr const char* const RECO_STEP_NAMES[] = {"TPC Transformation", "TPC Sector Tracking", "TPC Track Merging and Fit", "TPC Compression", "TRD Tracking", "ITS Tracking", "TPC dEdx Computation", "TPC Cluster Finding", "TPC Decompression", "Global Refit"};
153 static constexpr const char* const GENERAL_STEP_NAMES[] = {"Prepare", "QA"};
154 constexpr static int32_t N_RECO_STEPS = sizeof(GPUDataTypes::RECO_STEP_NAMES) / sizeof(GPUDataTypes::RECO_STEP_NAMES[0]);
156#endif
159 static constexpr uint32_t NSECTORS = 36;
160 static DeviceType GetDeviceType(const char* type);
161};
162
169
170template <class T>
172 typedef T type;
173};
174template <class T>
175struct ConstPtr {
176 typedef const T type;
177};
178
179template <template <typename T> class S>
193typedef GPUCalibObjectsTemplate<DefaultPtr> GPUCalibObjects; // NOTE: These 2 must have identical layout since they are memcopied
195
197 static constexpr uint32_t NSECTORS = GPUDataTypes::NSECTORS;
198 static constexpr uint32_t NENDPOINTS = 20;
200 const void* const* zsPtr[NENDPOINTS];
201 const uint32_t* nZSPtr[NENDPOINTS];
202 uint32_t count[NENDPOINTS];
203 };
205 uint32_t count[NSECTORS][NENDPOINTS] = {};
206 };
212};
213
215 static constexpr uint32_t NSECTORS = GPUDataTypes::NSECTORS;
216 const o2::tpc::Digit* tpcDigits[NSECTORS] = {nullptr};
217 size_t nTPCDigits[NSECTORS] = {0};
219};
220
223
224 // TPC
225 static constexpr uint32_t NSECTORS = GPUDataTypes::NSECTORS;
226 const GPUTrackingInOutZS* tpcZS = nullptr;
229 uint32_t nClusterData[NSECTORS] = {0};
231 uint32_t nRawClusters[NSECTORS] = {0};
233 const GPUTPCTrack* sectorTracks[NSECTORS] = {nullptr};
234 uint32_t nSectorTracks[NSECTORS] = {0};
236 uint32_t nSectorClusters[NSECTORS] = {0};
238 uint32_t nMCLabelsTPC = 0;
239 const GPUTPCMCInfo* mcInfosTPC = nullptr;
240 uint32_t nMCInfosTPC = 0;
242 uint32_t nMCInfosTPCCol = 0;
244 uint32_t nMergedTracks = 0;
247 uint32_t nMergedTrackHits = 0;
248 const uint32_t* mergedTrackHitAttachment = nullptr;
249 const uint8_t* mergedTrackHitStates = nullptr;
251 uint32_t nOutputTracksTPCO2 = 0;
252 const uint32_t* outputClusRefsTPCO2 = nullptr;
256
257 // TPC links
258 int32_t* tpcLinkITS = nullptr;
259 int32_t* tpcLinkTRD = nullptr;
260 int32_t* tpcLinkTOF = nullptr;
262 float* globalTrackTimes = nullptr;
263 uint32_t nGlobalTracks = 0;
264
265 // TRD
268 uint32_t nTRDTracklets = 0;
269 const GPUTRDTrackGPU* trdTracks = nullptr;
270 const GPUTRDTrack* trdTracksO2 = nullptr;
271 uint32_t nTRDTracks = 0;
272 const float* trdTriggerTimes = nullptr;
273 const int32_t* trdTrackletIdxFirst = nullptr;
274 const uint8_t* trdTrigRecMask = nullptr;
275 uint32_t nTRDTriggerRecords = 0;
278 const GPUTRDTrack* trdTracksTPCTRD = nullptr;
279 uint32_t nTRDTracksTPCTRD = 0;
280
281 // TOF
283 uint32_t nTOFClusters = 0;
285 uint32_t nITSTPCTOFMatches = 0;
289 uint32_t nTPCTRDTOFMatches = 0;
291 uint32_t nTPCTOFMatches = 0;
292
293 // ITS
297 uint32_t nItsClusters = 0;
299 uint32_t nItsClusterROF = 0;
300 const o2::its::TrackITS* itsTracks = nullptr;
301 const o2::MCCompLabel* itsTrackMC = nullptr;
302 uint32_t nItsTracks = 0;
303 const int32_t* itsTrackClusIdx = nullptr;
305 uint32_t nItsTrackROF = 0;
306
307 // TPC-ITS
309 uint32_t nTracksTPCITSO2 = 0;
310
311 // Common
312 const GPUSettingsTF* settingsTF = nullptr;
313};
314
315#undef ENUM_CLASS
316#undef ENUM_UINT
317} // namespace o2::gpu
318
319#endif
#define ENUM_CLASS
TPCCompression
TPCdEdx
TPCRaw
AllRecoSteps
TRDTracklets
TPCMerging
TPCConversion
CPU
ITSTracking
INVALID_DEVICE
CUDA
#define ENUM_UINT
ALIROOT
HIP
TPCSectorTracking
TPCMergedTracks
TPCClusters
Refit
TPCSectorTracks
TPCCompressedClusters
Prepare
TRDTracking
TPCClusterFinding
TPCDecompression
RESERVED_GEOMETRY
TRDTracks
ITSClusters
o2::track::TrackParCov TrackParCov
Definition Recon.h:39
static DeviceType GetDeviceType(const char *type)
static constexpr const char *const GENERAL_STEP_NAMES[]
static constexpr const char *const RECO_STEP_NAMES[]
static constexpr const char *const DEVICE_TYPE_NAMES[]
static constexpr int32_t N_RECO_STEPS
static constexpr uint32_t NSECTORS
static constexpr int32_t N_GENERAL_STEPS
bitfield< RecoStep, uint32_t > RecoStepField
bitfield< InOutType, uint32_t > InOutTypeField
HMPID cluster implementation.
Definition Cluster.h:27
Cluster class for TOF.
Definition Cluster.h:37
GLdouble n
Definition glcorearb.h:1982
GLint GLsizei count
Definition glcorearb.h:399
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
o2::cpv::Digit Digit
GPUCalibObjectsTemplate< ConstPtr > GPUCalibObjectsConst
GPUCalibObjectsTemplate< DefaultPtr > GPUCalibObjects
Global TPC definitions and constants.
Definition SimTraits.h:167
TrackParCovF TrackParCov
Definition Track.h:33
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
S< o2::trd::GeometryFlat >::type * trdGeometry
S< o2::itsmft::TopologyDictionary >::type * itsPatternDict
S< o2::tpc::CalibdEdxContainer >::type * dEdxCalibContainer
S< TPCZSLinkMapping >::type * tpcZSLinkMapping
S< TPCFastTransform >::type * fastTransform
S< TPCPadGainCalib >::type * tpcPadGain
S< o2::base::PropagatorImpl< float > >::type * o2Propagator
S< o2::base::MatLayerCylSet >::type * matLUT
S< CorrectionMapsHelper >::type * fastTransformHelper
S< TPCFastTransform >::type * fastTransformRef
S< TPCFastTransform >::type * fastTransformMShape
GPUDataTypes::RecoStepField stepsGPUMask
GPUDataTypes::InOutTypeField outputs
GPUDataTypes::RecoStepField steps
GPUDataTypes::InOutTypeField inputs
const o2::tpc::Digit * tpcDigits[NSECTORS]
const GPUTPCDigitsMCInput * tpcDigitsMC
static constexpr uint32_t NSECTORS
const GPUTPCGMMergedTrackHitXYZ * mergedTrackHitsXYZ
const o2::itsmft::CompClusterExt * itsCompClusters
const GPUTPCHitId * sectorClusters[NSECTORS]
const o2::tpc::ClusterNativeAccess * clustersNative
const GPUTPCMCInfo * mcInfosTPC
const o2::dataformats::MCTruthContainer< o2::MCCompLabel > * itsClusterMC
const o2::dataformats::MatchInfoTOF * tpctofMatches
const o2::dataformats::MatchInfoTOF * tpctrdtofMatches
const o2::MCCompLabel * itsTrackMC
const o2::dataformats::MatchInfoTOF * itstpctrdtofMatches
const GPUTRDTrack * trdTracksTPCTRD
const o2::tpc::CompressedClustersFlat * tpcCompressedClusters
const AliHLTTPCClusterMCLabel * mcLabelsTPC
const GPUTRDSpacePoint * trdSpacePoints
const o2::tof::Cluster * tofClusters
const o2::BaseCluster< float > * itsClusters
const GPUTPCTrack * sectorTracks[NSECTORS]
const o2::itsmft::ROFRecord * itsClusterROF
const o2::dataformats::MatchInfoTOF * itstpctofMatches
const uint32_t * mergedTrackHitAttachment
const GPUTRDTrackGPU * trdTracks
const GPUSettingsTF * settingsTF
const GPUTRDTrackletWord * trdTracklets
const GPUTrackingInOutZS * tpcZS
const AliHLTTPCRawCluster * rawClusters[NSECTORS]
const GPUTPCClusterData * clusterData[NSECTORS]
const o2::its::TrackITS * itsTracks
const o2::dataformats::TrackTPCITS * tracksTPCITSO2
const o2::MCCompLabel * outputTracksTPCO2MC
static constexpr uint32_t NSECTORS
const o2::itsmft::ROFRecord * itsTrackROF
const o2::tpc::TrackTPC * outputTracksTPCO2
const GPUTPCGMMergedTrackHit * mergedTrackHits
const GPUTrackingInOutDigits * tpcPackedDigits
const GPUTRDTrack * trdTracksITSTPCTRD
const o2::track::TrackParCov ** globalTracks
const GPUTPCMCInfoCol * mcInfosTPCCol
const GPUTPCGMMergedTrack * mergedTracks
GPUTrackingInOutZSSector sector[NSECTORS]
static constexpr uint32_t NSECTORS
static constexpr uint32_t NENDPOINTS