CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
CAHitNtupletGeneratorOnGPU< TrackerTraits > Class Template Reference

#include <CAHitNtupletGeneratorOnGPU.h>

Public Types

using CellNeighborsVector = caStructures::CellNeighborsVectorT< TrackerTraits >
 
using CellTracksVector = caStructures::CellTracksVectorT< TrackerTraits >
 
using Counters = caHitNtupletGenerator::Counters
 
using GPUCACell = GPUCACellT< TrackerTraits >
 
using hindex_type = typename TrackingRecHitSoA< TrackerTraits >::hindex_type
 
using HitContainer = typename TrackSoA< TrackerTraits >::HitContainer
 
using HitsConstView = TrackingRecHitSoAConstView< TrackerTraits >
 
using HitsOnDevice = TrackingRecHitSoADevice< TrackerTraits >
 
using HitsOnHost = TrackingRecHitSoAHost< TrackerTraits >
 
using HitsView = TrackingRecHitSoAView< TrackerTraits >
 
using HitToTuple = caStructures::HitToTupleT< TrackerTraits >
 
using OuterHitOfCell = caStructures::OuterHitOfCellT< TrackerTraits >
 
using Params = caHitNtupletGenerator::ParamsT< TrackerTraits >
 
using Quality = pixelTrack::Quality
 
using QualityCuts = pixelTrack::QualityCutsT< TrackerTraits >
 
using TrackSoADevice = TrackSoAHeterogeneousDevice< TrackerTraits >
 
using TrackSoAHost = TrackSoAHeterogeneousHost< TrackerTraits >
 
using Tuple = HitContainer
 
using TupleMultiplicity = caStructures::TupleMultiplicityT< TrackerTraits >
 

Public Member Functions

