Skip to content

Commit edad527

Browse files
committed
GPU: Fix compilation in Run2 mode
1 parent c5e0c25 commit edad527

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

GPU/GPUTracking/Standalone/Benchmark/standalone.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ int32_t ReadConfiguration(int argc, char** argv)
154154
}
155155
#endif
156156
#ifdef GPUCA_RUN2
157-
#error Why was configStandalone.rec.tpc.mergerReadFromTrackerDirectly = 0 needed?
157+
#warning Why was configStandalone.rec.tpc.mergerReadFromTrackerDirectly = 0 needed?
158158
configStandalone.proc.inKernelParallel = false;
159159
configStandalone.proc.createO2Output = 0;
160160
if (configStandalone.rundEdx == -1) {

GPU/GPUTracking/display/render/GPUDisplayDraw.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,10 +571,11 @@ void GPUDisplay::DrawFinal(int32_t iSector, int32_t /*iCol*/, const GPUTPCGMProp
571571
if (mc.pid < 0) {
572572
break;
573573
}
574+
#ifndef GPUCA_RUN2
574575
if (mc.t0 == -100.f) {
575576
break;
576577
}
577-
578+
#endif
578579
alphaOrg = mParam->Alpha(iSector);
579580
float c = cosf(alphaOrg);
580581
float s = sinf(alphaOrg);

GPU/GPUTracking/qa/GPUQA.cxx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ int32_t GPUQA::initColors()
204204
static constexpr Color_t defaultColorNums[COLORCOUNT] = {kRed, kBlue, kGreen, kMagenta, kOrange, kAzure, kBlack, kYellow, kGray, kTeal, kSpring, kPink};
205205

206206
#define TRACK_EXPECTED_REFERENCE_X_DEFAULT 81
207-
#ifndef GPUCA_RUN2
207+
#ifndef GPUCA_RUN2 // Run 3 implementation
208208
static inline int32_t GPUQA_O2_ConvertFakeLabel(int32_t label) { return label >= 0x7FFFFFFE ? -1 : label; }
209209
inline uint32_t GPUQA::GetNMCCollissions() const { return mMCInfosCol.size(); }
210210
inline uint32_t GPUQA::GetNMCTracks(int32_t iCol) const { return mMCInfosCol[iCol].num; }
@@ -229,7 +229,7 @@ uint32_t GPUQA::GetMCLabelCol(const mcLabel_t& label) const { return !label.isVa
229229
GPUQA::mcLabelI_t GPUQA::GetMCTrackLabel(uint32_t trackId) const { return trackId >= mTrackMCLabels.size() ? MCCompLabel() : mTrackMCLabels[trackId]; }
230230
bool GPUQA::CompareIgnoreFake(const mcLabelI_t& l1, const mcLabelI_t& l2) { return l1.compare(l2) >= 0; }
231231
#define TRACK_EXPECTED_REFERENCE_X 78
232-
#else
232+
#else // Run 2 implementation
233233
inline GPUQA::mcLabelI_t::mcLabelI_t(const GPUQA::mcLabel_t& l) : track(l.fMCID) {}
234234
inline bool GPUQA::mcLabelI_t::operator==(const GPUQA::mcLabel_t& l) { return AbsLabelID(track) == l.fMCID; }
235235
inline uint32_t GPUQA::GetNMCCollissions() const { return 1; }
@@ -247,7 +247,6 @@ inline int32_t GPUQA::GetMCLabelID(uint32_t i, uint32_t j) { return mTracking->m
247247
inline int32_t GPUQA::GetMCLabelID(const mcLabels_t& label, uint32_t j) { return label.fClusterID[j].fMCID; }
248248
inline int32_t GPUQA::GetMCLabelID(const mcLabel_t& label) { return label.fMCID; }
249249
inline uint32_t GPUQA::GetMCLabelCol(uint32_t i, uint32_t j) { return 0; }
250-
251250
inline const auto& GPUQA::GetClusterLabels() { return mTracking->mIOPtrs.mcLabelsTPC; }
252251
inline float GPUQA::GetMCLabelWeight(uint32_t i, uint32_t j) { return mTracking->mIOPtrs.mcLabelsTPC[i].fClusterID[j].fWeight; }
253252
inline float GPUQA::GetMCLabelWeight(const mcLabels_t& label, uint32_t j) { return label.fClusterID[j].fWeight; }
@@ -257,7 +256,7 @@ inline int32_t GPUQA::AbsLabelID(int32_t id) { return id >= 0 ? id : (-id - 2);
257256
inline bool GPUQA::mcPresent() { return !mConfig.noMC && mTracking && GetNMCLabels() && GetNMCTracks(0); }
258257
uint32_t GPUQA::GetMCLabelCol(const mcLabel_t& label) const { return 0; }
259258
GPUQA::mcLabelI_t GPUQA::GetMCTrackLabel(uint32_t trackId) const { return trackId >= mTrackMCLabels.size() ? mcLabelI_t() : mTrackMCLabels[trackId]; }
260-
bool GPUQA::CompareIgnoreFake(const mcLabelI_t& l1, const mcLabelI_t& l2) { return AbsLabelID(l1) == AbsLabelID(l2); }
259+
bool GPUQA::CompareIgnoreFake(const mcLabelI_t& l1, const mcLabelI_t& l2) { return AbsLabelID(l1.track) == AbsLabelID(l2.track); }
261260
#define TRACK_EXPECTED_REFERENCE_X TRACK_EXPECTED_REFERENCE_X_DEFAULT
262261
#endif
263262
template <class T>
@@ -1367,9 +1366,11 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
13671366
if (mc1.pid < 0) {
13681367
continue;
13691368
}
1369+
#ifndef GPUCA_RUN2
13701370
if (mc1.t0 == -100.f) {
13711371
continue;
13721372
}
1373+
#endif
13731374
if (mConfig.filterCharge && mc1.charge * mConfig.filterCharge < 0) {
13741375
continue;
13751376
}
@@ -1439,7 +1440,12 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
14391440
if (!mParam->continuousMaxTimeBin) {
14401441
return param.GetZ() - mc1.z;
14411442
}
1442-
float shift = side == 2 ? 0 : mTracking->GetTPCTransform()->convDeltaTimeToDeltaZinTimeFrame(side * GPUChainTracking::NSECTORS / 2, param.GetTOffset() - mc1.t0);
1443+
float shift = 0;
1444+
#ifndef GPUCA_RUN2
1445+
if (side != 2) {
1446+
shift = mTracking->GetTPCTransform()->convDeltaTimeToDeltaZinTimeFrame(side * GPUChainTracking::NSECTORS / 2, param.GetTOffset() - mc1.t0);
1447+
}
1448+
#endif
14431449
return param.GetZ() + shift - mc1.z;
14441450
};
14451451

@@ -1784,12 +1790,14 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
17841790
mNCl[1]->Fill(nClCorrected);
17851791
}
17861792
mT0[0]->Fill(track.GetParam().GetTOffset());
1793+
#ifndef GPUCA_RUN2
17871794
if (mTrackMCLabels.size() && !mTrackMCLabels[i].isFake() && !track.MergedLooper() && !track.CCE()) {
17881795
const auto& info = GetMCTrack(mTrackMCLabels[i]);
17891796
if (info.t0 != -100.f) {
17901797
mT0[1]->Fill(track.GetParam().GetTOffset() - info.t0);
17911798
}
17921799
}
1800+
#endif
17931801
}
17941802
if (mClNative && mTracking && mTracking->GetTPCTransform()) {
17951803
for (uint32_t i = 0; i < GPUChainTracking::NSECTORS; i++) {

GPU/GPUTracking/qa/GPUQA.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,18 @@ class GPUQA
176176
T* GetHist(T*& ee, std::vector<std::unique_ptr<TFile>>& tin, int32_t k, int32_t nNewInput);
177177

178178
using mcInfo_t = GPUTPCMCInfo;
179-
#ifndef GPUCA_RUN2
179+
#ifndef GPUCA_RUN2 // Run 3 implementation
180180
mcLabels_t GetMCLabel(uint32_t i);
181181
mcLabel_t GetMCLabel(uint32_t i, uint32_t j);
182-
#else
182+
#else // Run 2 implementation
183183
struct mcLabelI_t {
184184
int32_t getTrackID() const { return AbsLabelID(track); }
185185
int32_t getEventID() const { return 0; }
186186
int32_t getSourceID() const { return 0; }
187187
int64_t getTrackEventSourceID() const { return getTrackID(); }
188188
bool isFake() const { return track < 0; }
189189
bool isValid() const { return track != MC_LABEL_INVALID; }
190+
bool isNoise() const { return false; }
190191
void invalidate() { track = MC_LABEL_INVALID; }
191192
void setFakeFlag(bool v = true) { track = v ? FakeLabelID(track) : AbsLabelID(track); }
192193
void setNoise() { track = MC_LABEL_INVALID; }

0 commit comments

Comments
 (0)