1 #ifndef RecoPixelVertexing_PixelVertexFinding_splitVertices_h 2 #define RecoPixelVertexing_PixelVertexFinding_splitVertices_h 7 #include <alpaka/alpaka.hpp> 17 template <
typename TAcc>
23 const uint32_t
threadIdxLocal(alpaka::getIdx<alpaka::Block, alpaka::Threads>(acc)[0u]);
26 auto& __restrict__
ws =
pws;
28 float const* __restrict__
zt =
ws.zt();
29 float const* __restrict__
ezt2 =
ws.ezt2();
30 float* __restrict__
zv =
data.zv();
31 float* __restrict__
wv =
data.wv();
32 float const* __restrict__
chi2 =
data.chi2();
35 int32_t
const* __restrict__
nn =
data.ndof();
36 int32_t* __restrict__
iv =
ws.iv();
45 auto&
it = alpaka::declareSharedVar<uint32_t[MAXTK], __COUNTER__>(acc);
46 auto&
zz = alpaka::declareSharedVar<float[MAXTK], __COUNTER__>(acc);
47 auto&
newV = alpaka::declareSharedVar<uint8_t[MAXTK], __COUNTER__>(acc);
48 auto&
ww = alpaka::declareSharedVar<float[MAXTK], __COUNTER__>(acc);
49 auto&
nq = alpaka::declareSharedVar<uint32_t, __COUNTER__>(acc);
51 const uint32_t
blockIdx(alpaka::getIdx<alpaka::Grid, alpaka::Blocks>(acc)[0u]);
52 const uint32_t
gridDimension(alpaka::getWorkDiv<alpaka::Grid, alpaka::Blocks>(acc)[0u]);
67 alpaka::syncBlockThreads(acc);
71 if (
iv[
k] ==
int(kv)) {
74 newV[old] =
zz[old] < 0 ? 0 : 1;
81 auto& znew = alpaka::declareSharedVar<float[2], __COUNTER__>(acc);
82 auto& wnew = alpaka::declareSharedVar<float[2], __COUNTER__>(acc);
83 alpaka::syncBlockThreads(acc);
90 while (alpaka::syncBlockThreadsPredicate<alpaka::BlockOr>(acc,
more)) {
98 alpaka::syncBlockThreads(acc);
105 alpaka::syncBlockThreads(acc);
111 alpaka::syncBlockThreads(acc);
114 auto d0 = fabs(
zz[
k] - znew[0]);
115 auto d1 = fabs(
zz[
k] - znew[1]);
126 if (0 == wnew[0] || 0 == wnew[1])
130 auto dist2 = (znew[0] - znew[1]) * (znew[0] - znew[1]);
132 auto chi2Dist = dist2 / (1.f / wnew[0] + 1.f / wnew[1]);
135 printf(
"inter %d %f %f\n", 20 -
maxiter, chi2Dist, dist2 *
wv[kv]);
141 auto& igv = alpaka::declareSharedVar<uint32_t, __COUNTER__>(acc);
144 alpaka::syncBlockThreads(acc);
155 template <
typename TAcc>
162 #endif // RecoPixelVertexing_PixelVertexFinding_plugins_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
ALPAKA_ASSERT_OFFLOAD(zt)
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