Skip to content

Commit 373dc30

Browse files
committed
GPU: Use [[maybe_unused]] to silence compiler warnings
1 parent 3467dde commit 373dc30

File tree

8 files changed

+12
-29
lines changed

8 files changed

+12
-29
lines changed

GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
592592
return ForwardTPCDigits();
593593
}
594594
#ifdef GPUCA_TPC_GEOMETRY_O2
595-
int32_t tpcTimeBinCut = mUpdateNewCalibObjects && mNewCalibValues->newTPCTimeBinCut ? mNewCalibValues->tpcTimeBinCut : param().tpcCutTimeBin;
595+
[[maybe_unused]] int32_t tpcTimeBinCut = mUpdateNewCalibObjects && mNewCalibValues->newTPCTimeBinCut ? mNewCalibValues->tpcTimeBinCut : param().tpcCutTimeBin;
596596
mRec->PushNonPersistentMemory(qStr2Tag("TPCCLUST"));
597597
const auto& threadContext = GetThreadContext();
598598
const bool doGPU = GetRecoStepsGPU() & RecoStep::TPCClusterFinding;
@@ -861,7 +861,6 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput)
861861
int32_t firstHBF = (mIOPtrs.settingsTF && mIOPtrs.settingsTF->hasTfStartOrbit) ? mIOPtrs.settingsTF->tfStartOrbit : ((mIOPtrs.tpcZS->sector[iSector].count[0] && mIOPtrs.tpcZS->sector[iSector].nZSPtr[0][0]) ? o2::raw::RDHUtils::getHeartBeatOrbit(*(const o2::header::RAWDataHeader*)mIOPtrs.tpcZS->sector[iSector].zsPtr[0][0]) : 0);
862862
uint32_t nBlocks = doGPU ? clusterer.mPmemory->counters.nPagesSubsector : GPUTrackingInOutZS::NENDPOINTS;
863863

