CMS 3D CMS Logo

HeterogeneousHGCalHEBConditions.h
Go to the documentation of this file.
1 #ifndef HeterogeneousHGCalHEBConditions_h
2 #define HeterogeneousHGCalHEBConditions_h
3 
4 #include <numeric> //accumulate
5 #include <typeinfo>
6 
14 
16 
17 // Declare the wrapper ESProduct. The corresponding ESProducer should
18 // produce objects of this type.
20 public:
21  // Constructor takes the standard CPU ESProduct, and transforms the
22  // necessary data to array(s) in pinned host memory
24 
25  // Deallocates all pinned host memory
27 
28  // Function to return the actual payload on the memory of the current device
30  cudaStream_t stream) const;
31 
32 private:
33  // Holds the data in pinned CPU memory
34  // Contrary to its non-heterogeneous counterpart (constructor argument) it is *not* a pointer (so to avoid an extra allocation)
36 
37  std::vector<size_t> sizes_;
38  size_t chunk_;
39 
41  double *&select_pointer_d(cp::HeterogeneousHGCalHEBParameters *, const unsigned int &) const;
42  std::vector<double> select_pointer_d(const HGCalParameters *, const unsigned int &) const;
43  int32_t *&select_pointer_i(cp::HeterogeneousHGCalHEBParameters *, const unsigned int &) const;
44  std::vector<int32_t> select_pointer_i(const HGCalParameters *, const unsigned int &) const;
45 
46  // Helper struct to hold all information that has to be allocated and
47  // deallocated per device
48  struct GPUData {
49  // Destructor should free all member pointers
50  ~GPUData();
51  // internal pointers are on device, struct itself is on CPU
53  // internal pounters and struct are on device
55  };
56 
57  // Helper that takes care of complexity of transferring the data to
58  // multiple devices
60 };
61 
62 #endif //HeterogeneousHGCalHEBConditions_h
hgcal_conditions::HeterogeneousHEBConditionsESProduct * host
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
double *& select_pointer_d(cp::HeterogeneousHGCalHEBParameters *, const unsigned int &) const
hgcal_conditions::HeterogeneousHEBConditionsESProduct * device
int32_t *& select_pointer_i(cp::HeterogeneousHGCalHEBParameters *, const unsigned int &) const
hgcal_conditions::HeterogeneousHEBConditionsESProduct const * getHeterogeneousConditionsESProductAsync(cudaStream_t stream) const