CMS 3D CMS Logo

RiemannFitOnGPU.cc
Go to the documentation of this file.
1 #include "RiemannFitOnGPU.h"
2 
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  auto circle_fit_resultsGPU_holder =
14  std::make_unique<char[]>(maxNumberOfConcurrentFits_ * sizeof(riemannFit::CircleFit));
15  riemannFit::CircleFit *circle_fit_resultsGPU = (riemannFit::CircleFit *)(circle_fit_resultsGPU_holder.get());
16 
18  // triplets
19  kernel_FastFit<3>(
20  tuples_, tupleMultiplicity_, 3, hv, hitsGPU.get(), hits_geGPU.get(), fast_fit_resultsGPU.get(), offset);
21 
22  kernel_CircleFit<3>(tupleMultiplicity_,
23  3,
24  bField_,
25  hitsGPU.get(),
26  hits_geGPU.get(),
27  fast_fit_resultsGPU.get(),
28  circle_fit_resultsGPU,
29  offset);
30 
31  kernel_LineFit<3>(tupleMultiplicity_,
32  3,
33  bField_,
34  outputSoa_,
35  hitsGPU.get(),
36  hits_geGPU.get(),
37  fast_fit_resultsGPU.get(),
38  circle_fit_resultsGPU,
39  offset);
40 
41  // quads
42  kernel_FastFit<4>(
43  tuples_, tupleMultiplicity_, 4, hv, hitsGPU.get(), hits_geGPU.get(), fast_fit_resultsGPU.get(), offset);
44 
45  kernel_CircleFit<4>(tupleMultiplicity_,
46  4,
47  bField_,
48  hitsGPU.get(),
49  hits_geGPU.get(),
50  fast_fit_resultsGPU.get(),
51  circle_fit_resultsGPU,
52  offset);
53 
54  kernel_LineFit<4>(tupleMultiplicity_,
55  4,
56  bField_,
57  outputSoa_,
58  hitsGPU.get(),
59  hits_geGPU.get(),
60  fast_fit_resultsGPU.get(),
61  circle_fit_resultsGPU,
62  offset);
63 
64  if (fit5as4_) {
65  // penta
66  kernel_FastFit<4>(
67  tuples_, tupleMultiplicity_, 5, hv, hitsGPU.get(), hits_geGPU.get(), fast_fit_resultsGPU.get(), offset);
68 
69  kernel_CircleFit<4>(tupleMultiplicity_,
70  5,
71  bField_,
72  hitsGPU.get(),
73  hits_geGPU.get(),
74  fast_fit_resultsGPU.get(),
75  circle_fit_resultsGPU,
76  offset);
77 
78  kernel_LineFit<4>(tupleMultiplicity_,
79  5,
80  bField_,
81  outputSoa_,
82  hitsGPU.get(),
83  hits_geGPU.get(),
84  fast_fit_resultsGPU.get(),
85  circle_fit_resultsGPU,
86  offset);
87 
88  } else {
89  // penta all 5
90  kernel_FastFit<5>(
91  tuples_, tupleMultiplicity_, 5, hv, hitsGPU.get(), hits_geGPU.get(), fast_fit_resultsGPU.get(), offset);
92 
93  kernel_CircleFit<5>(tupleMultiplicity_,
94  5,
95  bField_,
96  hitsGPU.get(),
97  hits_geGPU.get(),
98  fast_fit_resultsGPU.get(),
99  circle_fit_resultsGPU,
100  offset);
101 
102  kernel_LineFit<5>(tupleMultiplicity_,
103  5,
104  bField_,
105  outputSoa_,
106  hitsGPU.get(),
107  hits_geGPU.get(),
108  fast_fit_resultsGPU.get(),
109  circle_fit_resultsGPU,
110  offset);
111  }
112  }
113 }
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
RiemannFitOnGPU.h
HelixFitOnGPU::launchRiemannKernelsOnCPU
void launchRiemannKernelsOnCPU(HitsView const *hv, uint32_t nhits, uint32_t maxNumberOfTuples)
Definition: RiemannFitOnGPU.cc:3
riemannFit::CircleFit
Definition: FitResult.h:26
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
nhits
Definition: HIMultiTrackSelector.h:42
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
HelixFitOnGPU::bField_
float bField_
Definition: HelixFitOnGPU.h:63
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