Skip to content

Commit

Permalink
Merge pull request #34684 from mmusich/fix_CAHitNtupletGeneratorOnGPU…
Browse files Browse the repository at this point in the history
…_in_case_of_no_hits

fix CAHitNtupletGeneratorOnGPU in case of no hits
  • Loading branch information
cmsbuild authored Jul 29, 2021
2 parents e09e497 + fd06060 commit 2ec3d40
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ PixelTrackHeterogeneous CAHitNtupletGeneratorOnGPU::makeTuplesAsync(TrackingRecH
float bfield,
cudaStream_t stream) const {
PixelTrackHeterogeneous tracks(cms::cuda::make_device_unique<pixelTrack::TrackSoA>(stream));


if (0 == hits_d.nHits())
return tracks;

auto* soa = tracks.get();

CAHitNtupletGeneratorKernelsGPU kernels(m_params);
Expand All @@ -204,6 +207,9 @@ PixelTrackHeterogeneous CAHitNtupletGeneratorOnGPU::makeTuplesAsync(TrackingRecH
PixelTrackHeterogeneous CAHitNtupletGeneratorOnGPU::makeTuples(TrackingRecHit2DCPU const& hits_d, float bfield) const {
PixelTrackHeterogeneous tracks(std::make_unique<pixelTrack::TrackSoA>());

if (0 == hits_d.nHits())
return tracks;

auto* soa = tracks.get();
assert(soa);

Expand All @@ -215,9 +221,6 @@ PixelTrackHeterogeneous CAHitNtupletGeneratorOnGPU::makeTuples(TrackingRecHit2DC
kernels.launchKernels(hits_d, soa, nullptr);
kernels.fillHitDetIndices(hits_d.view(), soa, nullptr); // in principle needed only if Hits not "available"

if (0 == hits_d.nHits())
return tracks;

// now fit
HelixFitOnGPU fitter(bfield, m_params.fit5as4_);
fitter.allocateOnGPU(&(soa->hitIndices), kernels.tupleMultiplicity(), soa);
Expand Down

0 comments on commit 2ec3d40

Please sign in to comment.