CMS 3D CMS Logo

BrokenLineFitOnGPU.cc
Go to the documentation of this file.
1 #include "BrokenLineFitOnGPU.h"
2 
3 void HelixFitOnGPU::launchBrokenLineKernelsOnCPU(HitsView const* hv, uint32_t hitsInFit, uint32_t maxNumberOfTuples) {
5 
6  // Fit internals
7  auto hitsGPU_ =
8  std::make_unique<double[]>(maxNumberOfConcurrentFits_ * sizeof(riemannFit::Matrix3xNd<4>) / sizeof(double));
9  auto hits_geGPU_ =
10  std::make_unique<float[]>(maxNumberOfConcurrentFits_ * sizeof(riemannFit::Matrix6x4f) / sizeof(float));
11  auto fast_fit_resultsGPU_ =
12  std::make_unique<double[]>(maxNumberOfConcurrentFits_ * sizeof(riemannFit::Vector4d) / sizeof(double));
13 
15  // fit triplets
16  kernel_BLFastFit<3>(
17  tuples_, tupleMultiplicity_, hv, hitsGPU_.get(), hits_geGPU_.get(), fast_fit_resultsGPU_.get(), 3, offset);
18 
19  kernel_BLFit<3>(tupleMultiplicity_,
20  bField_,
21  outputSoa_,
22  hitsGPU_.get(),
23  hits_geGPU_.get(),
24  fast_fit_resultsGPU_.get(),
25  3,
26  offset);
27 
28  // fit quads
29  kernel_BLFastFit<4>(
30  tuples_, tupleMultiplicity_, hv, hitsGPU_.get(), hits_geGPU_.get(), fast_fit_resultsGPU_.get(), 4, offset);
31 
32  kernel_BLFit<4>(tupleMultiplicity_,
33  bField_,
34  outputSoa_,
35  hitsGPU_.get(),
36  hits_geGPU_.get(),
37  fast_fit_resultsGPU_.get(),
38  4,
39  offset);
40 
41  if (fit5as4_) {
42  // fit penta (only first 4)
43  kernel_BLFastFit<4>(
44  tuples_, tupleMultiplicity_, hv, hitsGPU_.get(), hits_geGPU_.get(), fast_fit_resultsGPU_.get(), 5, offset);
45 
46  kernel_BLFit<4>(tupleMultiplicity_,
47  bField_,
48  outputSoa_,
49  hitsGPU_.get(),
50  hits_geGPU_.get(),
51  fast_fit_resultsGPU_.get(),
52  5,
53  offset);
54  } else {
55  // fit penta (all 5)
56  kernel_BLFastFit<5>(
57  tuples_, tupleMultiplicity_, hv, hitsGPU_.get(), hits_geGPU_.get(), fast_fit_resultsGPU_.get(), 5, offset);
58 
59  kernel_BLFit<5>(tupleMultiplicity_,
60  bField_,
61  outputSoa_,
62  hitsGPU_.get(),
63  hits_geGPU_.get(),
64  fast_fit_resultsGPU_.get(),
65  5,
66  offset);
67  }
68 
69  } // loop on concurrent fits
70 }
riemannFit::Vector4d
Eigen::Vector4d Vector4d
Definition: FitResult.h:15
HelixFitOnGPU::tuples_
const Tuples * tuples_
Definition: HelixFitOnGPU.h:60
cms::cuda::assert
assert(be >=bs)
TrackingRecHit2DSOAView
Definition: TrackingRecHit2DSOAView.h:15
caConstants::maxNumberOfTuples
constexpr uint32_t maxNumberOfTuples
Definition: CAConstants.h:35
HelixFitOnGPU::tupleMultiplicity_
const TupleMultiplicity * tupleMultiplicity_
Definition: HelixFitOnGPU.h:61
HelixFitOnGPU::outputSoa_
OutputSoA * outputSoa_
Definition: HelixFitOnGPU.h:62
riemannFit::Matrix6x4f
Eigen::Matrix< float, 6, 4 > Matrix6x4f
Definition: HelixFitOnGPU.h:16
riemannFit::Matrix3xNd
Eigen::Matrix< double, 3, N > Matrix3xNd
Definition: FitResult.h:24
HelixFitOnGPU::fit5as4_
const bool fit5as4_
Definition: HelixFitOnGPU.h:65
BrokenLineFitOnGPU.h
HelixFitOnGPU::bField_
float bField_
Definition: HelixFitOnGPU.h:63
HelixFitOnGPU::launchBrokenLineKernelsOnCPU
void launchBrokenLineKernelsOnCPU(HitsView const *hv, uint32_t nhits, uint32_t maxNumberOfTuples)
Definition: BrokenLineFitOnGPU.cc:3
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
HelixFitOnGPU::maxNumberOfConcurrentFits_
static constexpr uint32_t maxNumberOfConcurrentFits_
Definition: HelixFitOnGPU.h:57