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 <type_traits> // for bitfield below
24#include <cstddef>
25#endif
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
100class GPUTPCTrack;
101class GPUTPCHitId;
102class GPUTPCGMMergedTrack;
103struct GPUTPCGMMergedTrackHit;
104class GPUTRDTrackletWord;
105class GPUTRDSpacePoint;
106struct GPUTPCMCInfo;
107struct GPUTPCMCInfoCol;
108struct GPUTPCClusterData;
109struct GPUTRDTrackletLabels;
110struct GPUTPCDigitsMCInput;
111struct GPUSettingsTF;
112
114{
115 public:
116 // clang-format off
117 enum class GeometryType : uint32_t { RESERVED_GEOMETRY = 0, ALIROOT = 1, O2 = 2 };
118 enum DeviceType : uint32_t { INVALID_DEVICE = 0, CPU = 1, CUDA = 2, HIP = 3, OCL = 4 };
119 enum class GeneralStep { Prepare = 1, QA = 2 };
120 // clang-format on
121
122 enum class RecoStep { TPCConversion = 1,
124 TPCMerging = 4,
125 TPCCompression = 8,
126 TRDTracking = 16,
127 ITSTracking = 32,
128 TPCdEdx = 64,
129 TPCClusterFinding = 128,
130 TPCDecompression = 256,
131 Refit = 512,
132 AllRecoSteps = 0x7FFFFFFF,
133 NoRecoStep = 0 };
134 enum class InOutType { TPCClusters = 1,
135 OBSOLETE = 2,
136 TPCMergedTracks = 4,
138 TRDTracklets = 16,
139 TRDTracks = 32,
140 TPCRaw = 64,
141 ITSClusters = 128,
142 ITSTracks = 256 };
143#ifndef __OPENCL__
144 static constexpr const char* const DEVICE_TYPE_NAMES[] = {"INVALID", "CPU", "CUDA", "HIP", "OCL"};
145 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"};
146 static constexpr const char* const GENERAL_STEP_NAMES[] = {"Prepare", "QA"};
147 constexpr static int32_t N_RECO_STEPS = sizeof(GPUDataTypes::RECO_STEP_NAMES) / sizeof(GPUDataTypes::RECO_STEP_NAMES[0]);
149#endif
152 static constexpr uint32_t NSECTORS = 36;
153 static DeviceType GetDeviceType(const char* type);
154};
155
162
163template <class T>
165 typedef T type;
166};
167template <class T>
168struct ConstPtr {
169 typedef const T type;
170};
171
172template <template <typename T> class S>
186typedef GPUCalibObjectsTemplate<DefaultPtr> GPUCalibObjects; // NOTE: These 2 must have identical layout since they are memcopied
188
190 static constexpr uint32_t NSECTORS = GPUDataTypes::NSECTORS;
191 static constexpr uint32_t NENDPOINTS = 20;
193 const void* const* zsPtr[NENDPOINTS];
194 const uint32_t* nZSPtr[NENDPOINTS];
195 uint32_t count[NENDPOINTS];
196 };
198 uint32_t count[NSECTORS][NENDPOINTS] = {};
199 };
205};
206
208 static constexpr uint32_t NSECTORS = GPUDataTypes::NSECTORS;
209 const o2::tpc::Digit* tpcDigits[NSECTORS] = {nullptr};
210 size_t nTPCDigits[NSECTORS] = {0};
212};
213
216
217 // TPC
218 static constexpr uint32_t NSECTORS = GPUDataTypes::NSECTORS;
219 const GPUTrackingInOutZS* tpcZS = nullptr;
222 uint32_t nClusterData[NSECTORS] = {0};
224 uint32_t nRawClusters[NSECTORS] = {0};
226 const GPUTPCTrack* sectorTracks[NSECTORS] = {nullptr};
227 uint32_t nSectorTracks[NSECTORS] = {0};
229 uint32_t nSectorClusters[NSECTORS] = {0};
231 uint32_t nMCLabelsTPC = 0;
232 const GPUTPCMCInfo* mcInfosTPC = nullptr;
233 uint32_t nMCInfosTPC = 0;
235 uint32_t nMCInfosTPCCol = 0;
237 uint32_t nMergedTracks = 0;
239 uint32_t nMergedTrackHits = 0;
240 const uint32_t* mergedTrackHitAttachment = nullptr;
241 const uint8_t* mergedTrackHitStates = nullptr;
243 uint32_t nOutputTracksTPCO2 = 0;
244 const uint32_t* outputClusRefsTPCO2 = nullptr;
248
249 // TPC links
250 int32_t* tpcLinkITS = nullptr;
251 int32_t* tpcLinkTRD = nullptr;
252 int32_t* tpcLinkTOF = nullptr;
254 float* globalTrackTimes = nullptr;
255 uint32_t nGlobalTracks = 0;
256
257 // TRD
260 uint32_t nTRDTracklets = 0;
261 const GPUTRDTrackGPU* trdTracks = nullptr;
262 const GPUTRDTrack* trdTracksO2 = nullptr;
263 uint32_t nTRDTracks = 0;
264 const float* trdTriggerTimes = nullptr;
265 const int32_t* trdTrackletIdxFirst = nullptr;
266 const uint8_t* trdTrigRecMask = nullptr;
267 uint32_t nTRDTriggerRecords = 0;
270 const GPUTRDTrack* trdTracksTPCTRD = nullptr;
271 uint32_t nTRDTracksTPCTRD = 0;
272
273 // TOF
275 uint32_t nTOFClusters = 0;
277 uint32_t nITSTPCTOFMatches = 0;
281 uint32_t nTPCTRDTOFMatches = 0;
283 uint32_t nTPCTOFMatches = 0;
284
285 // ITS
289 uint32_t nItsClusters = 0;
291 uint32_t nItsClusterROF = 0;
292 const o2::its::TrackITS* itsTracks = nullptr;
293 const o2::MCCompLabel* itsTrackMC = nullptr;
294 uint32_t nItsTracks = 0;
295 const int32_t* itsTrackClusIdx = nullptr;
297 uint32_t nItsTrackROF = 0;
298
299 // TPC-ITS
301 uint32_t nTracksTPCITSO2 = 0;
302
303 // Common
304 const GPUSettingsTF* settingsTF = nullptr;
305};
306
307} // namespace o2::gpu
308
309#endif
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< DefaultPtr > GPUCalibObjects
GPUCalibObjectsTemplate< ConstPtr > GPUCalibObjectsConst
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 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