Skip to content

Commit 9a509cd

Browse files
authored
Merge pull request #49282 from AdrianoDee/nHitsToCells_clamp_fix_160X
Proper Clamping for CA Doublets Histogram
2 parents 4a9debb + 49b8b8a commit 9a509cd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernels.dev.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
5757
#ifdef GPU_DEBUG
5858
std::cout << "Allocation for tuple building with: " << std::endl;
5959
std::cout << "- nHits = " << nHits << std::endl;
60-
std::cout << "- maxDoublets = " << maxTuples << std::endl;
61-
std::cout << "- maxTracks = " << maxDoublets << std::endl;
60+
std::cout << "- maxDoublets = " << maxDoublets << std::endl;
61+
std::cout << "- maxTracks = " << maxTuples << std::endl;
6262

6363
std::cout << "- nCellsToCells = " << nCellsToCells << std::endl;
6464
std::cout << "- nHitsToCells = " << nHitsToCells << std::endl;

RecoTracker/PixelSeeding/plugins/alpaka/CAPixelDoubletsAlgos.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets {
420420
}
421421

422422
auto ind = alpaka::atomicAdd(acc, nCells, 1u, alpaka::hierarchy::Blocks{});
423-
if (ind >= maxNumOfDoublets) {
423+
if (ind >= maxNumOfDoublets or ind >= uint32_t(outerHitHisto->capacity())) {
424424
#ifdef CA_WARNINGS
425-
printf("Warning!!!! Too many cells (limit = %d)!\n", maxNumOfDoublets);
425+
printf("Warning!!!! Too many cells (maxNumOfDoublets = %d - nHitsToCell = %d)!\n",
426+
maxNumOfDoublets,
427+
outerHitHisto->capacity());
426428
#endif
427429
alpaka::atomicSub(acc, nCells, 1u, alpaka::hierarchy::Blocks{});
428430
break;

0 commit comments

Comments
 (0)