Skip to content

Commit

Permalink
Merge pull request #38160 from AdrianoDee/123_fix_nhits
Browse files Browse the repository at this point in the history
[12_3_X] Safeguard for nHits==0
  • Loading branch information
cmsbuild authored Jun 3, 2022
2 parents d00fd8a + 4675804 commit 85ba45e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
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 85ba45e

Please sign in to comment.