diff --git a/RecoTracker/LSTCore/src/alpaka/Hit.h b/RecoTracker/LSTCore/src/alpaka/Hit.h index da726ec470d02..b416a1e329b89 100644 --- a/RecoTracker/LSTCore/src/alpaka/Hit.h +++ b/RecoTracker/LSTCore/src/alpaka/Hit.h @@ -80,8 +80,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { } struct ModuleRangesKernel { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc1D const& acc, ModulesConst modules, HitsRanges hitsRanges, int nLowerModules) const { @@ -100,8 +99,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct HitLoopKernel { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc1D const& acc, uint16_t Endcap, // Integer corresponding to endcap in module subdets uint16_t TwoS, // Integer corresponding to TwoS in moduleType unsigned int nModules, // Number of modules diff --git a/RecoTracker/LSTCore/src/alpaka/Kernels.h b/RecoTracker/LSTCore/src/alpaka/Kernels.h index 40e9a0c587b3b..4c738259dfd87 100644 --- a/RecoTracker/LSTCore/src/alpaka/Kernels.h +++ b/RecoTracker/LSTCore/src/alpaka/Kernels.h @@ -141,8 +141,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { } struct RemoveDupQuintupletsAfterBuild { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc3D const& acc, ModulesConst modules, Quintuplets quintuplets, QuintupletsOccupancyConst quintupletsOccupancy, @@ -188,8 +187,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct RemoveDupQuintupletsBeforeTC { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc2D const& acc, Quintuplets quintuplets, QuintupletsOccupancyConst quintupletsOccupancy, ObjectRangesConst ranges) const { @@ -267,8 +265,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct RemoveDupPixelTripletsFromMap { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, PixelTriplets pixelTriplets) const { + ALPAKA_FN_ACC void operator()(Acc2D const& acc, PixelTriplets pixelTriplets) const { for (unsigned int ix : cms::alpakatools::uniform_elements_y(acc, pixelTriplets.nPixelTriplets())) { for (unsigned int jx : cms::alpakatools::uniform_elements_x(acc, pixelTriplets.nPixelTriplets())) { if (ix == jx) @@ -298,8 +295,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct RemoveDupPixelQuintupletsFromMap { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, PixelQuintuplets pixelQuintuplets) const { + ALPAKA_FN_ACC void operator()(Acc2D const& acc, PixelQuintuplets pixelQuintuplets) const { unsigned int nPixelQuintuplets = pixelQuintuplets.nPixelQuintuplets(); for (unsigned int ix : cms::alpakatools::uniform_elements_y(acc, nPixelQuintuplets)) { float score1 = __H2F(pixelQuintuplets.score()[ix]); @@ -322,8 +318,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct CheckHitspLS { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc2D const& acc, ModulesConst modules, SegmentsOccupancyConst segmentsOccupancy, SegmentsPixel segmentsPixel, diff --git a/RecoTracker/LSTCore/src/alpaka/MiniDoublet.h b/RecoTracker/LSTCore/src/alpaka/MiniDoublet.h index 73dc7051fd93c..6ac9a36d1b40e 100644 --- a/RecoTracker/LSTCore/src/alpaka/MiniDoublet.h +++ b/RecoTracker/LSTCore/src/alpaka/MiniDoublet.h @@ -675,8 +675,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { } struct CreateMiniDoublets { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc2D const& acc, ModulesConst modules, HitsConst hits, HitsRangesConst hitsRanges, @@ -802,12 +801,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { } struct CreateMDArrayRangesGPU { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, ModulesConst modules, ObjectRanges ranges, const float ptCut) const { - // implementation is 1D with a single block - static_assert(std::is_same_v, "Should be Acc1D"); - ALPAKA_ASSERT_ACC((alpaka::getWorkDiv(acc)[0] == 1)); - + ALPAKA_FN_ACC void operator()(Acc1D const& acc, ModulesConst modules, ObjectRanges ranges, const float ptCut) const { // Declare variables in shared memory and set to 0 int& nTotalMDs = alpaka::declareSharedVar(acc); if (cms::alpakatools::once_per_block(acc)) { @@ -869,16 +863,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct AddMiniDoubletRangesToEventExplicit { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc1D const& acc, ModulesConst modules, MiniDoubletsOccupancy mdsOccupancy, ObjectRanges ranges, HitsRangesConst hitsRanges) const { - // implementation is 1D with a single block - static_assert(std::is_same_v, "Should be Acc1D"); - ALPAKA_ASSERT_ACC((alpaka::getWorkDiv(acc)[0] == 1)); - for (uint16_t i : cms::alpakatools::uniform_elements(acc, modules.nLowerModules())) { if (mdsOccupancy.nMDs()[i] == 0 or hitsRanges.hitRanges()[i][0] == -1) { ranges.mdRanges()[i][0] = -1; diff --git a/RecoTracker/LSTCore/src/alpaka/PixelQuintuplet.h b/RecoTracker/LSTCore/src/alpaka/PixelQuintuplet.h index 0c2aa28896b7c..1923e5dfe8c3f 100644 --- a/RecoTracker/LSTCore/src/alpaka/PixelQuintuplet.h +++ b/RecoTracker/LSTCore/src/alpaka/PixelQuintuplet.h @@ -634,8 +634,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { } struct CreatePixelQuintupletsFromMap { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc3D const& acc, ModulesConst modules, ModulesPixelConst modulesPixel, MiniDoubletsConst mds, diff --git a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h index ef7c4d8629718..c0e132c6ddb5d 100644 --- a/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h +++ b/RecoTracker/LSTCore/src/alpaka/PixelTriplet.h @@ -786,8 +786,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { } struct CreatePixelTripletsFromMap { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc3D const& acc, ModulesConst modules, ModulesPixelConst modulesPixel, ObjectRangesConst ranges, diff --git a/RecoTracker/LSTCore/src/alpaka/Quintuplet.h b/RecoTracker/LSTCore/src/alpaka/Quintuplet.h index 345a500848d78..0ce6870a016ff 100644 --- a/RecoTracker/LSTCore/src/alpaka/Quintuplet.h +++ b/RecoTracker/LSTCore/src/alpaka/Quintuplet.h @@ -1642,8 +1642,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { } struct CreateQuintuplets { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc3D const& acc, ModulesConst modules, MiniDoubletsConst mds, SegmentsConst segments, @@ -1773,16 +1772,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct CreateEligibleModulesListForQuintuplets { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc1D const& acc, ModulesConst modules, TripletsOccupancyConst tripletsOccupancy, ObjectRanges ranges, const float ptCut) const { - // implementation is 1D with a single block - static_assert(std::is_same_v, "Should be Acc1D"); - ALPAKA_ASSERT_ACC((alpaka::getWorkDiv(acc)[0] == 1)); - // Initialize variables in shared memory and set to 0 int& nEligibleT5Modulesx = alpaka::declareSharedVar(acc); int& nTotalQuintupletsx = alpaka::declareSharedVar(acc); @@ -1857,15 +1851,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct AddQuintupletRangesToEventExplicit { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc1D const& acc, ModulesConst modules, QuintupletsOccupancyConst quintupletsOccupancy, ObjectRanges ranges) const { - // implementation is 1D with a single block - static_assert(std::is_same_v, "Should be Acc1D"); - ALPAKA_ASSERT_ACC((alpaka::getWorkDiv(acc)[0] == 1)); - for (uint16_t i : cms::alpakatools::uniform_elements(acc, modules.nLowerModules())) { if (quintupletsOccupancy.nQuintuplets()[i] == 0 or ranges.quintupletModuleIndices()[i] == -1) { ranges.quintupletRanges()[i][0] = -1; diff --git a/RecoTracker/LSTCore/src/alpaka/Segment.h b/RecoTracker/LSTCore/src/alpaka/Segment.h index 92ed042a77d65..0e61c09bbf119 100644 --- a/RecoTracker/LSTCore/src/alpaka/Segment.h +++ b/RecoTracker/LSTCore/src/alpaka/Segment.h @@ -525,8 +525,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { } struct CreateSegments { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc3D const& acc, ModulesConst modules, MiniDoubletsConst mds, MiniDoubletsOccupancyConst mdsOccupancy, @@ -620,13 +619,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct CreateSegmentArrayRanges { - template ALPAKA_FN_ACC void operator()( - TAcc const& acc, ModulesConst modules, ObjectRanges ranges, MiniDoubletsConst mds, const float ptCut) const { - // implementation is 1D with a single block - static_assert(std::is_same_v, "Should be Acc1D"); - ALPAKA_ASSERT_ACC((alpaka::getWorkDiv(acc)[0] == 1)); - + Acc1D const& acc, ModulesConst modules, ObjectRanges ranges, MiniDoubletsConst mds, const float ptCut) const { // Initialize variables in shared memory and set to 0 int& nTotalSegments = alpaka::declareSharedVar(acc); if (cms::alpakatools::once_per_block(acc)) { @@ -693,15 +687,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct AddSegmentRangesToEventExplicit { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc1D const& acc, ModulesConst modules, SegmentsOccupancyConst segmentsOccupancy, ObjectRanges ranges) const { - // implementation is 1D with a single block - static_assert(std::is_same_v, "Should be Acc1D"); - ALPAKA_ASSERT_ACC((alpaka::getWorkDiv(acc)[0] == 1)); - for (uint16_t i : cms::alpakatools::uniform_elements(acc, modules.nLowerModules())) { if (segmentsOccupancy.nSegments()[i] == 0) { ranges.segmentRanges()[i][0] = -1; @@ -715,8 +704,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct AddPixelSegmentToEventKernel { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc1D const& acc, ModulesConst modules, ObjectRangesConst ranges, HitsConst hits, diff --git a/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h b/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h index bea2635d341e2..8f3a6cd37d192 100644 --- a/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h +++ b/RecoTracker/LSTCore/src/alpaka/TrackCandidate.h @@ -108,8 +108,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { } struct CrossCleanpT3 { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc2D const& acc, ModulesConst modules, ObjectRangesConst ranges, PixelTriplets pixelTriplets, @@ -144,8 +143,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct CrossCleanT5 { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc3D const& acc, ModulesConst modules, Quintuplets quintuplets, QuintupletsOccupancyConst quintupletsOccupancy, @@ -193,8 +191,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct CrossCleanpLS { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc2D const& acc, ModulesConst modules, ObjectRangesConst ranges, PixelTripletsConst pixelTriplets, @@ -268,17 +265,12 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct AddpT3asTrackCandidates { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc1D const& acc, uint16_t nLowerModules, PixelTripletsConst pixelTriplets, TrackCandidates cands, SegmentsPixelConst segmentsPixel, ObjectRangesConst ranges) const { - // implementation is 1D with a single block - static_assert(std::is_same_v, "Should be Acc1D"); - ALPAKA_ASSERT_ACC((alpaka::getWorkDiv(acc)[0] == 1)); - unsigned int nPixelTriplets = pixelTriplets.nPixelTriplets(); unsigned int pLS_offset = ranges.segmentModuleIndices()[nLowerModules]; for (unsigned int pixelTripletIndex : cms::alpakatools::uniform_elements(acc, nPixelTriplets)) { @@ -320,8 +312,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct AddT5asTrackCandidate { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc2D const& acc, uint16_t nLowerModules, QuintupletsConst quintuplets, QuintupletsOccupancyConst quintupletsOccupancy, @@ -371,8 +362,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct AddpLSasTrackCandidate { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc1D const& acc, uint16_t nLowerModules, TrackCandidates cands, SegmentsOccupancyConst segmentsOccupancy, @@ -408,17 +398,12 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct AddpT5asTrackCandidate { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc1D const& acc, uint16_t nLowerModules, PixelQuintupletsConst pixelQuintuplets, TrackCandidates cands, SegmentsPixelConst segmentsPixel, ObjectRangesConst ranges) const { - // implementation is 1D with a single block - static_assert(std::is_same_v, "Should be Acc1D"); - ALPAKA_ASSERT_ACC((alpaka::getWorkDiv(acc)[0] == 1)); - int nPixelQuintuplets = pixelQuintuplets.nPixelQuintuplets(); unsigned int pLS_offset = ranges.segmentModuleIndices()[nLowerModules]; for (int pixelQuintupletIndex : cms::alpakatools::uniform_elements(acc, nPixelQuintuplets)) { diff --git a/RecoTracker/LSTCore/src/alpaka/Triplet.h b/RecoTracker/LSTCore/src/alpaka/Triplet.h index ec3e6935a85c5..10446cd542c17 100644 --- a/RecoTracker/LSTCore/src/alpaka/Triplet.h +++ b/RecoTracker/LSTCore/src/alpaka/Triplet.h @@ -734,8 +734,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { } struct CreateTriplets { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc3D const& acc, ModulesConst modules, MiniDoubletsConst mds, SegmentsConst segments, @@ -835,16 +834,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct CreateTripletArrayRanges { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc1D const& acc, ModulesConst modules, ObjectRanges ranges, SegmentsOccupancyConst segmentsOccupancy, const float ptCut) const { - // implementation is 1D with a single block - static_assert(std::is_same_v, "Should be Acc1D"); - ALPAKA_ASSERT_ACC((alpaka::getWorkDiv(acc)[0] == 1)); - // Initialize variables in shared memory and set to 0 int& nTotalTriplets = alpaka::declareSharedVar(acc); if (cms::alpakatools::once_per_block(acc)) { @@ -910,15 +904,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::lst { }; struct AddTripletRangesToEventExplicit { - template - ALPAKA_FN_ACC void operator()(TAcc const& acc, + ALPAKA_FN_ACC void operator()(Acc1D const& acc, ModulesConst modules, TripletsOccupancyConst tripletsOccupancy, ObjectRanges ranges) const { - // implementation is 1D with a single block - static_assert(std::is_same_v, "Should be Acc1D"); - ALPAKA_ASSERT_ACC((alpaka::getWorkDiv(acc)[0] == 1)); - for (uint16_t i : cms::alpakatools::uniform_elements(acc, modules.nLowerModules())) { if (tripletsOccupancy.nTriplets()[i] == 0) { ranges.tripletRanges()[i][0] = -1;