1 #ifndef RecoPixelVertexing_PixelVertexFinding_plugins_gpuClusterTracksIterative_h
2 #define RecoPixelVertexing_PixelVertexFinding_plugins_gpuClusterTracksIterative_h
13 namespace gpuVertexFinder {
27 printf(
"params %d %f %f %f\n", minT, eps, errmax, chi2max);
31 auto& __restrict__
data = *pdata;
32 auto& __restrict__
ws = *
pws;
34 float const* __restrict__
zt = ws.zt;
35 float const* __restrict__
ezt2 = ws.ezt2;
37 uint32_t&
nvFinal = data.nvFinal;
40 uint8_t* __restrict__
izt = ws.izt;
41 int32_t* __restrict__
nn = data.ndof;
42 int32_t* __restrict__
iv = ws.iv;
56 printf(
"booked hist with %d bins, size %d for %d tracks\n", hist.nbins(), hist.capacity(),
nt);
63 int iz = int(zt[
i] * 10.);
64 iz = std::clamp(iz, INT8_MIN, INT8_MAX);
65 izt[
i] = iz - INT8_MIN;
66 assert(iz - INT8_MIN >= 0);
67 assert(iz - INT8_MIN < 256);
80 hist.fill(izt[
i], uint16_t(i));
88 auto loop = [&](uint32_t
j) {
94 if (dist * dist > chi2max * (ezt2[i] + ezt2[
j]))
99 cms::cuda::forEachInBins(hist, izt[i], 1,
loop);
110 if (1 == nloops % 2) {
120 auto p = hist.begin() +
k;
125 auto loop = [&](uint32_t
j) {
132 if (dist * dist > chi2max * (ezt2[i] + ezt2[j]))
142 for (;
p < hist.end(
be); ++
p)
156 auto loop = [&](
int j) {
162 if (dist * dist > chi2max * (ezt2[i] + ezt2[
j]))
167 cms::cuda::forEachInBins(hist, izt[i], 1,
loop);
177 if (iv[i] ==
int(i)) {
179 auto old =
atomicInc(&foundClusters, 0xffffffff);
207 printf(
"found %d proto vertices\n", foundClusters);
212 #endif // RecoPixelVertexing_PixelVertexFinding_plugins_gpuClusterTracksIterative_h
bool __syncthreads_or(bool x)
float const *__restrict__ ezt2
float const *__restrict__ zt
static constexpr uint32_t MAXVTX
WorkSpace int float float float chi2max
cms::cuda::HistoContainer< uint8_t, 256, 16000, 8, uint16_t > Hist
T1 atomicInc(T1 *a, T2 b)
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
Abs< T >::type abs(const T &t)
typename Base::Counter Counter
__shared__ Hist::Counter hws[32]
uint8_t *__restrict__ izt
WorkSpace int float float errmax
static constexpr UT bin(T t)
static constexpr uint32_t totbins()
static constexpr uint32_t MAXTRACKS
T1 atomicMin(T1 *a, T2 b)
__shared__ unsigned int foundClusters
uint32_t & nvIntermediate