1 #ifndef RecoTracker_PixelVertexFinding_plugins_alpaka_splitVertices_h 2 #define RecoTracker_PixelVertexFinding_plugins_alpaka_splitVertices_h 8 #include <alpaka/alpaka.hpp> 20 template <
typename TAcc>
28 auto&
it = alpaka::declareSharedVar<uint32_t[MAXTK], __COUNTER__>(acc);
29 auto&
zz = alpaka::declareSharedVar<float[MAXTK], __COUNTER__>(acc);
30 auto&
newV = alpaka::declareSharedVar<uint8_t[MAXTK], __COUNTER__>(acc);
31 auto&
ww = alpaka::declareSharedVar<float[MAXTK], __COUNTER__>(acc);
32 auto&
nq = alpaka::declareSharedVar<uint32_t, __COUNTER__>(acc);
51 alpaka::syncBlockThreads(acc);
65 auto& znew = alpaka::declareSharedVar<float[2], __COUNTER__>(acc);
66 auto& wnew = alpaka::declareSharedVar<float[2], __COUNTER__>(acc);
67 alpaka::syncBlockThreads(acc);
74 while (alpaka::syncBlockThreadsPredicate<alpaka::BlockOr>(acc,
more)) {
82 alpaka::syncBlockThreads(acc);
89 alpaka::syncBlockThreads(acc);
95 alpaka::syncBlockThreads(acc);
98 auto d0 = fabs(
zz[
k] - znew[0]);
99 auto d1 = fabs(
zz[
k] - znew[1]);
110 if (0 == wnew[0] || 0 == wnew[1])
114 auto dist2 = (znew[0] - znew[1]) * (znew[0] - znew[1]);
116 auto chi2Dist = dist2 / (1.f / wnew[0] + 1.f / wnew[1]);
120 printf(
"inter %d %f %f\n", 20 -
maxiter, chi2Dist, dist2 *
data[kv].
wv());
127 auto& igv = alpaka::declareSharedVar<uint32_t, __COUNTER__>(acc);
130 alpaka::syncBlockThreads(acc);
133 ws[
it[
k]].iv() = igv;
137 alpaka::syncBlockThreads(acc);
143 template <
typename TAcc>
151 #endif // RecoTracker_PixelVertexFinding_plugins_alpaka_splitVertices_h
ZVertexSoAHeterogeneousLayout<>::View ZVertexSoAView
ALPAKA_FN_ACC ALPAKA_FN_INLINE VtxSoAView WsSoAView float maxChi2
T1 atomicInc(T1 *a, T2 b)
std::vector< Block > Blocks
static const MaxIter maxiter
splitVertices(pdata, pws, maxChi2ForSplit)
PixelVertexWSSoALayout<>::View PixelVertexWorkSpaceSoAView
::vertexFinder::PixelVertexWorkSpaceSoAView WsSoAView
static constexpr float d0
::reco::ZVertexSoAView VtxSoAView
ALPAKA_FN_ACC void operator()(const TAcc &acc, VtxSoAView data, WsSoAView ws, float maxChi2) const
static constexpr float d1
T1 atomicAdd(T1 *a, T2 b)
ALPAKA_FN_ACC ALPAKA_FN_INLINE void __attribute__((always_inline)) clusterTracksByDensity(const TAcc &acc