Skip to content

Commit 13d093d

Browse files
authored
Merge pull request #48285 from slava77/CMSSW_15_1_X_2025-06-09-1100/lst-uint4
LST replace uint4 by uint[4] array Params_pLS::ArrayUxHits
2 parents 7c36e8f + 6efdaa6 commit 13d093d

File tree

5 files changed

+15
-38
lines changed

5 files changed

+15
-38
lines changed

RecoTracker/LSTCore/interface/Common.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,6 @@ namespace lst {
4646
typedef float FPX;
4747
#endif
4848

49-
// Needed for files that are compiled by g++ to not throw an error.
50-
// uint4 is defined only for CUDA, so we will have to revisit this soon when running on other backends.
51-
#if !defined(ALPAKA_ACC_GPU_CUDA_ENABLED) && !defined(ALPAKA_ACC_GPU_HIP_ENABLED)
52-
struct uint4 {
53-
unsigned int x;
54-
unsigned int y;
55-
unsigned int z;
56-
unsigned int w;
57-
};
58-
#endif
59-
6049
// Defining the constant host device variables right up here
6150
// Currently pixel tracks treated as LSs with 2 double layers (IT layers 1+2 and 3+4) and 4 hits. To be potentially handled better in the future.
6251
struct Params_Modules {

RecoTracker/LSTCore/interface/PixelSegmentsSoA.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace lst {
1010

1111
GENERATE_SOA_LAYOUT(PixelSegmentsSoALayout,
12-
SOA_COLUMN(uint4, pLSHitsIdxs),
12+
SOA_COLUMN(Params_pLS::ArrayUxHits, pLSHitsIdxs),
1313
SOA_COLUMN(Params_pLS::ArrayFxEmbed, plsEmbed),
1414
SOA_COLUMN(char, isDup),
1515
SOA_COLUMN(bool, partOfPT5),

RecoTracker/LSTCore/src/alpaka/Kernels.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
344344
if (secondpass && (!pixelSeeds.isQuad()[ix] || (pixelSegments.isDup()[ix] & 1)))
345345
continue;
346346

347-
unsigned int phits1[Params_pLS::kHits];
348-
phits1[0] = pixelSegments.pLSHitsIdxs()[ix].x;
349-
phits1[1] = pixelSegments.pLSHitsIdxs()[ix].y;
350-
phits1[2] = pixelSegments.pLSHitsIdxs()[ix].z;
351-
phits1[3] = pixelSegments.pLSHitsIdxs()[ix].w;
347+
auto const& phits1 = pixelSegments.pLSHitsIdxs()[ix];
352348
float eta_pix1 = pixelSeeds.eta()[ix];
353349
float phi_pix1 = pixelSeeds.phi()[ix];
354350

@@ -377,11 +373,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
377373
else
378374
idxToRemove = ix;
379375

380-
unsigned int phits2[Params_pLS::kHits];
381-
phits2[0] = pixelSegments.pLSHitsIdxs()[jx].x;
382-
phits2[1] = pixelSegments.pLSHitsIdxs()[jx].y;
383-
phits2[2] = pixelSegments.pLSHitsIdxs()[jx].z;
384-
phits2[3] = pixelSegments.pLSHitsIdxs()[jx].w;
376+
auto const& phits2 = pixelSegments.pLSHitsIdxs()[jx];
385377

386378
int npMatched = 0;
387379
for (int i = 0; i < Params_pLS::kHits; i++) {

RecoTracker/LSTCore/src/alpaka/Segment.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
217217
unsigned int innerMDIndex,
218218
unsigned int outerMDIndex,
219219
uint16_t pixelModuleIndex,
220-
unsigned int hitIdxs[4],
220+
const Params_pLS::ArrayUxHits& hitIdxs,
221221
unsigned int innerAnchorHitIndex,
222222
unsigned int outerAnchorHitIndex,
223223
float dPhiChange,
@@ -235,10 +235,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
235235
pixelSegments.isDup()[pixelSegmentArrayIndex] = false;
236236
pixelSegments.partOfPT5()[pixelSegmentArrayIndex] = false;
237237
pixelSegments.score()[pixelSegmentArrayIndex] = score;
238-
pixelSegments.pLSHitsIdxs()[pixelSegmentArrayIndex].x = hitIdxs[0];
239-
pixelSegments.pLSHitsIdxs()[pixelSegmentArrayIndex].y = hitIdxs[1];
240-
pixelSegments.pLSHitsIdxs()[pixelSegmentArrayIndex].z = hitIdxs[2];
241-
pixelSegments.pLSHitsIdxs()[pixelSegmentArrayIndex].w = hitIdxs[3];
238+
pixelSegments.pLSHitsIdxs()[pixelSegmentArrayIndex] = hitIdxs;
242239

243240
//computing circle parameters
244241
/*
@@ -807,11 +804,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
807804
(hitsBase.zs()[mds.anchorHitIndices()[outerMDIndex]]);
808805
score_lsq = score_lsq * score_lsq;
809806

810-
unsigned int hits1[Params_pLS::kHits];
811-
hits1[0] = hitsBase.idxs()[mds.anchorHitIndices()[innerMDIndex]];
812-
hits1[1] = hitsBase.idxs()[mds.anchorHitIndices()[outerMDIndex]];
813-
hits1[2] = hitsBase.idxs()[mds.outerHitIndices()[innerMDIndex]];
814-
hits1[3] = hitsBase.idxs()[mds.outerHitIndices()[outerMDIndex]];
807+
const Params_pLS::ArrayUxHits hits1{{hitsBase.idxs()[mds.anchorHitIndices()[innerMDIndex]],
808+
hitsBase.idxs()[mds.anchorHitIndices()[outerMDIndex]],
809+
hitsBase.idxs()[mds.outerHitIndices()[innerMDIndex]],
810+
hitsBase.idxs()[mds.outerHitIndices()[outerMDIndex]]}};
815811
addPixelSegmentToMemory(acc,
816812
segments,
817813
pixelSegments,

RecoTracker/LSTCore/src/alpaka/TrackCandidate.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
2222
ALPAKA_FN_ACC ALPAKA_FN_INLINE void addpLSTrackCandidateToMemory(TrackCandidates& cands,
2323
unsigned int trackletIndex,
2424
unsigned int trackCandidateIndex,
25-
uint4 hitIndices,
25+
const Params_pLS::ArrayUxHits& hitIndices,
2626
int pixelSeedIndex) {
2727
cands.trackCandidateType()[trackCandidateIndex] = LSTObjType::pLS;
2828
cands.directObjectIndices()[trackCandidateIndex] = trackletIndex;
@@ -31,11 +31,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst {
3131
cands.objectIndices()[trackCandidateIndex][0] = trackletIndex;
3232
cands.objectIndices()[trackCandidateIndex][1] = trackletIndex;
3333

34-
cands.hitIndices()[trackCandidateIndex][0] =
35-
hitIndices.x; // Order explanation in https://github.com/SegmentLinking/TrackLooper/issues/267
36-
cands.hitIndices()[trackCandidateIndex][1] = hitIndices.z;
37-
cands.hitIndices()[trackCandidateIndex][2] = hitIndices.y;
38-
cands.hitIndices()[trackCandidateIndex][3] = hitIndices.w;
34+
// Order explanation in https://github.com/SegmentLinking/TrackLooper/issues/267
35+
cands.hitIndices()[trackCandidateIndex][0] = hitIndices[0];
36+
cands.hitIndices()[trackCandidateIndex][1] = hitIndices[2];
37+
cands.hitIndices()[trackCandidateIndex][2] = hitIndices[1];
38+
cands.hitIndices()[trackCandidateIndex][3] = hitIndices[3];
3939
}
4040

4141
ALPAKA_FN_ACC ALPAKA_FN_INLINE void addTrackCandidateToMemory(TrackCandidates& cands,

0 commit comments

Comments
 (0)