CMS 3D CMS Logo

TrackingRecHitsHost.h
Go to the documentation of this file.
1 #ifndef DataFormats_TrackingRecHitSoA_interface_TrackingRecHitsHost_h
2 #define DataFormats_TrackingRecHitSoA_interface_TrackingRecHitsHost_h
3 
4 #include <cstdint>
5 
6 #include <alpaka/alpaka.hpp>
7 
11 
12 template <typename TrackerTraits>
13 class TrackingRecHitHost : public PortableHostCollection<TrackingRecHitLayout<TrackerTraits>> {
14 public:
16 
17  // Need to decorate the class with the inherited portable accessors being now a template
21 
22  TrackingRecHitHost() = default;
23 
24  // Constructor which specifies only the SoA size, to be used when copying the results from the device to the host
25  template <typename TQueue>
26  explicit TrackingRecHitHost(TQueue queue, uint32_t nHits)
28 
29  // Constructor which specifies the SoA size, number of BPIX1 hits, and the modules entry points
30  template <typename TQueue>
31  explicit TrackingRecHitHost(TQueue queue, uint32_t nHits, int32_t offsetBPIX2, uint32_t const* hitsModuleStart)
34  view().offsetBPIX2() = offsetBPIX2;
35  }
36 
37  uint32_t nHits() const { return view().metadata().size(); }
38 
39  int32_t offsetBPIX2() const { return view().offsetBPIX2(); }
40 
41  uint32_t const* hitsModuleStart() const { return view().hitsModuleStart().data(); }
42 
43  // do nothing for a host collection
44  template <typename TQueue>
45  void updateFromDevice(TQueue) {}
46 };
47 
51 
52 #endif // DataFormats_TrackingRecHitSoA_interface_TrackingRecHitsHost_h
uint32_t nHits() const
typename TrackingRecHitSoA< TrackerTraits >::template TrackingRecHitSoALayout<> TrackingRecHitLayout
constexpr uint16_t numberOfModules
void updateFromDevice(TQueue)
TrackingRecHitHost(TQueue queue, uint32_t nHits)
TrackingRecHitHost()=default
TrackingRecHitHost(TQueue queue, uint32_t nHits, int32_t offsetBPIX2, uint32_t const *hitsModuleStart)
uint32_t const * hitsModuleStart() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
int32_t offsetBPIX2() const