void beginJob ()
 
 CAHitNtupletGeneratorOnGPU (const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
 
 CAHitNtupletGeneratorOnGPU (const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
 
void endJob ()
 
template<>
void fillDescriptions (edm::ParameterSetDescription &desc)
 
template<>
void fillDescriptions (edm::ParameterSetDescription &desc)
 
template<>
void fillDescriptions (edm::ParameterSetDescription &desc)
 
TrackSoAHost makeTuples (HitsOnHost const &hits_d, float bfield) const
 
TrackSoADevice makeTuplesAsync (HitsOnDevice const &hits_d, float bfield, cudaStream_t stream) const
 

Static Public Member Functions

static void fillDescriptions (edm::ParameterSetDescription &desc)
 
static void fillDescriptionsCommon (edm::ParameterSetDescription &desc)
 

Private Member Functions

void buildDoublets (const HitsConstView &hh, cudaStream_t stream) const
 
void hitNtuplets (const HitsConstView &hh, const edm::EventSetup &es, bool useRiemannFit, cudaStream_t cudaStream)
 
void launchKernels (const HitsConstView &hh, bool useRiemannFit, cudaStream_t cudaStream) const
 

Private Attributes

Countersm_counters = nullptr
 
Params m_params
 

Detailed Description

template<typename TrackerTraits>
class CAHitNtupletGeneratorOnGPU< TrackerTraits >

Definition at line 28 of file CAHitNtupletGeneratorOnGPU.h.

Member Typedef Documentation

◆ CellNeighborsVector

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::CellNeighborsVector = caStructures::CellNeighborsVectorT<TrackerTraits>

Definition at line 46 of file CAHitNtupletGeneratorOnGPU.h.

◆ CellTracksVector

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::CellTracksVector = caStructures::CellTracksVectorT<TrackerTraits>

Definition at line 47 of file CAHitNtupletGeneratorOnGPU.h.

◆ Counters

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::Counters = caHitNtupletGenerator::Counters

Definition at line 53 of file CAHitNtupletGeneratorOnGPU.h.

◆ GPUCACell

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::GPUCACell = GPUCACellT<TrackerTraits>

Definition at line 40 of file CAHitNtupletGeneratorOnGPU.h.

◆ hindex_type

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::hindex_type = typename TrackingRecHitSoA<TrackerTraits>::hindex_type

Definition at line 34 of file CAHitNtupletGeneratorOnGPU.h.

◆ HitContainer

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::HitContainer = typename TrackSoA<TrackerTraits>::HitContainer

Definition at line 43 of file CAHitNtupletGeneratorOnGPU.h.

◆ HitsConstView

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::HitsConstView = TrackingRecHitSoAConstView<TrackerTraits>

Definition at line 31 of file CAHitNtupletGeneratorOnGPU.h.

◆ HitsOnDevice

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::HitsOnDevice = TrackingRecHitSoADevice<TrackerTraits>

Definition at line 32 of file CAHitNtupletGeneratorOnGPU.h.

◆ HitsOnHost

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::HitsOnHost = TrackingRecHitSoAHost<TrackerTraits>

Definition at line 33 of file CAHitNtupletGeneratorOnGPU.h.

◆ HitsView

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::HitsView = TrackingRecHitSoAView<TrackerTraits>

Definition at line 30 of file CAHitNtupletGeneratorOnGPU.h.

◆ HitToTuple

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::HitToTuple = caStructures::HitToTupleT<TrackerTraits>

Definition at line 36 of file CAHitNtupletGeneratorOnGPU.h.

◆ OuterHitOfCell

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::OuterHitOfCell = caStructures::OuterHitOfCellT<TrackerTraits>

Definition at line 38 of file CAHitNtupletGeneratorOnGPU.h.

◆ Params

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::Params = caHitNtupletGenerator::ParamsT<TrackerTraits>

Definition at line 52 of file CAHitNtupletGeneratorOnGPU.h.

◆ Quality

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::Quality = pixelTrack::Quality

Definition at line 49 of file CAHitNtupletGeneratorOnGPU.h.

◆ QualityCuts

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::QualityCuts = pixelTrack::QualityCutsT<TrackerTraits>

Definition at line 51 of file CAHitNtupletGeneratorOnGPU.h.

◆ TrackSoADevice

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::TrackSoADevice = TrackSoAHeterogeneousDevice<TrackerTraits>

Definition at line 42 of file CAHitNtupletGeneratorOnGPU.h.

◆ TrackSoAHost

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::TrackSoAHost = TrackSoAHeterogeneousHost<TrackerTraits>

Definition at line 41 of file CAHitNtupletGeneratorOnGPU.h.

◆ Tuple

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::Tuple = HitContainer

Definition at line 44 of file CAHitNtupletGeneratorOnGPU.h.

◆ TupleMultiplicity

template<typename TrackerTraits >
using CAHitNtupletGeneratorOnGPU< TrackerTraits >::TupleMultiplicity = caStructures::TupleMultiplicityT<TrackerTraits>

Definition at line 37 of file CAHitNtupletGeneratorOnGPU.h.

Constructor & Destructor Documentation

◆ CAHitNtupletGeneratorOnGPU() [1/2]

template<typename TrackerTraits >
CAHitNtupletGeneratorOnGPU< TrackerTraits >::CAHitNtupletGeneratorOnGPU ( const edm::ParameterSet cfg,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 56 of file CAHitNtupletGeneratorOnGPU.h.

CAHitNtupletGeneratorOnGPU(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)

◆ CAHitNtupletGeneratorOnGPU() [2/2]

template<typename TrackerTraits >
CAHitNtupletGeneratorOnGPU< TrackerTraits >::CAHitNtupletGeneratorOnGPU ( const edm::ParameterSet cfg,
edm::ConsumesCollector iC 
)

Definition at line 141 of file CAHitNtupletGeneratorOnGPU.cc.

143  : m_params(makeCommonParams(cfg),
144  makeCellCuts<TrackerTraits>(cfg),
145  topologyCuts<TrackerTraits>::makeQualityCuts(cfg.getParameterSet("trackQualityCuts")),
146  topologyCuts<TrackerTraits>::makeCACuts(cfg)) {
147 #ifdef DUMP_GPU_TK_TUPLES
148  printf("TK: %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s\n",
149  "tid",
150  "qual",
151  "nh",
152  "nl",
153  "charge",
154  "pt",
155  "eta",
156  "phi",
157  "tip",
158  "zip",
159  "chi2",
160  "h1",
161  "h2",
162  "h3",
163  "h4",
164  "h5",
165  "hn");
166 #endif
167 }

Member Function Documentation

◆ beginJob()

template<typename TrackerTraits >
void CAHitNtupletGeneratorOnGPU< TrackerTraits >::beginJob ( void  )

Definition at line 299 of file CAHitNtupletGeneratorOnGPU.cc.

References ecalDigis_cff::cuda, and cudaCheck.

299  {
300  if (m_params.onGPU_) {
301  // allocate pinned host memory only if CUDA is available
303  if (cuda and cuda->enabled()) {
304  cudaCheck(cudaMalloc(&m_counters, sizeof(Counters)));
305  cudaCheck(cudaMemset(m_counters, 0, sizeof(Counters)));
306  }
307  } else {
308  m_counters = new Counters();
309  memset(m_counters, 0, sizeof(Counters));
310  }
311 }
caHitNtupletGenerator::Counters Counters
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69

◆ buildDoublets()

template<typename TrackerTraits >
void CAHitNtupletGeneratorOnGPU< TrackerTraits >::buildDoublets ( const HitsConstView hh,
cudaStream_t  stream 
) const
private

◆ endJob()

template<typename TrackerTraits >
void CAHitNtupletGeneratorOnGPU< TrackerTraits >::endJob ( void  )

Definition at line 314 of file CAHitNtupletGeneratorOnGPU.cc.

References ecalDigis_cff::cuda, CAHitNtupletGeneratorKernelsGPU< TrackerTraits >::printCounters(), and CAHitNtupletGeneratorKernelsCPU< TrackerTraits >::printCounters().

314  {
315  if (m_params.onGPU_) {
316  // print the gpu statistics and free pinned host memory only if CUDA is available
318  if (cuda and cuda->enabled()) {
319  if (m_params.doStats_) {
320  // crash on multi-gpu processes
322  }
323  cudaFree(m_counters);
324  }
325  } else {
326  if (m_params.doStats_) {
328  }
329  delete m_counters;
330  }
331 }
static void printCounters(Counters const *counters)
static void printCounters(Counters const *counters)

◆ fillDescriptions() [1/4]

template<typename TrackerTraits >
void CAHitNtupletGeneratorOnGPU< TrackerTraits >::fillDescriptions ( edm::ParameterSetDescription desc)
static

Definition at line 170 of file CAHitNtupletGeneratorOnGPU.cc.

References submitPVResolutionJobs::desc.

170  {
172  edm::LogWarning("CAHitNtupletGeneratorOnGPU::fillDescriptions")
173  << "Note: this fillDescriptions is a dummy one. Most probably you are missing some parameters. \n"
174  "please implement your TrackerTraits descriptions in CAHitNtupletGeneratorOnGPU. \n";
175 }
static void fillDescriptionsCommon(edm::ParameterSetDescription &desc)
Log< level::Warning, false > LogWarning

◆ fillDescriptions() [2/4]

template<>
void CAHitNtupletGeneratorOnGPU< pixelTopology::Phase1 >::fillDescriptions ( edm::ParameterSetDescription desc)

Definition at line 178 of file CAHitNtupletGeneratorOnGPU.cc.

References submitPVResolutionJobs::desc, phase1PixelTopology::phicuts, and HLT_2023v12_cff::trackQualityCuts.

178  {
180 
181  desc.add<bool>("idealConditions", true);
182  desc.add<bool>("includeJumpingForwardDoublets", false);
183  desc.add<double>("z0Cut", 12.0f);
184  desc.add<double>("ptCut", 0.5f);
185 
187  trackQualityCuts.add<double>("chi2MaxPt", 10.)->setComment("max pT used to determine the pT-dependent chi2 cut");
188  trackQualityCuts.add<std::vector<double>>("chi2Coeff", {0.9, 1.8})->setComment("chi2 at 1GeV and at ptMax above");
189  trackQualityCuts.add<double>("chi2Scale", 8.)
190  ->setComment(
191  "Factor to multiply the pT-dependent chi2 cut (currently: 8 for the broken line fit, ?? for the Riemann "
192  "fit)");
193  trackQualityCuts.add<double>("tripletMinPt", 0.5)->setComment("Min pT for triplets, in GeV");
194  trackQualityCuts.add<double>("tripletMaxTip", 0.3)->setComment("Max |Tip| for triplets, in cm");
195  trackQualityCuts.add<double>("tripletMaxZip", 12.)->setComment("Max |Zip| for triplets, in cm");
196  trackQualityCuts.add<double>("quadrupletMinPt", 0.3)->setComment("Min pT for quadruplets, in GeV");
197  trackQualityCuts.add<double>("quadrupletMaxTip", 0.5)->setComment("Max |Tip| for quadruplets, in cm");
198  trackQualityCuts.add<double>("quadrupletMaxZip", 12.)->setComment("Max |Zip| for quadruplets, in cm");
199 
200  desc.add<std::vector<int>>(
201  "phiCuts", std::vector<int>(std::begin(phase1PixelTopology::phicuts), std::end(phase1PixelTopology::phicuts)))
202  ->setComment("Cuts in phi for cells");
203 
204  desc.add<edm::ParameterSetDescription>("trackQualityCuts", trackQualityCuts)
205  ->setComment(
206  "Quality cuts based on the results of the track fit:\n - apply a pT-dependent chi2 cut;\n - apply \"region "
207  "cuts\" based on the fit results (pT, Tip, Zip).");
208 }
static void fillDescriptionsCommon(edm::ParameterSetDescription &desc)
constexpr int16_t phicuts[nPairs]

◆ fillDescriptions() [3/4]

template<>
void CAHitNtupletGeneratorOnGPU< pixelTopology::HIonPhase1 >::fillDescriptions ( edm::ParameterSetDescription desc)

Definition at line 211 of file CAHitNtupletGeneratorOnGPU.cc.

References submitPVResolutionJobs::desc, phase1PixelTopology::phicuts, and HLT_2023v12_cff::trackQualityCuts.

211  {
213 
214  desc.add<bool>("idealConditions", false);
215  desc.add<bool>("includeJumpingForwardDoublets", false);
216  desc.add<double>("z0Cut", 10.0f);
217  desc.add<double>("ptCut", 0.0f);
218 
220  trackQualityCuts.add<double>("chi2MaxPt", 10.)->setComment("max pT used to determine the pT-dependent chi2 cut");
221  trackQualityCuts.add<std::vector<double>>("chi2Coeff", {0.9, 1.8})->setComment("chi2 at 1GeV and at ptMax above");
222  trackQualityCuts.add<double>("chi2Scale", 8.)
223  ->setComment(
224  "Factor to multiply the pT-dependent chi2 cut (currently: 8 for the broken line fit, ?? for the Riemann "
225  "fit)");
226  trackQualityCuts.add<double>("tripletMinPt", 0.0)->setComment("Min pT for triplets, in GeV");
227  trackQualityCuts.add<double>("tripletMaxTip", 0.1)->setComment("Max |Tip| for triplets, in cm");
228  trackQualityCuts.add<double>("tripletMaxZip", 6.)->setComment("Max |Zip| for triplets, in cm");
229  trackQualityCuts.add<double>("quadrupletMinPt", 0.0)->setComment("Min pT for quadruplets, in GeV");
230  trackQualityCuts.add<double>("quadrupletMaxTip", 0.5)->setComment("Max |Tip| for quadruplets, in cm");
231  trackQualityCuts.add<double>("quadrupletMaxZip", 6.)->setComment("Max |Zip| for quadruplets, in cm");
232 
233  desc.add<std::vector<int>>(
234  "phiCuts", std::vector<int>(std::begin(phase1PixelTopology::phicuts), std::end(phase1PixelTopology::phicuts)))
235  ->setComment("Cuts in phi for cells");
236 
237  desc.add<edm::ParameterSetDescription>("trackQualityCuts", trackQualityCuts)
238  ->setComment(
239  "Quality cuts based on the results of the track fit:\n - apply a pT-dependent chi2 cut;\n - apply \"region "
240  "cuts\" based on the fit results (pT, Tip, Zip).");
241 }
static void fillDescriptionsCommon(edm::ParameterSetDescription &desc)
constexpr int16_t phicuts[nPairs]

◆ fillDescriptions() [4/4]

template<>
void CAHitNtupletGeneratorOnGPU< pixelTopology::Phase2 >::fillDescriptions ( edm::ParameterSetDescription desc)

Definition at line 244 of file CAHitNtupletGeneratorOnGPU.cc.

References submitPVResolutionJobs::desc, phase2PixelTopology::phicuts, and HLT_2023v12_cff::trackQualityCuts.

244  {
246 
247  desc.add<bool>("idealConditions", false);
248  desc.add<bool>("includeFarForwards", true);
249  desc.add<bool>("includeJumpingForwardDoublets", true);
250  desc.add<double>("z0Cut", 7.5f);
251  desc.add<double>("ptCut", 0.85f);
252 
254  trackQualityCuts.add<double>("maxChi2", 5.)->setComment("Max normalized chi2");
255  trackQualityCuts.add<double>("minPt", 0.5)->setComment("Min pT in GeV");
256  trackQualityCuts.add<double>("maxTip", 0.3)->setComment("Max |Tip| in cm");
257  trackQualityCuts.add<double>("maxZip", 12.)->setComment("Max |Zip|, in cm");
258 
259  desc.add<std::vector<int>>(
260  "phiCuts", std::vector<int>(std::begin(phase2PixelTopology::phicuts), std::end(phase2PixelTopology::phicuts)))
261  ->setComment("Cuts in phi for cells");
262 
263  desc.add<edm::ParameterSetDescription>("trackQualityCuts", trackQualityCuts)
264  ->setComment(
265  "Quality cuts based on the results of the track fit:\n - apply cuts based on the fit results (pT, Tip, "
266  "Zip).");
267 }
static void fillDescriptionsCommon(edm::ParameterSetDescription &desc)
constexpr int16_t phicuts[nPairs]

◆ fillDescriptionsCommon()

template<typename TrackerTraits >
void CAHitNtupletGeneratorOnGPU< TrackerTraits >::fillDescriptionsCommon ( edm::ParameterSetDescription desc)
static

Definition at line 270 of file CAHitNtupletGeneratorOnGPU.cc.

References submitPVResolutionJobs::desc, and HLT_2023v12_cff::maxNumberOfDoublets.

270  {
271  // 87 cm/GeV = 1/(3.8T * 0.3)
272  // take less than radius given by the hardPtCut and reject everything below
273  // auto hardCurvCut = 1.f/(0.35 * 87.f);
274  desc.add<double>("ptmin", 0.9f)->setComment("Cut on minimum pt");
275  desc.add<double>("CAThetaCutBarrel", 0.002f)->setComment("Cut on RZ alignement for Barrel");
276  desc.add<double>("CAThetaCutForward", 0.003f)->setComment("Cut on RZ alignment for Forward");
277  desc.add<double>("hardCurvCut", 1.f / (0.35 * 87.f))->setComment("Cut on minimum curvature");
278  desc.add<double>("dcaCutInnerTriplet", 0.15f)->setComment("Cut on origin radius when the inner hit is on BPix1");
279  desc.add<double>("dcaCutOuterTriplet", 0.25f)->setComment("Cut on origin radius when the outer hit is on BPix1");
280  desc.add<bool>("earlyFishbone", true);
281  desc.add<bool>("lateFishbone", false);
282  desc.add<bool>("fillStatistics", false);
283  desc.add<unsigned int>("minHitsPerNtuplet", 4);
284  desc.add<unsigned int>("maxNumberOfDoublets", TrackerTraits::maxNumberOfDoublets);
285  desc.add<unsigned int>("minHitsForSharingCut", 10)
286  ->setComment("Maximum number of hits in a tuple to clean also if the shared hit is on bpx1");
287 
288  desc.add<bool>("fitNas4", false)->setComment("fit only 4 hits out of N");
289  desc.add<bool>("doClusterCut", true);
290  desc.add<bool>("doZ0Cut", true);
291  desc.add<bool>("doPtCut", true);
292  desc.add<bool>("useRiemannFit", false)->setComment("true for Riemann, false for BrokenLine");
293  desc.add<bool>("doSharedHitCut", true)->setComment("Sharing hit nTuples cleaning");
294  desc.add<bool>("dupPassThrough", false)->setComment("Do not reject duplicate");
295  desc.add<bool>("useSimpleTripletCleaner", true)->setComment("use alternate implementation");
296 }

◆ hitNtuplets()

template<typename TrackerTraits >
void CAHitNtupletGeneratorOnGPU< TrackerTraits >::hitNtuplets ( const HitsConstView hh,
const edm::EventSetup es,
bool  useRiemannFit,
cudaStream_t  cudaStream 
)
private

◆ launchKernels()

template<typename TrackerTraits >
void CAHitNtupletGeneratorOnGPU< TrackerTraits >::launchKernels ( const HitsConstView hh,
bool  useRiemannFit,
cudaStream_t  cudaStream 
) const
private

◆ makeTuples()

template<typename TrackerTraits >
TrackSoAHeterogeneousHost< TrackerTraits > CAHitNtupletGeneratorOnGPU< TrackerTraits >::makeTuples ( HitsOnHost const &  hits_d,
float  bfield 
) const

Definition at line 368 of file CAHitNtupletGeneratorOnGPU.cc.

References HelixFitOnGPU< TrackerTraits >::allocateOnGPU(), cms::cuda::assert(), gather_cfg::cout, HelixFitOnGPU< TrackerTraits >::launchBrokenLineKernelsOnCPU(), HelixFitOnGPU< TrackerTraits >::launchRiemannKernelsOnCPU(), DMR_cfg::maxTracks, TrackingRecHitSoAHost< TrackerTraits >::nHits(), beamSpotPI::nTracks, TrackingRecHitSoAHost< TrackerTraits >::offsetBPIX2(), pwdgSkimBPark_cfi::tracks, and cms::cuda::PortableHostCollection< T >::view().

369  {
373 
375 
376  CPUKernels kernels(m_params);
377  kernels.setCounters(m_counters);
378  kernels.allocateOnGPU(hits_h.nHits(), nullptr);
379 
380  kernels.buildDoublets(hits_h.view(), hits_h.offsetBPIX2(), nullptr);
381  kernels.launchKernels(hits_h.view(), tracks.view(), nullptr);
382 
383  if (0 == hits_h.nHits())
384  return tracks;
385 
386  // now fit
387  HelixFitOnGPU fitter(bfield, m_params.fitNas4_);
388  fitter.allocateOnGPU(kernels.tupleMultiplicity(), tracks.view());
389 
390  if (m_params.useRiemannFit_) {
391  fitter.launchRiemannKernelsOnCPU(hits_h.view(), hits_h.nHits(), TrackerTraits::maxNumberOfQuadruplets);
392  } else {
393  fitter.launchBrokenLineKernelsOnCPU(hits_h.view(), hits_h.nHits(), TrackerTraits::maxNumberOfQuadruplets);
394  }
395 
396  kernels.classifyTuples(hits_h.view(), tracks.view(), nullptr);
397 
398 #ifdef GPU_DEBUG
399  std::cout << "finished building pixel tracks on CPU" << std::endl;
400 #endif
401 
402  // check that the fixed-size SoA does not overflow
403  auto maxTracks = tracks.view().metadata().size();
404  auto nTracks = tracks.view().nTracks();
406  if (nTracks == maxTracks - 1) {
407  edm::LogWarning("PixelTracks") << "Unsorted reconstructed pixel tracks truncated to " << maxTracks - 1
408  << " candidates";
409  }
410 
411  return tracks;
412 }
assert(be >=bs)
maxTracks
Definition: DMR_cfg.py:158
Log< level::Warning, false > LogWarning

◆ makeTuplesAsync()

template<typename TrackerTraits >
TrackSoAHeterogeneousDevice< TrackerTraits > CAHitNtupletGeneratorOnGPU< TrackerTraits >::makeTuplesAsync ( HitsOnDevice const &  hits_d,
float  bfield,
cudaStream_t  stream 
) const

Definition at line 334 of file CAHitNtupletGeneratorOnGPU.cc.

References HelixFitOnGPU< TrackerTraits >::allocateOnGPU(), gather_cfg::cout, cudaCheck, HelixFitOnGPU< TrackerTraits >::launchBrokenLineKernels(), HelixFitOnGPU< TrackerTraits >::launchRiemannKernels(), TrackingRecHitSoADevice< TrackerTraits >::nHits(), TrackingRecHitSoADevice< TrackerTraits >::offsetBPIX2(), cms::cuda::stream, pwdgSkimBPark_cfi::tracks, and cms::cuda::PortableDeviceCollection< T >::view().

335  {
339 
341 
342  GPUKernels kernels(m_params);
343  kernels.setCounters(m_counters);
344  kernels.allocateOnGPU(hits_d.nHits(), stream);
345 
346  kernels.buildDoublets(hits_d.view(), hits_d.offsetBPIX2(), stream);
347 
348  kernels.launchKernels(hits_d.view(), tracks.view(), stream);
349 
350  HelixFitOnGPU fitter(bfield, m_params.fitNas4_);
351  fitter.allocateOnGPU(kernels.tupleMultiplicity(), tracks.view());
352  if (m_params.useRiemannFit_) {
353  fitter.launchRiemannKernels(hits_d.view(), hits_d.nHits(), TrackerTraits::maxNumberOfQuadruplets, stream);
354  } else {
355  fitter.launchBrokenLineKernels(hits_d.view(), hits_d.nHits(), TrackerTraits::maxNumberOfQuadruplets, stream);
356  }
357  kernels.classifyTuples(hits_d.view(), tracks.view(), stream);
358 #ifdef GPU_DEBUG
359  cudaDeviceSynchronize();
360  cudaCheck(cudaGetLastError());
361  std::cout << "finished building pixel tracks on GPU" << std::endl;
362 #endif
363 
364  return tracks;
365 }
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69

Member Data Documentation

◆ m_counters

template<typename TrackerTraits >
Counters* CAHitNtupletGeneratorOnGPU< TrackerTraits >::m_counters = nullptr
private

Definition at line 79 of file CAHitNtupletGeneratorOnGPU.h.

◆ m_params

template<typename TrackerTraits >
Params CAHitNtupletGeneratorOnGPU< TrackerTraits >::m_params
private

Definition at line 77 of file CAHitNtupletGeneratorOnGPU.h.