CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 #ifdef BROKENLINE_DEBUG
7  setlinebuf(stdout);
8 #endif
9 
10  // Fit internals
11  auto tkidGPU = std::make_unique<caConstants::tindex_type[]>(maxNumberOfConcurrentFits_);
12  auto hitsGPU =
13  std::make_unique<double[]>(maxNumberOfConcurrentFits_ * sizeof(riemannFit::Matrix3xNd<6>) / sizeof(double));
14  auto hits_geGPU =
15  std::make_unique<float[]>(maxNumberOfConcurrentFits_ * sizeof(riemannFit::Matrix6xNf<6>) / sizeof(float));
16  auto fast_fit_resultsGPU =
17  std::make_unique<double[]>(maxNumberOfConcurrentFits_ * sizeof(riemannFit::Vector4d) / sizeof(double));
18 
20  // fit triplets
21  kernel_BLFastFit<3>(tuples_,
23  hv,
24  tkidGPU.get(),
25  hitsGPU.get(),
26  hits_geGPU.get(),
27  fast_fit_resultsGPU.get(),
28  3,
29  3,
30  offset);
31 
32  kernel_BLFit<3>(tupleMultiplicity_,
33  bField_,
34  outputSoa_,
35  tkidGPU.get(),
36  hitsGPU.get(),
37  hits_geGPU.get(),
38  fast_fit_resultsGPU.get());
39 
40  if (fitNas4_) {
41  // fit all as 4
42  kernel_BLFastFit<4>(tuples_,
44  hv,
45  tkidGPU.get(),
46  hitsGPU.get(),
47  hits_geGPU.get(),
48  fast_fit_resultsGPU.get(),
49  4,
50  8,
51  offset);
52 
53  kernel_BLFit<4>(tupleMultiplicity_,
54  bField_,
55  outputSoa_,
56  tkidGPU.get(),
57  hitsGPU.get(),
58  hits_geGPU.get(),
59  fast_fit_resultsGPU.get());
60  } else {
61  // fit quads
62  kernel_BLFastFit<4>(tuples_,
64  hv,
65  tkidGPU.get(),
66  hitsGPU.get(),
67  hits_geGPU.get(),
68  fast_fit_resultsGPU.get(),
69  4,
70  4,
71  offset);
72 
73  kernel_BLFit<4>(tupleMultiplicity_,
74  bField_,
75  outputSoa_,
76  tkidGPU.get(),
77  hitsGPU.get(),
78  hits_geGPU.get(),
79  fast_fit_resultsGPU.get());
80  // fit penta (all 5)
81  kernel_BLFastFit<5>(tuples_,
83  hv,
84  tkidGPU.get(),
85  hitsGPU.get(),
86  hits_geGPU.get(),
87  fast_fit_resultsGPU.get(),
88  5,
89  5,
90  offset);
91 
92  kernel_BLFit<5>(tupleMultiplicity_,
93  bField_,
94  outputSoa_,
95  tkidGPU.get(),
96  hitsGPU.get(),
97  hits_geGPU.get(),
98  fast_fit_resultsGPU.get());
99  // fit sexta and above (as 6)
100  kernel_BLFastFit<6>(tuples_,
102  hv,
103  tkidGPU.get(),
104  hitsGPU.get(),
105  hits_geGPU.get(),
106  fast_fit_resultsGPU.get(),
107  6,
108  8,
109  offset);
110 
111  kernel_BLFit<6>(tupleMultiplicity_,
112  bField_,
113  outputSoa_,
114  tkidGPU.get(),
115  hitsGPU.get(),
116  hits_geGPU.get(),
117  fast_fit_resultsGPU.get());
118  }
119 
120  } // loop on concurrent fits
121 }
void launchBrokenLineKernelsOnCPU(HitsView const *hv, uint32_t nhits, uint32_t maxNumberOfTuples)
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, N > Matrix6xNf
Definition: HelixFitOnGPU.h:26
constexpr uint32_t maxNumberOfTuples
Definition: CAConstants.h:36
Eigen::Matrix< double, 3, N > Matrix3xNd
Definition: FitResult.h:24
OutputSoA * outputSoa_
Definition: HelixFitOnGPU.h:62
Tuples const * tuples_
Definition: HelixFitOnGPU.h:60
Eigen::Vector4d Vector4d
Definition: FitResult.h:15