Skip to content

Commit 86a1ec8

Browse files
committed
GPUTracking: drop static from the function-scope constants
MSL has no static storage duration inside a function. These are all scalar constexpr values used as compile-time constants, so removing static changes nothing for any backend: none of them is odr-used, and no storage was ever emitted for them.
1 parent 5da2428 commit 86a1ec8

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

GPU/GPUTracking/Merger/GPUTPCGMMerger.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,8 +1480,8 @@ struct GPUTPCGMMerger_CompareClusterIds {
14801480

14811481
GPUd() void GPUTPCGMMerger::CollectMergedTracks(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread)
14821482
{
1483-
static constexpr int32_t kMaxParts = 16;
1484-
static constexpr int32_t kMaxClusters = constants::MERGER_MAX_TRACK_CLUSTERS;
1483+
constexpr int32_t kMaxParts = 16;
1484+
constexpr int32_t kMaxClusters = constants::MERGER_MAX_TRACK_CLUSTERS;
14851485

14861486
GPUTPCGMSectorTrack* trackParts[kMaxParts];
14871487

GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ using namespace o2::tpc;
4949

5050
GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger* GPUrestrict() merger, int32_t iTrk, GPUTPCGMMergedTrackHit* GPUrestrict() clusters, int32_t& GPUrestrict() N, int32_t& GPUrestrict() NTolerated, float& GPUrestrict() Alpha, int32_t attempt, float maxSinPhi, GPUTPCGMMergedTrack& GPUrestrict() track)
5151
{
52-
static constexpr float kDeg2Rad = M_PI / 180.f;
52+
constexpr float kDeg2Rad = M_PI / 180.f;
5353
CADEBUG(static constexpr float kSectAngle = 2 * M_PI / 18.f);
5454

5555
const GPUParam& GPUrestrict() param = merger->Param();
@@ -366,8 +366,8 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger* GPUrestrict() merger, int32_
366366

367367
GPUdni() void GPUTPCGMTrackParam::MoveToReference(GPUTPCGMPropagator& prop, const GPUParam& param, float& Alpha)
368368
{
369-
static constexpr float kDeg2Rad = M_PI / 180.f;
370-
static constexpr float kSectAngle = 2 * M_PI / 18.f;
369+
constexpr float kDeg2Rad = M_PI / 180.f;
370+
constexpr float kSectAngle = 2 * M_PI / 18.f;
371371

372372
if (param.rec.tpc.trackReferenceX <= 500) {
373373
GPUTPCGMTrackParam save = *this;
@@ -575,7 +575,7 @@ GPUd() float GPUTPCGMTrackParam::AttachClusters(const GPUTPCGMMerger* GPUrestric
575575

576576
GPUd() bool GPUTPCGMTrackParam::AttachClustersPropagate(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t sector, int32_t lastRow, int32_t toRow, int32_t iTrack, bool goodLeg, GPUTPCGMPropagator& GPUrestrict() prop, bool inFlyDirection, float maxSinPhi, bool dodEdx)
577577
{
578-
static constexpr float kSectAngle = 2 * M_PI / 18.f;
578+
constexpr float kSectAngle = 2 * M_PI / 18.f;
579579
if (Merger->Param().rec.tpc.disableRefitAttachment & 2) {
580580
return dodEdx;
581581
}
@@ -678,7 +678,7 @@ GPUdi() void GPUTPCGMTrackParam::AttachClustersLooperFollow(const GPUTPCGMMerger
678678
float toX = mX;
679679
bool inFlyDirection = (Merger->MergedTracks()[iTrack].Leg() & 1) ^ up;
680680

681-
static constexpr float kSectAngle = 2 * M_PI / 18.f;
681+
constexpr float kSectAngle = 2 * M_PI / 18.f;
682682
const GPUParam& GPUrestrict() param = Merger->Param();
683683
bool right = (mP[2] < 0) ^ up;
684684
const int32_t sectorSide = sector >= (int32_t)(GPUTPCGeometry::NSECTORS / 2) ? (GPUTPCGeometry::NSECTORS / 2) : 0;
@@ -744,7 +744,7 @@ GPUdi() void GPUTPCGMTrackParam::AttachClustersLooperFollow(const GPUTPCGMMerger
744744

745745
GPUdi() void GPUTPCGMTrackParam::AttachClustersLooper(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t sector, int32_t iRow, int32_t iTrack, bool outwards, GPUTPCGMPropagator& GPUrestrict() prop)
746746
{
747-
static constexpr float kSectAngle = 2 * M_PI / 18.f;
747+
constexpr float kSectAngle = 2 * M_PI / 18.f;
748748
// Note that the coordinate system is rotated by 90 degree swapping X and Y!
749749
float X = mP[2] > 0 ? mP[0] : -mP[0];
750750
float Y = mP[2] > 0 ? -mX : mX;

GPU/GPUTracking/Refit/GPUTrackingRefit.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ GPUd() int32_t GPUTrackingRefit::RefitTrack(T& trkX, bool outward, bool resetCov
398398
trk.NormalizeAlpha(alpha);
399399
prop.SetAlpha(alpha);
400400
} else if constexpr (std::is_same_v<S, TrackParCov>) {
401-
static constexpr float kDeg2Rad = M_PI / 180.f;
402-
static constexpr float kSectAngle = 2 * M_PI / 18.f;
401+
constexpr float kDeg2Rad = M_PI / 180.f;
402+
constexpr float kSectAngle = 2 * M_PI / 18.f;
403403
if (mPparam->rec.tpc.trackReferenceX <= 500) {
404404
if (prop->PropagateToXBxByBz(trk, mPparam->rec.tpc.trackReferenceX)) {
405405
if (CAMath::Abs(trk.getY()) > trk.getX() * CAMath::Tan(kSectAngle / 2.f)) {

GPU/GPUTracking/SectorTracker/GPUTPCNeighboursFinder.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ GPUdii() void GPUTPCNeighboursFinder::Thread<0>(int32_t /*nBlocks*/, int32_t nTh
7373
return;
7474
}
7575

76-
static constexpr uint32_t UNROLL_GLOBAL = GPUCA_PAR_NEIGHBOURS_FINDER_UNROLL_GLOBAL > 1 ? GPUCA_PAR_NEIGHBOURS_FINDER_UNROLL_GLOBAL : 1;
76+
constexpr uint32_t UNROLL_GLOBAL = GPUCA_PAR_NEIGHBOURS_FINDER_UNROLL_GLOBAL > 1 ? GPUCA_PAR_NEIGHBOURS_FINDER_UNROLL_GLOBAL : 1;
7777
static_assert(constants::NEIGHBOURS_MAX_N % UNROLL_GLOBAL == 0);
78-
static constexpr uint32_t MAX_SHARED = GPUCA_PAR_NEIGHBOURS_FINDER_MAX_NNEIGHUP;
79-
static constexpr uint32_t MAX_GLOBAL = (MAX_SHARED < constants::NEIGHBOURS_MAX_N) ? (((constants::NEIGHBOURS_MAX_N - MAX_SHARED - 1) / UNROLL_GLOBAL + 1) * UNROLL_GLOBAL) : 0;
80-
static constexpr uint32_t MAX_TOTAL = MAX_SHARED + MAX_GLOBAL;
78+
constexpr uint32_t MAX_SHARED = GPUCA_PAR_NEIGHBOURS_FINDER_MAX_NNEIGHUP;
79+
constexpr uint32_t MAX_GLOBAL = (MAX_SHARED < constants::NEIGHBOURS_MAX_N) ? (((constants::NEIGHBOURS_MAX_N - MAX_SHARED - 1) / UNROLL_GLOBAL + 1) * UNROLL_GLOBAL) : 0;
80+
constexpr uint32_t MAX_TOTAL = MAX_SHARED + MAX_GLOBAL;
8181

8282
const float chi2Cut = 3.f * 3.f * 4 * (s.mUpDx * s.mUpDx + s.mDnDx * s.mDnDx);
8383
// float chi2Cut = 3.f*3.f*(s.mUpDx*s.mUpDx + s.mDnDx*s.mDnDx ); //SG

0 commit comments

Comments
 (0)