Skip to content

Commit

Permalink
Merge pull request #38159 from AdrianoDee/125_fix_nhits
Browse files Browse the repository at this point in the history
Safeguard for nHits==0
  • Loading branch information
cmsbuild committed Jun 3, 2022
2 parents b54d06d + 1c0bd20 commit 73f4e4c
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -82,7 +82,9 @@ void SiPixelRecHitSoAFromCUDA::acquire(edm::Event const& iEvent,

void SiPixelRecHitSoAFromCUDA::produce(edm::Event& iEvent, edm::EventSetup const& es) {
auto hmsp = std::make_unique<uint32_t[]>(nMaxModules_ + 1);
std::copy(hitsModuleStart_.get(), hitsModuleStart_.get() + nMaxModules_ + 1, hmsp.get());

if (nHits_ > 0)
std::copy(hitsModuleStart_.get(), hitsModuleStart_.get() + nMaxModules_ + 1, hmsp.get());

iEvent.emplace(hostPutToken_, std::move(hmsp));
iEvent.emplace(hitsPutTokenCPU_, store32_.get(), store16_.get(), hitsModuleStart_.get(), nHits_);
Expand Down

0 comments on commit 73f4e4c

Please sign in to comment.