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>
26 const uint32_t
threadIdxLocal(alpaka::getIdx<alpaka::Block, alpaka::Threads>(acc)[0u]);
29 auto& __restrict__
ws =
pws;
31 float const* __restrict__
zt =
ws.zt();
32 float const* __restrict__
ezt2 =
ws.ezt2();
33 float* __restrict__
zv =
data.zv();
34 float* __restrict__
wv =
data.wv();
35 float const* __restrict__
chi2 =
data.chi2();
38 int32_t
const* __restrict__
nn =
data.ndof();
39 int32_t* __restrict__
iv =
ws.iv();
48 auto&
it = alpaka::declareSharedVar<uint32_t[MAXTK], __COUNTER__>(acc);
49 auto&
zz = alpaka::declareSharedVar<float[MAXTK], __COUNTER__>(acc);
50 auto&
newV = alpaka::declareSharedVar<uint8_t[MAXTK], __COUNTER__>(acc);
51 auto&
ww = alpaka::declareSharedVar<float[MAXTK], __COUNTER__>(acc);
52 auto&
nq = alpaka::declareSharedVar<uint32_t, __COUNTER__>(acc);
54 const uint32_t
blockIdx(alpaka::getIdx<alpaka::Grid, alpaka::Blocks>(acc)[0u]);
55 const uint32_t
gridDimension(alpaka::getWorkDiv<alpaka::Grid, alpaka::Blocks>(acc)[0u]);
70 alpaka::syncBlockThreads(acc);
74 if (
iv[
k] ==
int(kv)) {
77 newV[old] =
zz[old] < 0 ? 0 : 1;
84 auto& znew = alpaka::declareSharedVar<float[2], __COUNTER__>(acc);
85 auto& wnew = alpaka::declareSharedVar<float[2], __COUNTER__>(acc);
86 alpaka::syncBlockThreads(acc);
93 while (alpaka::syncBlockThreadsPredicate<alpaka::BlockOr>(acc,
more)) {
101 alpaka::syncBlockThreads(acc);
108 alpaka::syncBlockThreads(acc);
114 alpaka::syncBlockThreads(acc);
117 auto d0 = fabs(
zz[
k] - znew[0]);
118 auto d1 = fabs(
zz[
k] - znew[1]);
129 if (0 == wnew[0] || 0 == wnew[1])
133 auto dist2 = (znew[0] - znew[1]) * (znew[0] - znew[1]);
135 auto chi2Dist = dist2 / (1.f / wnew[0] + 1.f / wnew[1]);
138 printf(
"inter %d %f %f\n", 20 -
maxiter, chi2Dist, dist2 *
wv[kv]);
144 auto& igv = alpaka::declareSharedVar<uint32_t, __COUNTER__>(acc);
147 alpaka::syncBlockThreads(acc);
158 template <
typename TAcc>
166 #endif // RecoTracker_PixelVertexFinding_plugins_alpaka_splitVertices_h const uint32_t gridDimension(alpaka::getWorkDiv< alpaka::Grid, alpaka::Blocks >(acc)[0u])
const uint32_t threadIdxLocal(alpaka::getIdx< alpaka::Block, alpaka::Threads >(acc)[0u])
ALPAKA_FN_ACC ALPAKA_FN_INLINE void VtxSoAView & pdata
float const *__restrict__ ezt2
ALPAKA_FN_ACC void operator()(const TAcc &acc, VtxSoAView pdata, WsSoAView pws, float maxChi2) const
ZVertexSoAHeterogeneousLayout<>::View ZVertexSoAView
ALPAKA_FN_ACC ALPAKA_FN_INLINE VtxSoAView WsSoAView float maxChi2
T1 atomicInc(T1 *a, T2 b)
ALPAKA_FN_ACC ALPAKA_FN_INLINE void VtxSoAView WsSoAView & pws
std::vector< Block > Blocks
static const MaxIter maxiter
splitVertices(pdata, pws, maxChi2ForSplit)
PixelVertexWSSoALayout<>::View PixelVertexWorkSpaceSoAView
::vertexFinder::PixelVertexWorkSpaceSoAView WsSoAView
static constexpr float d0
float const *__restrict__ zt
::reco::ZVertexSoAView VtxSoAView
const uint32_t blockIdx(alpaka::getIdx< alpaka::Grid, alpaka::Blocks >(acc)[0u])
static constexpr float d1
T1 atomicAdd(T1 *a, T2 b)
ALPAKA_FN_ACC ALPAKA_FN_INLINE void __attribute__((always_inline)) clusterTracksByDensity(const TAcc &acc