1 #ifndef RecoLocalTracker_SiPixelClusterizer_plugins_gpuClustering_h 2 #define RecoLocalTracker_SiPixelClusterizer_plugins_gpuClustering_h 19 namespace pixelStatus {
23 constexpr uint32_t
bits = 2;
48 uint32_t expected = old_word;
57 uint32_t new_word = old_word | (
static_cast<uint32_t
>(new_status) <<
shift);
59 }
while (expected != old_word);
68 template <
bool isPhase2>
69 __global__ void countModules(uint16_t
const* __restrict__
id,
84 if (
j < 0
or id[
j] !=
id[
i]) {
92 template <
bool isPhase2>
93 __global__ void findClus(uint32_t* __restrict__ rawIdArr,
94 uint16_t* __restrict__
id,
95 uint16_t
const* __restrict__
x,
96 uint16_t
const* __restrict__
y,
105 __shared__ uint32_t
status[pixelStatusSize];
117 auto thisModuleId =
id[firstPixel];
121 if (thisModuleId % 100 == 1)
123 printf(
"start clusterizer for module %d in block %d\n", thisModuleId,
blockIdx.x);
136 if (
id[
i] != thisModuleId) {
144 constexpr uint32_t maxPixInModule = 6000;
146 constexpr
auto nbits =
isPhase2 ? 10 : 9;
159 if (
msize - firstPixel > maxPixInModule) {
160 printf(
"too many pixels in module %d: %d > %d\n", thisModuleId,
msize - firstPixel, maxPixInModule);
161 msize = maxPixInModule + firstPixel;
169 __shared__ uint32_t totGood;
219 if (thisModuleId % 100 == 1)
221 printf(
"histo size %d\n",
hist.size());
226 hist.fill(
y[
i],
i - firstPixel);
233 printf(
"THIS IS NOT SUPPOSED TO HAPPEN too many hits in module %d: %d for block size %d\n",
241 constexpr
int maxNeighbours = 10;
253 __shared__ uint32_t n40, n60;
257 if (
hist.size(
j) > 60)
259 if (
hist.size(
j) > 40)
265 printf(
"columns with more than 60 px %d in %d\n", n60, thisModuleId);
267 printf(
"columns with more than 40 px %d in %d\n", n40, thisModuleId);
275 auto p =
hist.begin() +
j;
276 auto i = *
p + firstPixel;
284 auto m = (*p) + firstPixel;
305 auto p =
hist.begin() +
j;
306 auto i = *
p + firstPixel;
315 auto p =
hist.begin() +
j;
316 auto i = *
p + firstPixel;
317 for (
int kk = 0;
kk < nnn[
k]; ++
kk) {
319 auto m =
l + firstPixel;
342 if (thisModuleId % 100 == 1)
344 printf(
"# loops %d\n",
nloops);
396 if (thisModuleId % 100 == 1)
397 printf(
"%d clusters in module %d\n",
foundClusters, thisModuleId);
404 #endif // RecoLocalTracker_SiPixelClusterizer_plugins_gpuClustering_h
constexpr uint32_t valuesPerWord
__shared__ uint8_t ok[maxNumClustersPerModules]
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ nClustersInModule
constexpr int nMaxModules
bool __syncthreads_or(bool x)
T1 atomicCAS(T1 *address, T1 compare, T2 val)
__device__ constexpr Status getStatus(uint32_t const *__restrict__ status, uint16_t x, uint16_t y)
constexpr uint32_t pixelSizeY
constexpr uint32_t numberOfModules
constexpr uint16_t numColsInModule
uint16_t *__restrict__ uint16_t const *__restrict__ x
constexpr uint32_t pixelSizeX
uint16_t *__restrict__ uint16_t const *__restrict__ uint16_t const *__restrict__ y
assert(nMaxModules< maxNumModules)
std::function< unsigned int(align::ID)> Counter
__shared__ uint32_t status[pixelStatusSize]
cms::cuda::HistoContainer< uint8_t, 256, 16000, 8, uint16_t > Hist
T1 atomicInc(T1 *a, T2 b)
static __device__ constexpr uint32_t getIndex(uint16_t x, uint16_t y)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Abs< T >::type abs(const T &t)
static const MaxIter maxiter
constexpr uint16_t maxNumModules
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ int32_t *__restrict__ clusterId
constexpr uint16_t invalidModuleId
T1 atomicMin_block(T1 *a, T2 b)
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ int32_t *__restrict__ uint32_t numElements
constexpr uint32_t numberOfModules
__device__ constexpr uint32_t getShift(uint16_t x, uint16_t y)
__device__ constexpr void promote(uint32_t *__restrict__ status, const uint16_t x, const uint16_t y)
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ moduleStart
static unsigned int const shift
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ moduleId
constexpr int invalidClusterId
bool __syncthreads_and(bool x)
T1 atomicMin(T1 *a, T2 b)
__device__ constexpr bool isDuplicate(uint32_t const *__restrict__ status, uint16_t x, uint16_t y)
__shared__ unsigned int foundClusters
T1 atomicAdd(T1 *a, T2 b)