Skip to content

Commit 4415c88

Browse files
committed
GPU: Unify some constants
1 parent 51a5651 commit 4415c88

24 files changed

+62
-56
lines changed

GPU/GPUTracking/Base/GPUParam.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "GPUDef.h"
2121
#include "GPUSettings.h"
2222
#include "GPUTPCGMPolynomialField.h"
23-
#include "GPUTPCGeometry.h"
23+
#include "DataFormatsTPC/Constants.h"
2424

2525
#if !defined(GPUCA_GPUCODE)
2626
namespace o2::base
@@ -66,7 +66,7 @@ struct GPUParam_t {
6666
uint32_t occupancyTotal; // Total occupancy in the TPC (nCl / nHbf)
6767
uint32_t occupancyMapSize; // Size of occupancy map
6868

69-
GPUParamSector SectorParam[GPUTPCGeometry::NSECTORS];
69+
GPUParamSector SectorParam[o2::tpc::constants::MAXSECTOR];
7070

7171
protected:
7272
#ifndef GPUCA_RUN2
@@ -91,11 +91,11 @@ struct GPUParam : public internal::GPUParam_t<GPUSettingsRec, GPUSettingsParam>
9191
GPUd() constexpr uint32_t tpcMinHitsB5(float qPtB5) const { return CAMath::Abs(qPtB5) > 10 ? 10 : (CAMath::Abs(qPtB5) > 5 ? 15 : 29); } // Minimum hits should depend on Pt, low Pt tracks can have few hits. 29 Hits default, 15 for < 200 mev, 10 for < 100 mev
9292
GPUd() constexpr float Alpha(int32_t iSector) const
9393
{
94-
if (iSector >= (int32_t)GPUTPCGeometry::NSECTORS / 2) {
95-
iSector -= GPUTPCGeometry::NSECTORS / 2;
94+
if (iSector >= (int32_t)o2::tpc::constants::MAXSECTOR / 2) {
95+
iSector -= o2::tpc::constants::MAXSECTOR / 2;
9696
}
97-
if (iSector >= (int32_t)GPUTPCGeometry::NSECTORS / 4) {
98-
iSector -= GPUTPCGeometry::NSECTORS / 2;
97+
if (iSector >= (int32_t)o2::tpc::constants::MAXSECTOR / 4) {
98+
iSector -= o2::tpc::constants::MAXSECTOR / 2;
9999
}
100100
return 0.174533f + dAlpha * iSector;
101101
}

GPU/GPUTracking/Base/GPUReconstructionConvert.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <functional>
2020
#include <vector>
2121
#include "GPUDef.h"
22+
#include "DataFormatsTPC/Constants.h"
2223

2324
namespace o2
2425
{
@@ -48,7 +49,7 @@ struct GPUTrackingInOutZS;
4849
class GPUReconstructionConvert
4950
{
5051
public:
51-
constexpr static uint32_t NSECTORS = GPUTPCGeometry::NSECTORS;
52+
constexpr static uint32_t NSECTORS = o2::tpc::constants::MAXSECTOR;
5253
static void ConvertNativeToClusterData(o2::tpc::ClusterNativeAccess* native, std::unique_ptr<GPUTPCClusterData[]>* clusters, uint32_t* nClusters, const TPCFastTransformPOD* transform, int32_t continuousMaxTimeBin = 0);
5354
static void ConvertRun2RawToNative(o2::tpc::ClusterNativeAccess& native, std::unique_ptr<o2::tpc::ClusterNative[]>& nativeBuffer, const AliHLTTPCRawCluster** rawClusters, uint32_t* nRawClusters);
5455
template <class S>

GPU/GPUTracking/DataCompression/GPUTPCCompression.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "GPUCommonMath.h"
2121
#include "GPUParam.h"
2222
#include "DataFormatsTPC/CompressedClusters.h"
23+
#include "GPUTPCGeometry.h"
2324

2425
namespace o2::gpu
2526
{

GPU/GPUTracking/DataCompression/GPUTPCCompressionTrackModel.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
// #define GPUCA_COMPRESSION_TRACK_MODEL_SECTORTRACKER
2121

2222
#include "GPUDef.h"
23+
#include "DataFormatsTPC/Constants.h"
2324

2425
#ifdef GPUCA_COMPRESSION_TRACK_MODEL_MERGER
2526
#include "GPUTPCGMPropagator.h"
@@ -103,12 +104,12 @@ class GPUTPCCompressionTrackModel
103104
GPUd() float LinearPad2Y(uint32_t sector, float pad, float padWidth, uint8_t npads) const
104105
{
105106
const float u = (pad - 0.5f * npads) * padWidth;
106-
return (sector >= GPUTPCGeometry::NSECTORS / 2) ? -u : u;
107+
return (sector >= o2::tpc::constants::MAXSECTOR / 2) ? -u : u;
107108
}
108109

109110
GPUd() float LinearY2Pad(uint32_t sector, float y, float padWidth, uint8_t npads) const
110111
{
111-
const float u = (sector >= GPUTPCGeometry::NSECTORS / 2) ? -y : y;
112+
const float u = (sector >= o2::tpc::constants::MAXSECTOR / 2) ? -y : y;
112113
return u / padWidth + 0.5f * npads;
113114
}
114115

GPU/GPUTracking/DataCompression/GPUTPCDecompression.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "GPUParam.h"
2222
#include "GPUO2DataTypes.h"
2323
#include "DataFormatsTPC/CompressedClusters.h"
24+
#include "GPUTPCGeometry.h"
2425

2526
namespace o2::gpu
2627
{

GPU/GPUTracking/DataTypes/GPUDataTypesIO.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <cstddef>
2424
#endif
2525
#include "GPUTRDDef.h"
26+
#include "DataFormatsTPC/Constants.h"
2627

2728
struct AliHLTTPCClusterMCLabel;
2829
struct AliHLTTPCRawCluster;
@@ -109,11 +110,6 @@ struct GPUTRDTrackletLabels;
109110
struct GPUTPCDigitsMCInput;
110111
struct GPUSettingsTF;
111112

112-
namespace gpudatatypes
113-
{
114-
static constexpr uint32_t NSECTORS = 36;
115-
} // namespace gpudatatypes
116-
117113
template <class T>
118114
struct DefaultPtr {
119115
typedef T type;
@@ -141,7 +137,7 @@ typedef GPUCalibObjectsTemplate<DefaultPtr> GPUCalibObjects; // NOTE: These 2 mu
141137
typedef GPUCalibObjectsTemplate<ConstPtr> GPUCalibObjectsConst;
142138

143139
struct GPUTrackingInOutZS {
144-
static constexpr uint32_t NSECTORS = gpudatatypes::NSECTORS;
140+
static constexpr uint32_t NSECTORS = o2::tpc::constants::MAXSECTOR;
145141
static constexpr uint32_t NENDPOINTS = 20;
146142
struct GPUTrackingInOutZSSector {
147143
const void* const* zsPtr[NENDPOINTS];
@@ -159,7 +155,7 @@ struct GPUTrackingInOutZS {
159155
};
160156

161157
struct GPUTrackingInOutDigits {
162-
static constexpr uint32_t NSECTORS = gpudatatypes::NSECTORS;
158+
static constexpr uint32_t NSECTORS = o2::tpc::constants::MAXSECTOR;
163159
const o2::tpc::Digit* tpcDigits[NSECTORS] = {nullptr};
164160
size_t nTPCDigits[NSECTORS] = {0};
165161
const GPUTPCDigitsMCInput* tpcDigitsMC = nullptr;
@@ -169,7 +165,7 @@ struct GPUTrackingInOutPointers {
169165
GPUTrackingInOutPointers() = default;
170166

171167
// TPC
172-
static constexpr uint32_t NSECTORS = gpudatatypes::NSECTORS;
168+
static constexpr uint32_t NSECTORS = o2::tpc::constants::MAXSECTOR;
173169
const GPUTrackingInOutZS* tpcZS = nullptr;
174170
const GPUTrackingInOutDigits* tpcPackedDigits = nullptr;
175171
const GPUTPCClusterData* clusterData[NSECTORS] = {nullptr};

GPU/GPUTracking/DataTypes/GPUMemorySizeScalers.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/// \author David Rohr
1414

1515
#include "GPUMemorySizeScalers.h"
16+
#include "GPUTPCGeometry.h"
1617
#include "GPULogging.h"
1718

1819
#include <random>

GPU/GPUTracking/DataTypes/GPUTPCClusterOccupancyMap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
#define GPUTPCCLUSTEROCCUPANCYMAP_H
1717

1818
#include "GPUCommonDef.h"
19-
#include "GPUTPCGeometry.h"
19+
#include "DataFormatsTPC/Constants.h"
2020

2121
namespace o2::gpu
2222
{
2323
struct GPUParam;
2424
struct GPUTPCClusterOccupancyMapBin {
25-
uint16_t bin[GPUTPCGeometry::NSECTORS][GPUTPCGeometry::NROWS];
25+
uint16_t bin[o2::tpc::constants::MAXSECTOR][o2::tpc::constants::MAXGLOBALPADROW];
2626

2727
GPUd() static uint32_t getNBins(const GPUParam& param);
2828
GPUd() static uint32_t getTotalSize(const GPUParam& param);

GPU/GPUTracking/DataTypes/TPCPadBitMap.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "clusterFinderDefs.h"
1919
#include "GPUCommonMath.h"
20+
#include "DataFormatsTPC/Constants.h"
2021

2122
namespace o2::tpc
2223
{
@@ -101,8 +102,8 @@ struct TPCPadBitMap {
101102
T mDeadChannelMap[NWORDS];
102103
};
103104

104-
uint16_t mPadOffsetPerRow[GPUTPCGeometry::NROWS];
105-
SectorBitMap mBitMap[GPUTPCGeometry::NSECTORS];
105+
uint16_t mPadOffsetPerRow[o2::tpc::constants::MAXGLOBALPADROW];
106+
SectorBitMap mBitMap[o2::tpc::constants::MAXSECTOR];
106107
};
107108

108109
} // namespace o2::gpu

GPU/GPUTracking/DataTypes/TPCPadGainCalib.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "clusterFinderDefs.h"
1919
#include "GPUCommonMath.h"
20+
#include "DataFormatsTPC/Constants.h"
2021

2122
namespace o2::tpc
2223
{
@@ -81,14 +82,14 @@ struct TPCPadGainCalib {
8182

8283
GPUdi() void setMinCorrectionFactor(const float minCorrectionFactor)
8384
{
84-
for (uint32_t sector = 0; sector < GPUTPCGeometry::NSECTORS; sector++) {
85+
for (uint32_t sector = 0; sector < o2::tpc::constants::MAXSECTOR; sector++) {
8586
mGainCorrection[sector].mMinCorrectionFactor = minCorrectionFactor;
8687
}
8788
}
8889

8990
GPUdi() void setMaxCorrectionFactor(const float maxCorrectionFactor)
9091
{
91-
for (uint32_t sector = 0; sector < GPUTPCGeometry::NSECTORS; sector++) {
92+
for (uint32_t sector = 0; sector < o2::tpc::constants::MAXSECTOR; sector++) {
9293
mGainCorrection[sector].mMaxCorrectionFactor = maxCorrectionFactor;
9394
}
9495
}
@@ -153,8 +154,8 @@ struct TPCPadGainCalib {
153154
}
154155
};
155156

156-
uint16_t mPadOffsetPerRow[GPUTPCGeometry::NROWS];
157-
SectorPadGainCorrection<uint16_t> mGainCorrection[GPUTPCGeometry::NSECTORS];
157+
uint16_t mPadOffsetPerRow[o2::tpc::constants::MAXGLOBALPADROW];
158+
SectorPadGainCorrection<uint16_t> mGainCorrection[o2::tpc::constants::MAXSECTOR];
158159
};
159160

160161
} // namespace o2::gpu

0 commit comments

Comments
 (0)