diff --git a/RecoLocalTracker/SiPixelRecHits/plugins/PixelRecHits.cu b/RecoLocalTracker/SiPixelRecHits/plugins/PixelRecHits.cu index de862871548ee..1342ab916e472 100644 --- a/RecoLocalTracker/SiPixelRecHits/plugins/PixelRecHits.cu +++ b/RecoLocalTracker/SiPixelRecHits/plugins/PixelRecHits.cu @@ -6,7 +6,6 @@ #include // CMSSW headers -#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "HeterogeneousCore/CUDAUtilities/interface/cudaCheck.h" #include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h" #include "RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelRawToClusterGPUKernel.h" @@ -63,11 +62,6 @@ namespace pixelgpudetails { cudaCheck(cudaGetLastError()); } - if (nHits >= TrackingRecHit2DSOAView::maxHits()) { - edm::LogWarning("PixelRecHitGPUKernel") - << "Hits Overflow " << nHits << " > " << TrackingRecHit2DSOAView::maxHits(); - } - if (nHits) { auto hws = cudautils::make_device_unique(TrackingRecHit2DSOAView::Hist::wsSize(), stream); cudautils::fillManyFromVector( diff --git a/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitCUDA.cc b/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitCUDA.cc index 2ec203819731b..1641719d0537d 100644 --- a/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitCUDA.cc +++ b/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitCUDA.cc @@ -96,6 +96,12 @@ void SiPixelRecHitCUDA::produce(edm::StreamID streamID, edm::Event& iEvent, cons iEvent.getByToken(tBeamSpot, hbs); auto const& bs = ctx.get(*hbs); + auto nHits = clusters.nClusters(); + if (nHits >= TrackingRecHit2DSOAView::maxHits()) { + edm::LogWarning("PixelRecHitGPUKernel") + << "Clusters/Hits Overflow " << nHits << " >= " << TrackingRecHit2DSOAView::maxHits(); + } + ctx.emplace(iEvent, tokenHit_, gpuAlgo_.makeHitsAsync(digis, clusters, bs, fcpe->getGPUProductAsync(ctx.stream()), ctx.stream()));