Skip to content

Commit b7fb1cd

Browse files
committed
GPU TPC: Do looper cluster attachment always in separate kernel
1 parent 4b13748 commit b7fb1cd

File tree

8 files changed

+12
-71
lines changed

8 files changed

+12
-71
lines changed

GPU/GPUTracking/Base/GPUReconstruction.cxx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,6 @@ int32_t GPUReconstruction::InitPhaseBeforeDevice()
271271
#endif
272272
mProcessingSettings->overrideClusterizerFragmentLen = TPC_MAX_FRAGMENT_LEN_GPU;
273273
param().rec.tpc.nWaysOuter = true;
274-
if (param().rec.tpc.looperInterpolationInExtraPass == -1) {
275-
param().rec.tpc.looperInterpolationInExtraPass = 0;
276-
}
277274
if (GetProcessingSettings().createO2Output > 1) {
278275
mProcessingSettings->createO2Output = 1;
279276
}

GPU/GPUTracking/Definitions/GPUDefParametersDefaults.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
#define GPUCA_PAR_TRACKLET_SELECTOR_HITS_REG_SIZE 20
8181
#define GPUCA_PAR_ALTERNATE_BORDER_SORT 1
8282
#define GPUCA_PAR_SORT_BEFORE_FIT 1
83-
#define GPUCA_PAR_MERGER_SPLIT_LOOP_INTERPOLATION 1
8483
#define GPUCA_PAR_NO_ATOMIC_PRECHECK 1
8584
#define GPUCA_PAR_DEDX_STORAGE_TYPE uint16_t
8685
#define GPUCA_PAR_MERGER_INTERPOLATION_ERROR_TYPE half
@@ -143,7 +142,6 @@
143142
#define GPUCA_PAR_TRACKLET_SELECTOR_HITS_REG_SIZE 20
144143
#define GPUCA_PAR_ALTERNATE_BORDER_SORT 1
145144
#define GPUCA_PAR_SORT_BEFORE_FIT 1
146-
#define GPUCA_PAR_MERGER_SPLIT_LOOP_INTERPOLATION 1
147145
#define GPUCA_PAR_NO_ATOMIC_PRECHECK 1
148146
#define GPUCA_PAR_DEDX_STORAGE_TYPE uint16_t
149147
#define GPUCA_PAR_MERGER_INTERPOLATION_ERROR_TYPE half
@@ -206,7 +204,6 @@
206204
#define GPUCA_PAR_TRACKLET_SELECTOR_HITS_REG_SIZE 20
207205
#define GPUCA_PAR_ALTERNATE_BORDER_SORT 1
208206
#define GPUCA_PAR_SORT_BEFORE_FIT 1
209-
#define GPUCA_PAR_MERGER_SPLIT_LOOP_INTERPOLATION 1
210207
#define GPUCA_PAR_NO_ATOMIC_PRECHECK 1
211208
#define GPUCA_PAR_DEDX_STORAGE_TYPE uint16_t
212209
#define GPUCA_PAR_MERGER_INTERPOLATION_ERROR_TYPE half
@@ -261,7 +258,6 @@
261258
#define GPUCA_PAR_TRACKLET_SELECTOR_HITS_REG_SIZE 20
262259
#define GPUCA_PAR_ALTERNATE_BORDER_SORT 1
263260
#define GPUCA_PAR_SORT_BEFORE_FIT 1
264-
#define GPUCA_PAR_MERGER_SPLIT_LOOP_INTERPOLATION 1
265261
#define GPUCA_PAR_NO_ATOMIC_PRECHECK 1
266262
#define GPUCA_PAR_COMP_GATHER_KERNEL 4
267263
#define GPUCA_PAR_COMP_GATHER_MODE 3
@@ -529,9 +525,6 @@
529525
#ifndef GPUCA_PAR_SORT_BEFORE_FIT
530526
#define GPUCA_PAR_SORT_BEFORE_FIT 0
531527
#endif
532-
#ifndef GPUCA_PAR_MERGER_SPLIT_LOOP_INTERPOLATION
533-
#define GPUCA_PAR_MERGER_SPLIT_LOOP_INTERPOLATION 0
534-
#endif
535528
#ifndef GPUCA_PAR_COMP_GATHER_KERNEL
536529
#define GPUCA_PAR_COMP_GATHER_KERNEL 0
537530
#endif
@@ -566,9 +559,6 @@
566559
#ifndef GPUCA_PAR_SORT_BEFORE_FIT
567560
#define GPUCA_PAR_SORT_BEFORE_FIT 0
568561
#endif
569-
#ifndef GPUCA_PAR_MERGER_SPLIT_LOOP_INTERPOLATION
570-
#define GPUCA_PAR_MERGER_SPLIT_LOOP_INTERPOLATION 0
571-
#endif
572562
#ifndef GPUCA_PAR_COMP_GATHER_KERNEL
573563
#define GPUCA_PAR_COMP_GATHER_KERNEL 0
574564
#endif

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation inst
154154
AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position")
155155
AddOptionRTC(mergeCE, uint8_t, 1, "", 0, "Merge tracks accross the central electrode")
156156
AddOptionRTC(retryRefit, int8_t, 1, "", 0, "Retry refit with seeding errors and without cluster rejection when fit fails (=2 means retry in same kernel, =1 for separate kernel")
157-
AddOptionRTC(looperInterpolationInExtraPass, int8_t, -1, "", 0, "Perform looper interpolation in an extra pass")
158157
AddOptionRTC(dropSecondaryLegsInOutput, int8_t, 1, "", 0, "Do not store secondary legs of looping track in TrackTPC")
159158
AddOptionRTC(enablePID, int8_t, 1, "", 0, "Enable PID response")
160159
AddOptionRTC(PID_useNsigma, int8_t, 1, "", 0, "Use nSigma instead of absolute distance in PID response")

