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
100class GPUTPCTrack;
101class GPUTPCHitId;
102class GPUTPCGMMergedTrack;
103struct GPUTPCGMMergedTrackHit;
104struct GPUTPCGMMergedTrackHitXYZ;
105class GPUTRDTrackletWord;
106class GPUTRDSpacePoint;
107struct GPUTPCMCInfo;
108struct GPUTPCMCInfoCol;
109struct GPUTPCClusterData;
110struct GPUTRDTrackletLabels;
111struct GPUTPCDigitsMCInput;
112struct GPUSettingsTF;
113
115{
116 public:
117 // clang-format off
118 enum class GeometryType : uint32_t { RESERVED_GEOMETRY = 0, ALIROOT = 1, O2 = 2 };
119 enum DeviceType : uint32_t { INVALID_DEVICE = 0, CPU = 1, CUDA = 2, HIP = 3, OCL = 4 };
120 enum class GeneralStep { Prepare = 1, QA = 2 };
121 // clang-format on
122
123 enum class RecoStep { TPCConversion = 1,
125 TPCMerging = 4,
126 TPCCompression = 8,
127 TRDTracking = 16,
128 ITSTracking = 32,
129 TPCdEdx = 64,
130 TPCClusterFinding = 128,
131 TPCDecompression = 256,
132 Refit = 512,
133 AllRecoSteps = 0x7FFFFFFF,
134 NoRecoStep = 0 };
135 enum class InOutType { TPCClusters = 1,
136 OBSOLETE = 2,
137 TPCMergedTracks = 4,
139 TRDTracklets = 16,
140 TRDTracks = 32,
141 TPCRaw = 64,
142 ITSClusters = 128,
143 ITSTracks = 256 };
144#ifndef __OPENCL__
145 static constexpr const char* const DEVICE_TYPE_NAMES[] = {"INVALID", "CPU", "CUDA", "HIP", "OCL"};
146 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"};
147 static constexpr const char* const GENERAL_STEP_NAMES[] = {"Prepare", "QA"};
148 constexpr static int32_t N_RECO_STEPS = sizeof(GPUDataTypes::RECO_STEP_NAMES) / sizeof(GPUDataTypes::RECO_STEP_NAMES[0]);
150#endif
153 static constexpr uint32_t NSECTORS = 36;
154 static DeviceType GetDeviceType(const char* type);
155};
156
163
164template <class T>
166 typedef T type;
167};
168template <class T>
169struct ConstPtr {
170 typedef const T type;
171};
172
173template <template <typename T> class S>
187typedef GPUCalibObjectsTemplate<DefaultPtr> GPUCalibObjects; // NOTE: These 2 must have identical layout since they are memcopied
189
191 static constexpr uint32_t NSECTORS = GPUDataTypes::NSECTORS;
192 static constexpr uint32_t NENDPOINTS = 20;
194 const void* const* zsPtr[NENDPOINTS];
195 const uint32_t* nZSPtr[NENDPOINTS];
196 uint32_t count[NENDPOINTS];
197 };
199 uint32_t count[NSECTORS][NENDPOINTS] = {};
200 };
206};
207
209 static constexpr uint32_t NSECTORS = GPUDataTypes::NSECTORS;
210 const o2::tpc::Digit* tpcDigits[NSECTORS] = {nullptr};
211 size_t nTPCDigits[NSECTORS] = {0};
213};
214
217
218 // TPC
219 static constexpr uint32_t NSECTORS = GPUDataTypes::NSECTORS;
220 const GPUTrackingInOutZS* tpcZS = nullptr;
223 uint32_t nClusterData[NSECTORS] = {0};
225 uint32_t nRawClusters[NSECTORS] = {0};
227 const GPUTPCTrack* sectorTracks[NSECTORS] = {nullptr};
228 uint32_t nSectorTracks[NSECTORS] = {0};
230 uint32_t nSectorClusters[NSECTORS] = {0};
232 uint32_t nMCLabelsTPC = 0;
233 const GPUTPCMCInfo* mcInfosTPC = nullptr;
234 uint32_t nMCInfosTPC = 0;
236 uint32_t nMCInfosTPCCol = 0;
238 uint32_t nMergedTracks = 0;
241 uint32_t nMergedTrackHits = 0;
242 const uint32_t* mergedTrackHitAttachment = nullptr;
243 const uint8_t* mergedTrackHitStates = nullptr;
245 uint32_t nOutputTracksTPCO2 = 0;
246 const uint32_t* outputClusRefsTPCO2 = nullptr;
250
251 // TPC links
252 int32_t* tpcLinkITS = nullptr;
253 int32_t* tpcLinkTRD = nullptr;
254 int32_t* tpcLinkTOF = nullptr;
256 float* globalTrackTimes = nullptr;
257 uint32_t nGlobalTracks = 0;
258
259 // TRD
262 uint32_t nTRDTracklets = 0;
263 const GPUTRDTrackGPU* trdTracks = nullptr;
264 const GPUTRDTrack* trdTracksO2 = nullptr;
265 uint32_t nTRDTracks = 0;
266 const float* trdTriggerTimes = nullptr;
267 const int32_t* trdTrackletIdxFirst = nullptr;
268 const uint8_t* trdTrigRecMask = nullptr;
269 uint32_t nTRDTriggerRecords = 0;
272 const GPUTRDTrack* trdTracksTPCTRD = nullptr;
273 uint32_t nTRDTracksTPCTRD = 0;
274
275 // TOF
277 uint32_t nTOFClusters = 0;
279 uint32_t nITSTPCTOFMatches = 0;
283 uint32_t nTPCTRDTOFMatches = 0;
285 uint32_t nTPCTOFMatches = 0;
286
287 // ITS
291 uint32_t nItsClusters = 0;
293 uint32_t nItsClusterROF = 0;
294 const o2::its::TrackITS* itsTracks = nullptr;
295 const o2::MCCompLabel* itsTrackMC = nullptr;
296 uint32_t nItsTracks = 0;
297 const int32_t* itsTrackClusIdx = nullptr;
299 uint32_t nItsTrackROF = 0;
300
301 // TPC-ITS
303 uint32_t nTracksTPCITSO2 = 0;
304
305 // Common
306 const GPUSettingsTF* settingsTF = nullptr;
307};
308
309} // namespace o2::gpu
310
311#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< 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