1 #include <alpaka/alpaka.hpp> 17 #undef PIXVERTEX_DEBUG_PRODUCE 28 template <
typename TrackerTraits>
31 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
74 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
85 alpaka::syncBlockThreads(acc);
87 alpaka::syncBlockThreads(acc);
90 alpaka::syncBlockThreads(acc);
92 alpaka::syncBlockThreads(acc);
98 class VertexFinderKernel1 {
100 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
101 ALPAKA_FN_ACC
void operator()(
const TAcc& acc,
110 alpaka::syncBlockThreads(acc);
114 class VertexFinderKernel2 {
116 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
119 alpaka::syncBlockThreads(acc);
125 template <
typename TrackerTraits>
130 #ifdef PIXVERTEX_DEBUG_PRODUCE 131 std::cout <<
"producing Vertices on GPU" << std::endl;
132 #endif // PIXVERTEX_DEBUG_PRODUCE 140 const auto initWorkDiv = cms::alpakatools::make_workdiv<Acc1D>(1, 1);
141 alpaka::exec<Acc1D>(
queue, initWorkDiv,
Init{},
soa, ws_d.view());
144 const uint32_t blockSize = 128;
145 const uint32_t numberOfBlocks =
147 const auto loadTracksWorkDiv = cms::alpakatools::make_workdiv<Acc1D>(numberOfBlocks, blockSize);
152 const auto finderSorterWorkDiv = cms::alpakatools::make_workdiv<Acc1D>(1, 1024 - 128);
153 const auto splitterFitterWorkDiv = cms::alpakatools::make_workdiv<Acc1D>(1024, 128);
157 #ifndef THREE_KERNELS 158 alpaka::exec<Acc1D>(
queue,
160 VertexFinderOneKernel{},
175 alpaka::exec<Acc1D>(
queue, finderSorterWorkDiv{},
soa, ws_d.view());
182 }
else if (useDBSCAN_) {
185 }
else if (useIterative_) {
197 alpaka::exec<Acc1D>(
queue, finderSorterWorkDiv, SortByPt2Kernel{},
soa, ws_d.view());
203 template class Producer<pixelTopology::Phase1>;
204 template class Producer<pixelTopology::Phase2>;
205 template class Producer<pixelTopology::HIonPhase1>;
constexpr float maxChi2ForFirstFit
ALPAKA_FN_ACC ALPAKA_FN_INLINE void VtxSoAView & pdata
ALPAKA_FN_ACC ALPAKA_FN_INLINE void VtxSoAView WsSoAView int float eps
ALPAKA_FN_ACC void operator()(const TAcc &acc, reco::TrackSoAConstView< TrackerTraits > tracks_view, VtxSoAView soa, WsSoAView pws, float ptMin, float ptMax) const
std::conditional_t< std::is_same_v< Device, alpaka::DevCpu >, ZVertexHost, ZVertexDevice< Device > > ZVertexSoACollection
uint32_t const *__restrict__ TkSoAView< TrackerTraits > tracks_view
ALPAKA_FN_ACC ALPAKA_FN_INLINE void VtxSoAView WsSoAView int float float errmax
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr float zip(ConstView const &tracks, int32_t i)
constexpr uint32_t MAXTRACKS
fitVertices(pdata, pws, maxChi2ForFirstFit)
ALPAKA_FN_ACC ALPAKA_FN_INLINE void VtxSoAView WsSoAView & pws
std::vector< Block > Blocks
ALPAKA_FN_ACC ALPAKA_FN_INLINE void VtxSoAView WsSoAView int minT
splitVertices(pdata, pws, maxChi2ForSplit)
constexpr float maxChi2ForFinalFit
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr bool isTriplet(ConstView const &tracks, int32_t i)
ALPAKA_FN_ACC void operator()(const TAcc &acc, VtxSoAView pdata, WsSoAView pws, bool doSplit, int minT, float eps, float errmax, float chi2max) const
ALPAKA_FN_ACC ALPAKA_FN_INLINE void sortByPt2(const TAcc &acc, VtxSoAView &data, WsSoAView &ws)
::vertexFinder::PixelVertexWorkSpaceSoAView WsSoAView
typename reco::TrackSoA< TrackerTraits >::template Layout<>::ConstView TrackSoAConstView
PortableCollection<::vertexFinder::PixelVertexWSSoALayout<> > PixelVertexWorkSpaceSoADevice
ALPAKA_FN_ACC ALPAKA_FN_INLINE void VtxSoAView WsSoAView int float float float chi2max
::reco::ZVertexSoAView VtxSoAView
ZVertexSoACollection makeAsync(Queue &queue, const TkSoAConstView &tracks_view, float ptMin, float ptMax) const
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
T1 atomicAdd(T1 *a, T2 b)
constexpr float maxChi2ForSplit