GPU/GPUTracking/Global/GPUChainTrackingMerger.cxx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,7 @@ int32_t GPUChainTracking::RunTPCTrackingMerger(bool synchronizeOutput)
224224
if (param().rec.tpc.retryRefit == 1) {
225225
runKernel<GPUTPCGMMergerTrackFit>(GetGridAuto(0), -1);
226226
}
227-
if (param().rec.tpc.looperInterpolationInExtraPass == -1 ? mRec->getGPUParameters(doGPU).par_MERGER_SPLIT_LOOP_INTERPOLATION : param().rec.tpc.looperInterpolationInExtraPass) {
228-
runKernel<GPUTPCGMMergerFollowLoopers>(GetGridAuto(0));
229-
}
227+
runKernel<GPUTPCGMMergerFollowLoopers>(GetGridAuto(0));
230228

231229
DoDebugAndDump(RecoStep::TPCMerging, GPUChainTrackingDebugFlags::TPCMergingRefit, Merger, &GPUTPCGMMerger::DumpRefit, *mDebugFile);
232230
runKernel<GPUTPCGMMergerFinalize, 0>(GetGridAuto(0, deviceType));

GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx

Lines changed: 9 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -189,32 +189,12 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger* GPUrestrict() merger, int32_
189189
CADEBUG(printf("\tLeg %3d Sector %2d %4sTrack Alpha %8.3f %s, X %8.3f - Y %8.3f, Z %8.3f - QPt %7.2f (%7.2f), SP %5.2f (%5.2f) %28s --- Cov sY %8.3f sZ %8.3f sSP %8.3f sPt %8.3f - YPt %8.3f\n", (int32_t)cluster.leg, (int32_t)cluster.sector, "", prop.GetAlpha(), (CAMath::Abs(prop.GetAlpha() - clAlpha) < 0.01 ? " " : " R!"), mX, mP[0], mP[1], mP[4], prop.GetQPt0(), mP[2], prop.GetSinPhi0(), "", sqrtf(mC[0]), sqrtf(mC[2]), sqrtf(mC[5]), sqrtf(mC[14]), mC[10]));
190190
// clang-format on
191191
if (allowModification && changeDirection && !noFollowCircle && !noFollowCircle2) {
192-
bool tryFollow = lastRow != 255;
193-
if (tryFollow) {
194-
const GPUTPCGMTrackParam backup = *this;
195-
const float backupAlpha = prop.GetAlpha();
196-
if (FollowCircle<0>(merger, prop, lastSector, lastRow, iTrk, clAlpha, xx, yy, cluster.sector, cluster.row, inFlyDirection)) {
197-
CADEBUG(printf("Error during follow circle, resetting track!\n"));
198-
*this = backup;
199-
prop.SetTrack(this, backupAlpha);
192+
if (lastRow != 255) {
193+
if (!(merger->Param().rec.tpc.disableRefitAttachment & 4)) {
194+
StoreAttachMirror(merger, lastSector, lastRow, iTrk, clAlpha, yy, xx, cluster.sector, cluster.row, inFlyDirection, prop.GetAlpha());
200195
noFollowCircle = true;
201-
tryFollow = false;
202196
}
203197
}
204-
if (tryFollow) {
205-
MirrorTo(prop, yy, zz, inFlyDirection, param, cluster.row, clusterState, false, cluster.sector);
206-
lastUpdateX = mX;
207-
lastLeg = cluster.leg;
208-
lastSector = cluster.sector;
209-
lastRow = 255;
210-
N++;
211-
resetT0 = initResetT0();
212-
// clang-format off
213-
CADEBUG(printf("\n"));
214-
CADEBUG(printf("\t%21sMirror Alpha %8.3f , X %8.3f - Y %8.3f, Z %8.3f - QPt %7.2f (%7.2f), SP %5.2f (%5.2f) %28s --- Cov sY %8.3f sZ %8.3f sSP %8.3f sPt %8.3f - YPt %8.3f\n", "", prop.GetAlpha(), mX, mP[0], mP[1], mP[4], prop.GetQPt0(), mP[2], prop.GetSinPhi0(), "", sqrtf(mC[0]), sqrtf(mC[2]), sqrtf(mC[5]), sqrtf(mC[14]), mC[10]));
215-
// clang-format on
216-
continue;
217-
}
218198
} else if (allowModification && lastRow != 255 && CAMath::Abs(cluster.row - lastRow) > 1) {
219199
if GPUCA_RTC_CONSTEXPR (GPUCA_GET_CONSTEXPR(param.par, dodEdx)) {
220200
bool dodEdx = param.dodEdxEnabled && param.rec.tpc.adddEdxSubThresholdClusters && iWay == nWays - 1 && CAMath::Abs(cluster.row - lastRow) == 2 && cluster.leg == clusters[maxN - 1].leg;
@@ -269,8 +249,8 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger* GPUrestrict() merger, int32_
269249
CADEBUG(printf(" -- MirroredY: %f --> %f", mP[0], mirrordY));
270250
if (CAMath::Abs(yy - mP[0]) > CAMath::Abs(yy - mirrordY)) {
271251
CADEBUG(printf(" - Mirroring!!!"));
272-
if (allowModification) {
273-
AttachClustersMirror<0>(merger, cluster.sector, cluster.row, iTrk, yy, prop); // TODO: Never true, will always call FollowCircle above, really???
252+
if (allowModification && !(merger->Param().rec.tpc.disableRefitAttachment & 8)) {
253+
StoreAttachMirror(merger, cluster.sector, cluster.row, iTrk, 0, yy, 0, -1, 0, 0, prop.GetAlpha());
274254
}
275255
MirrorTo(prop, yy, zz, inFlyDirection, param, cluster.row, clusterState, true, cluster.sector);
276256
noFollowCircle = false;
@@ -751,24 +731,15 @@ GPUdii() void GPUTPCGMTrackParam::RefitLoop(const GPUTPCGMMerger* GPUrestrict()
751731
GPUTPCGMLoopData& data = Merger->LoopData()[loopIdx];
752732
prop.SetTrack(&data.param, data.alpha);
753733
if (data.toSector == -1) {
754-
data.param.AttachClustersMirror<1>(Merger, data.sector, data.row, data.track, data.toY, prop, true);
734+
data.param.AttachClustersMirror(Merger, data.sector, data.row, data.track, data.toY, prop);
755735
} else {
756-
data.param.FollowCircle<1>(Merger, prop, data.sector, data.row, data.track, data.toAlpha, data.toX, data.toY, data.toSector, data.toRow, data.inFlyDirection, true);
736+
data.param.FollowCircle(Merger, prop, data.sector, data.row, data.track, data.toAlpha, data.toX, data.toY, data.toSector, data.toRow, data.inFlyDirection);
757737
}
758738
}
759739

760-
template <int32_t I>
761-
GPUdic(0, 1) int32_t GPUTPCGMTrackParam::FollowCircle(const GPUTPCGMMerger* GPUrestrict() Merger, GPUTPCGMPropagator& GPUrestrict() prop, int32_t sector, int32_t iRow, int32_t iTrack, float toAlpha, float toX, float toY, int32_t toSector, int32_t toRow, bool inFlyDirection, bool phase2)
740+
GPUdi() int32_t GPUTPCGMTrackParam::FollowCircle(const GPUTPCGMMerger* GPUrestrict() Merger, GPUTPCGMPropagator& GPUrestrict() prop, int32_t sector, int32_t iRow, int32_t iTrack, float toAlpha, float toX, float toY, int32_t toSector, int32_t toRow, bool inFlyDirection)
762741
{
763742
static constexpr float kSectAngle = 2 * M_PI / 18.f;
764-
if (Merger->Param().rec.tpc.disableRefitAttachment & 4) {
765-
return 1;
766-
}
767-
const bool inExtraPass = Merger->Param().rec.tpc.looperInterpolationInExtraPass == -1 ? GPUCA_PAR_MERGER_SPLIT_LOOP_INTERPOLATION : Merger->Param().rec.tpc.looperInterpolationInExtraPass;
768-
if (inExtraPass && phase2 == false) {
769-
StoreAttachMirror(Merger, sector, iRow, iTrack, toAlpha, toY, toX, toSector, toRow, inFlyDirection, prop.GetAlpha());
770-
return 1;
771-
}
772743
const GPUParam& GPUrestrict() param = Merger->Param();
773744
bool right;
774745
float dAlpha = toAlpha - prop.GetAlpha();
@@ -862,19 +833,9 @@ GPUdic(0, 1) int32_t GPUTPCGMTrackParam::FollowCircle(const GPUTPCGMMerger* GPUr
862833
return (0);
863834
}
864835

865-
template <int32_t I>
866-
GPUdni() void GPUTPCGMTrackParam::AttachClustersMirror(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t sector, int32_t iRow, int32_t iTrack, float toY, GPUTPCGMPropagator& GPUrestrict() prop, bool phase2)
836+
GPUdi() void GPUTPCGMTrackParam::AttachClustersMirror(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t sector, int32_t iRow, int32_t iTrack, float toY, GPUTPCGMPropagator& GPUrestrict() prop)
867837
{
868838
static constexpr float kSectAngle = 2 * M_PI / 18.f;
869-
870-
if (Merger->Param().rec.tpc.disableRefitAttachment & 8) {
871-
return;
872-
}
873-
const bool inExtraPass = Merger->Param().rec.tpc.looperInterpolationInExtraPass == -1 ? GPUCA_PAR_MERGER_SPLIT_LOOP_INTERPOLATION : Merger->Param().rec.tpc.looperInterpolationInExtraPass;
874-
if (inExtraPass && phase2 == false) {
875-
StoreAttachMirror(Merger, sector, iRow, iTrack, 0, toY, 0, -1, 0, 0, prop.GetAlpha());
876-
return;
877-
}
878839
// Note that the coordinate system is rotated by 90 degree swapping X and Y!
879840
float X = mP[2] > 0 ? mP[0] : -mP[0];
880841
float toX = mP[2] > 0 ? toY : -toY;

GPU/GPUTracking/Merger/GPUTPCGMTrackParam.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,8 @@ class GPUTPCGMTrackParam
150150
GPUd() float AttachClusters(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t sector, int32_t iRow, int32_t iTrack, bool goodLeg, GPUTPCGMPropagator& prop); // Returns uncorrectedY for later use
151151
GPUd() float AttachClusters(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t sector, int32_t iRow, int32_t iTrack, bool goodLeg, float Y, float Z);
152152
// We force to compile these twice, for RefitLoop and for Fit, for better optimization
153-
template <int32_t I>
154-
GPUd() void AttachClustersMirror(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t sector, int32_t iRow, int32_t iTrack, float toY, GPUTPCGMPropagator& prop, bool phase2 = false);
155-
template <int32_t I>
156-
GPUd() int32_t FollowCircle(const GPUTPCGMMerger* GPUrestrict() Merger, GPUTPCGMPropagator& prop, int32_t sector, int32_t iRow, int32_t iTrack, float toAlpha, float toX, float toY, int32_t toSector, int32_t toRow, bool inFlyDirection, bool phase2 = false);
153+
GPUd() void AttachClustersMirror(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t sector, int32_t iRow, int32_t iTrack, float toY, GPUTPCGMPropagator& prop);
154+
GPUd() int32_t FollowCircle(const GPUTPCGMMerger* GPUrestrict() Merger, GPUTPCGMPropagator& prop, int32_t sector, int32_t iRow, int32_t iTrack, float toAlpha, float toX, float toY, int32_t toSector, int32_t toRow, bool inFlyDirection);
157155
GPUd() void StoreAttachMirror(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t sector, int32_t iRow, int32_t iTrack, float toAlpha, float toY, float toX, int32_t toSector, int32_t toRow, bool inFlyDirection, float alpha);
158156
GPUd() void StoreOuter(gputpcgmmergertypes::GPUTPCOuterParam* outerParam, const GPUTPCGMPropagator& prop, int32_t phase);
159157
GPUd() static void RefitLoop(const GPUTPCGMMerger* GPUrestrict() Merger, int32_t loopIdx);

GPU/GPUTracking/Standalone/Benchmark/standalone.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ int32_t SetupReconstruction()
460460
procSet.tpcInputWithClusterRejection = 1;
461461
}
462462
recSet.tpc.disableRefitAttachment = 0xFF;
463-
recSet.tpc.looperInterpolationInExtraPass = 0;
464463
recSet.maxTrackQPtB5 = CAMath::Min(recSet.maxTrackQPtB5, recSet.tpc.rejectQPtB5);
465464
recSet.useMatLUT = true;
466465
recAsync->SetSettings(&grp, &recSet, &procSet, &steps);

GPU/GPUTracking/kernels.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ o2_gpu_kernel_add_parameter(NEIGHBOURS_FINDER_MAX_NNEIGHUP
142142
TRACKLET_SELECTOR_HITS_REG_SIZE
143143
ALTERNATE_BORDER_SORT
144144
SORT_BEFORE_FIT
145-
MERGER_SPLIT_LOOP_INTERPOLATION
146145
NO_ATOMIC_PRECHECK
147146
COMP_GATHER_KERNEL
148147
COMP_GATHER_MODE

0 commit comments

Comments
 (0)