1 #ifndef RecoPixelVertexing_PixelVertexFinding_plugins_gpuSplitVertices_h
2 #define RecoPixelVertexing_PixelVertexFinding_plugins_gpuSplitVertices_h
13 namespace gpuVertexFinder {
18 auto& __restrict__
data = *pdata;
19 auto& __restrict__
ws = *
pws;
21 float const* __restrict__
zt = ws.zt;
22 float const* __restrict__
ezt2 = ws.ezt2;
23 float* __restrict__
zv = data.zv;
24 float* __restrict__
wv = data.wv;
25 float const* __restrict__
chi2 = data.chi2;
26 uint32_t&
nvFinal = data.nvFinal;
28 int32_t
const* __restrict__
nn = data.ndof;
29 int32_t* __restrict__
iv = ws.iv;
38 if (chi2[kv] < maxChi2 *
float(nn[kv]))
41 constexpr
int MAXTK = 512;
45 __shared__ uint32_t it[MAXTK];
46 __shared__
float zz[MAXTK];
47 __shared__ uint8_t newV[MAXTK];
48 __shared__
float ww[MAXTK];
50 __shared__ uint32_t nq;
56 if (iv[
k] ==
int(kv)) {
58 zz[old] = zt[
k] - zv[kv];
59 newV[old] = zz[old] < 0 ? 0 : 1;
60 ww[old] = 1.f / ezt2[
k];
65 __shared__
float znew[2], wnew[2];
68 assert(
int(nq) == nn[kv] + 1);
94 auto d0 = fabs(zz[
k] - znew[0]);
95 auto d1 = fabs(zz[
k] - znew[1]);
106 if (0 == wnew[0] || 0 == wnew[1])
110 auto dist2 = (znew[0] - znew[1]) * (znew[0] - znew[1]);
112 auto chi2Dist = dist2 / (1.f / wnew[0] + 1.f / wnew[1]);
115 printf(
"inter %d %f %f\n", 20 - maxiter, chi2Dist, dist2 * wv[kv]);
121 __shared__ uint32_t igv;
134 splitVertices(pdata, pws, maxChi2);
139 #endif // RecoPixelVertexing_PixelVertexFinding_plugins_gpuSplitVertices_h
bool __syncthreads_or(bool x)
float const *__restrict__ ezt2
float const *__restrict__ zt
T1 atomicInc(T1 *a, T2 b)
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
static const MaxIter maxiter
static constexpr float d0
__device__ WorkSpace float maxChi2
static constexpr float d1
T1 atomicAdd(T1 *a, T2 b)