864-
(void)tpcTimeBinCut; // TODO: To be used in decoding kernels
865864
switch (mCFContext->zsVersion) {
866865
default:
867866
GPUFatal("Data with invalid TPC ZS mode (%d) received", mCFContext->zsVersion);

GPU/GPUTracking/Global/GPUChainTrackingDebugAndProfiling.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ int32_t GPUChainTracking::DoProfile()
7070
fwrite(&bmpFH, 1, sizeof(bmpFH), fp2);
7171
fwrite(&bmpIH, 1, sizeof(bmpIH), fp2);
7272

73-
int32_t nEmptySync = 0;
73+
[[maybe_unused]] int32_t nEmptySync = 0;
7474
for (uint32_t i = 0; i < bmpheight * ConstructorBlockCount() * ConstructorThreadCount(); i += ConstructorBlockCount() * ConstructorThreadCount()) {
7575
int32_t fEmpty = 1;
7676
for (uint32_t j = 0; j < ConstructorBlockCount() * ConstructorThreadCount(); j++) {
@@ -103,7 +103,6 @@ int32_t GPUChainTracking::DoProfile()
103103
} else {
104104
nEmptySync = 0;
105105
}
106-
(void)nEmptySync;
107106
// if (nEmptySync == GPUCA_SCHED_ROW_STEP + 2) break;
108107
}
109108

GPU/GPUTracking/Global/GPUChainTrackingRefit.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ int32_t GPUChainTracking::RunRefit()
2828
GPUTrackingRefitProcessor& Refit = processors()->trackingRefit;
2929
GPUTrackingRefitProcessor& RefitShadow = doGPU ? processorsShadow()->trackingRefit : Refit;
3030

31-
const auto& threadContext = GetThreadContext();
32-
(void)threadContext;
31+
[[maybe_unused]] const auto& threadContext = GetThreadContext();
3332
SetupGPUProcessor(&Refit, false);
3433
RefitShadow.SetPtrsFromGPUConstantMem(processorsShadow(), doGPU ? &processorsDevice()->param : nullptr);
3534
RefitShadow.SetPropagator(doGPU ? processorsShadow()->calibObjects.o2Propagator : GetO2Propagator());

GPU/GPUTracking/SectorTracker/GPUTPCTrackletConstructor.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ GPUdic(2, 1) void GPUTPCTrackletConstructor::UpdateTracklet(int32_t /*nBlocks*/,
274274
}
275275
CADEBUG(printf("%14s: SEA PROP ROW %3d X %8.3f -", "", iRow, tParam.X()); for (int32_t i = 0; i < 5; i++) { printf(" %8.3f", tParam.Par()[i]); } printf(" -"); for (int32_t i = 0; i < 15; i++) { printf(" %8.3f", tParam.Cov()[i]); } printf("\n"));
276276

277-
bool found = false;
277+
[[maybe_unused]] bool found = false;
278278
float yUncorrected = tParam.GetY(), zUncorrected = tParam.GetZ();
279279
do {
280280
if (row.NHits() < 1) {
@@ -373,7 +373,6 @@ GPUdic(2, 1) void GPUTPCTrackletConstructor::UpdateTracklet(int32_t /*nBlocks*/,
373373
r.mFirstRow = iRow;
374374
}
375375
} while (false);
376-
(void)found;
377376
if (!found && tracker.GetConstantMem()->calibObjects.dEdxCalibContainer) {
378377
uint32_t pad = CAMath::Float2UIntRn(GPUTPCGeometry::LinearY2Pad(tracker.ISector(), iRow, yUncorrected));
379378
if (pad < GPUTPCGeometry::NPads(iRow) && tracker.GetConstantMem()->calibObjects.dEdxCalibContainer->isDead(tracker.ISector(), iRow, pad)) {

GPU/GPUTracking/display/render/GPUDisplayDraw.cxx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ GPUDisplay::vboList GPUDisplay::DrawClusters(int32_t iSector, int32_t select, ui
129129
if (mOverlayTFClusters.size() > 0 || iCol == 0 || mNCollissions) {
130130
const int32_t firstCluster = (mOverlayTFClusters.size() > 1 && iCol > 0) ? mOverlayTFClusters[iCol - 1][iSector] : 0;
131131
const int32_t lastCluster = (mOverlayTFClusters.size() > 1 && iCol + 1 < mOverlayTFClusters.size()) ? mOverlayTFClusters[iCol][iSector] : (mParam->par.earlyTpcTransform ? mIOPtrs->nClusterData[iSector] : mIOPtrs->clustersNative ? mIOPtrs->clustersNative->nClustersSector[iSector] : 0);
132-
const bool checkClusterCollision = mQA && mNCollissions && mOverlayTFClusters.size() == 0 && mIOPtrs->clustersNative && mIOPtrs->clustersNative->clustersMCTruth;
132+
[[maybe_unused]] const bool checkClusterCollision = mQA && mNCollissions && mOverlayTFClusters.size() == 0 && mIOPtrs->clustersNative && mIOPtrs->clustersNative->clustersMCTruth;
133133
for (int32_t cidInSector = firstCluster; cidInSector < lastCluster; cidInSector++) {
134134
const int32_t cid = GET_CID(iSector, cidInSector);
135135
#ifdef GPUCA_TPC_GEOMETRY_O2
@@ -139,8 +139,6 @@ GPUDisplay::vboList GPUDisplay::DrawClusters(int32_t iSector, int32_t select, ui
139139
continue;
140140
}
141141
}
142-
#else
143-
(void)checkClusterCollision;
144142
#endif
145143
if (mCfgH.hideUnmatchedClusters && mQA && mQA->SuppressHit(cid)) {
146144
continue;

GPU/GPUTracking/qa/GPUQA.cxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ using namespace o2::gpu;
9999
bool unattached = attach == 0; \
100100
float qpt = 0; \
101101
bool lowPt = false; \
102-
bool mev200 = false; \
102+
[[maybe_unused]] bool mev200 = false; \
103103
bool mergedLooper = false; \
104104
int32_t id = attach & gputpcgmmergertypes::attachTrackMask; \
105105
if (!unattached) { \
@@ -126,7 +126,6 @@ using namespace o2::gpu;
126126

127127
#define CHECK_CLUSTER_STATE_NOCOUNT() \
128128
CHECK_CLUSTER_STATE_INIT() \
129-
(void)mev200; /* silence unused variable warning*/ \
130129
if (!lowPt && !mergedLooper) { \
131130
GPUTPCClusterRejection::GetProtectionStatus<false>(attach, physics, protect); \
132131
}
@@ -1953,8 +1952,7 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
19531952

19541953
std::vector<Color_t> colorNums(COLORCOUNT);
19551954
if (!qcout) {
1956-
static int32_t initColorsInitialized = initColors();
1957-
(void)initColorsInitialized;
1955+
[[maybe_unused]] static int32_t initColorsInitialized = initColors();
19581956
}
19591957
for (int32_t i = 0; i < COLORCOUNT; i++) {
19601958
colorNums[i] = qcout ? defaultColorNums[i] : mColors[i]->GetNumber();

GPU/GPUTracking/qa/GPUQAHelper.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ class GPUTPCTrkLbl
105105
*labelWeight = bestLabel.fWeight;
106106
*totalWeight = mTotalWeight;
107107
*maxCount = bestLabelCount;
108-
} else {
109-
(void)labelWeight;
110-
(void)totalWeight;
111-
(void)maxCount;
112108
}
113109
U retVal = bestLabel;
114110
if (bestLabelCount < (1.f - mTrackMCMaxFake) * mNCl) {

GPU/GPUTracking/utils/qconfig.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,9 @@ enum qConfigRetVal { qcrOK = 0,
9797

9898
#define BeginSubConfig(name, instance, parent, preoptname, preoptnameshort, descr, ...) \
9999
{ \
100-
constexpr const char* preopt = preoptname; \
101-
(void)preopt; \
102-
constexpr const char preoptshort = preoptnameshort; \
103-
(void)preoptshort; \
104-
name& tmp = parent.instance; \
105-
(void)tmp; \
100+
[[maybe_unused]] constexpr const char* preopt = preoptname; \
101+
[[maybe_unused]] constexpr const char preoptshort = preoptnameshort; \
102+
[[maybe_unused]] name& tmp = parent.instance; \
106103
bool tmpfound = true; \
107104
if (found) { \
108105
}
@@ -174,10 +171,8 @@ enum qConfigRetVal { qcrOK = 0,
174171
const char* qon_mxcat(qConfig_subconfig_, name) = preoptnameshort == 0 ? (qon_mxstr(name) ": --" preoptname "\n\t\t" descr) : (qon_mxstr(name) ": -" qon_mxstr('a') " (--" preoptname ")\n\t\t" descr); \
175172
(void)qon_mxcat(qConfig_subconfig_, name); \
176173
if (subConfig == nullptr || strcmp(subConfig, followSub == 2 ? qon_mxstr(name) : preoptname) == 0) { \
177-
constexpr const char* preopt = preoptname; \
178-
(void)preopt; \
179-
constexpr const char preoptshort = preoptnameshort; \
180-
(void)preoptshort; \
174+
[[maybe_unused]] constexpr const char* preopt = preoptname; \
175+
[[maybe_unused]] constexpr const char preoptshort = preoptnameshort; \
181176
char argBuffer[2] = {preoptnameshort, 0}; \
182177
printf("\n %s: (--%s%s%s)\n", descr, preoptname, preoptnameshort == 0 ? "" : " or -", argBuffer);
183178
#define BeginHiddenConfig(name, instance) {

0 commit comments

Comments
 (0)