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 (fitNas4_) {
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 }
const bool fitNas4_
Definition: HelixFitOnGPU.h:65
static constexpr uint32_t maxNumberOfConcurrentFits_
Definition: HelixFitOnGPU.h:57
TupleMultiplicity const * tupleMultiplicity_
Definition: HelixFitOnGPU.h:61
assert(be >=bs)
Eigen::Matrix< float, 6, 4 > Matrix6x4f
Definition: HelixFitOnGPU.h:16
constexpr uint32_t maxNumberOfTuples
Definition: CAConstants.h:36
Eigen::Matrix< double, 3, N > Matrix3xNd
Definition: FitResult.h:24
OutputSoA * outputSoa_
Definition: HelixFitOnGPU.h:62
void launchRiemannKernelsOnCPU(HitsView const *hv, uint32_t nhits, uint32_t maxNumberOfTuples)
Tuples const * tuples_
Definition: HelixFitOnGPU.h:60
Eigen::Vector4d Vector4d
Definition: FitResult.h:15