diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/gpuClustering.h b/RecoLocalTracker/SiPixelClusterizer/plugins/gpuClustering.h index dba9fe12f5492..5c21a39302d70 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/gpuClustering.h +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/gpuClustering.h @@ -1,8 +1,6 @@ #ifndef RecoLocalTracker_SiPixelClusterizer_plugins_gpuClustering_h #define RecoLocalTracker_SiPixelClusterizer_plugins_gpuClustering_h -// #define CLUS_LIMIT_LOOP - #include #include @@ -87,8 +85,8 @@ namespace gpuClustering { __syncthreads(); assert((msize == numElements) or ((msize < numElements) and (id[msize] != thisModuleId))); - assert(msize-firstPixel60) atomicAdd(&n60,1); if(hist.size(j)>40) atomicAdd(&n40,1); } @@ -156,11 +150,31 @@ namespace gpuClustering { __syncthreads(); #endif + // fill NN + for (int j=threadIdx.x, k = 0; j 1) continue; + auto l = nnn[k]++; + assert(l<5); + nn[k][l]=*p; + } + } + // for each pixel, look at all the pixels until the end of the module; // when two valid pixels within +/- 1 in x or y are found, set their id to the minimum; // after the loop, all the pixel in each cluster should have the id equeal to the lowest // pixel in the cluster ( clus[i] == i ). bool more = true; + int nloops=0; while (__syncthreads_or(more)) { if (1==nloops%2) { for (int j=threadIdx.x, k = 0; j 1) return; - // if (std::abs(int(y[m]) - int(y[i])) > 1) return; // binssize is 1 auto old = atomicMin(&clusterId[m], clusterId[i]); if (old != clusterId[i]) { // end the loop only if no changes were applied more = true; } atomicMin(&clusterId[i], old); -#ifdef CLUS_LIMIT_LOOP - // update the loop boundary for the next iteration - jmax[k] = std::max(kk + 1,jmax[k]); -#endif - }; - ++p; - for (;p