Skip to content

Commit

Permalink
fix blocksize to be larger than maxpix/maxiter
Browse files Browse the repository at this point in the history
  • Loading branch information
VinInn committed Oct 25, 2021
1 parent 3268720 commit 58fd079
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Expand Up @@ -618,7 +618,7 @@ namespace pixelgpudetails {
digis_d.moduleInd(), clusters_d.moduleStart(), digis_d.clus(), wordCounter);
cudaCheck(cudaGetLastError());

threadsPerBlock = 256;
threadsPerBlock = 256 + 128; /// should be larger than 6000/16 aka (maxPixInModule/maxiter in the kernel)
blocks = maxNumModules;
#ifdef GPU_DEBUG
std::cout << "CUDA findClus kernel launch with " << blocks << " blocks of " << threadsPerBlock << " threads\n";
Expand Down
5 changes: 5 additions & 0 deletions RecoLocalTracker/SiPixelClusterizer/plugins/gpuClustering.h
Expand Up @@ -135,6 +135,11 @@ namespace gpuClustering {
#ifdef __CUDA_ARCH__
// assume that we can cover the whole module with up to 16 blockDim.x-wide iterations
constexpr int maxiter = 16;
if (threadIdx.x == 0 && (hist.size() / blockDim.x) >= maxiter)
printf("THIS IS NOT SUPPOSED TO HAPPEN too many hits in module %d: %d for block size %d\n",
thisModuleId,
hist.size(),
blockDim.x);
#else
auto maxiter = hist.size();
#endif
Expand Down

0 comments on commit 58fd079

Please sign in to comment.