1 #include <alpaka/alpaka.hpp> 18 #undef PIXVERTEX_DEBUG_PRODUCE 29 template <
typename TrackerTraits>
32 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
75 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
86 alpaka::syncBlockThreads(acc);
88 alpaka::syncBlockThreads(acc);
91 alpaka::syncBlockThreads(acc);
93 alpaka::syncBlockThreads(acc);
99 class VertexFinderKernel1 {
101 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
102 ALPAKA_FN_ACC
void operator()(
const TAcc& acc,
111 alpaka::syncBlockThreads(acc);
115 class VertexFinderKernel2 {
117 template <
typename TAcc,
typename = std::enable_if_t<alpaka::isAccelerator<TAcc>>>
120 alpaka::syncBlockThreads(acc);
126 template <
typename TrackerTraits>
131 #ifdef PIXVERTEX_DEBUG_PRODUCE 132 std::cout <<
"producing Vertices on GPU" << std::endl;
133 #endif // PIXVERTEX_DEBUG_PRODUCE 141 const auto initWorkDiv = cms::alpakatools::make_workdiv<Acc1D>(1, 1);
142 alpaka::exec<Acc1D>(
queue, initWorkDiv,
Init{},
soa, ws_d.view());
145 const uint32_t blockSize = 128;
146 const uint32_t numberOfBlocks =
148 const auto loadTracksWorkDiv = cms::alpakatools::make_workdiv<Acc1D>(numberOfBlocks, blockSize);
153 const auto finderSorterWorkDiv = cms::alpakatools::make_workdiv<Acc1D>(1, 1024 - 128);
154 const auto splitterFitterWorkDiv = cms::alpakatools::make_workdiv<Acc1D>(1024, 128);
158 #ifndef THREE_KERNELS 159 alpaka::exec<Acc1D>(
queue,
161 VertexFinderOneKernel{},
176 alpaka::exec<Acc1D>(
queue, finderSorterWorkDiv{},
soa, ws_d.view());
183 }
else if (useDBSCAN_) {
186 }
else if (useIterative_) {
198 alpaka::exec<Acc1D>(
queue, finderSorterWorkDiv, SortByPt2Kernel{},
soa, ws_d.view());
204 template class Producer<pixelTopology::Phase1>;
205 template class Producer<pixelTopology::Phase2>;
206 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