CMS 3D CMS Logo

HeterogeneousHGCalEEConditions.h
Go to the documentation of this file.
1 #ifndef HeterogeneousHGCalEEConditions_h
2 #define HeterogeneousHGCalEEConditions_h
3 
4 #include <numeric> //accumulate
5 #include <typeinfo>
6 
15 
17 
18 // Declare the wrapper ESProduct. The corresponding ESProducer should
19 // produce objects of this type.
21 public:
22  // Constructor takes the standard CPU ESProduct, and transforms the
23  // necessary data to array(s) in pinned host memory
25 
26  // Deallocates all pinned host memory
28 
29  // Function to return the actual payload on the memory of the current device
31  cudaStream_t stream) const;
32 
33 private:
34  // Holds the data in pinned CPU memory
35  // Contrary to its non-heterogeneous counterpart (constructor argument) it is *not* a pointer (so to avoid an extra allocation)
37 
38  std::vector<size_t> sizes_;
39  size_t chunk_;
40 
42 
43  // Helper struct to hold all information that has to be allocated and
44  // deallocated per device
45  struct GPUData {
46  // Destructor should free all member pointers
47  ~GPUData();
48  // internal pointers are on device, struct itself is on CPU
50  // internal pounters and struct are on device
52  };
53 
54  // Helper that takes care of complexity of transferring the data to
55  // multiple devices
57 };
58 
59 #endif //HeterogeneousHGCalEEConditions_h
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:30
MessageLogger.h
HeterogeneousHGCalEEConditionsWrapper::~HeterogeneousHGCalEEConditionsWrapper
~HeterogeneousHGCalEEConditionsWrapper()
Definition: HeterogeneousHGCalEEConditions.cc:129
cms::cuda::stream
uint32_t const T *__restrict__ const uint32_t *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Definition: HistoContainer.h:51
HeterogeneousHGCalEEConditionsWrapper::calculate_memory_bytes
void calculate_memory_bytes(const HGCalParameters *)
Definition: HeterogeneousHGCalEEConditions.cc:106
HeterogeneousHGCalEEConditionsWrapper::GPUData::~GPUData
~GPUData()
Definition: HeterogeneousHGCalEEConditions.cc:182
hgcal_conditions::parameters
Definition: HGCConditions.h:86
HeterogeneousHGCalEEConditionsWrapper::chunk_
size_t chunk_
Definition: HeterogeneousHGCalEEConditions.h:39
HGCConditions.h
HeterogeneousHGCalEEConditionsWrapper::sizes_
std::vector< size_t > sizes_
Definition: HeterogeneousHGCalEEConditions.h:38
HeterogeneousHGCalEEConditionsWrapper::params_
cp::HeterogeneousHGCalEEParameters params_
Definition: HeterogeneousHGCalEEConditions.h:36
cms::cuda::ESProduct
Definition: ESProduct.h:20
KernelManagerHGCalRecHit.h
HeterogeneousHGCalEEConditionsWrapper
Definition: HeterogeneousHGCalEEConditions.h:20
HeterogeneousHGCalEEConditionsWrapper::GPUData::host
hgcal_conditions::HeterogeneousEEConditionsESProduct * host
Definition: HeterogeneousHGCalEEConditions.h:49
HeterogeneousHGCalEEConditionsWrapper::GPUData::device
hgcal_conditions::HeterogeneousEEConditionsESProduct * device
Definition: HeterogeneousHGCalEEConditions.h:51
cudaCheck.h
HGCalParameters
Definition: HGCalParameters.h:14
hgcal_conditions::HeterogeneousEEConditionsESProduct
Definition: HGCConditions.h:184
HeterogeneousHGCalEEConditionsWrapper::gpuData_
cms::cuda::ESProduct< GPUData > gpuData_
Definition: HeterogeneousHGCalEEConditions.h:56
Exception.h
HeterogeneousHGCalEEConditionsWrapper::GPUData
Definition: HeterogeneousHGCalEEConditions.h:45
HGCalDDDConstants.h
HeterogeneousHGCalEEConditionsWrapper::HeterogeneousHGCalEEConditionsWrapper
HeterogeneousHGCalEEConditionsWrapper(const HGCalParameters *)
Definition: HeterogeneousHGCalEEConditions.cc:59
HeterogeneousHGCalEEConditionsWrapper::getHeterogeneousConditionsESProductAsync
const hgcal_conditions::HeterogeneousEEConditionsESProduct * getHeterogeneousConditionsESProductAsync(cudaStream_t stream) const
Definition: HeterogeneousHGCalEEConditions.cc:137
hgcal_conditions::parameters::HeterogeneousHGCalEEParameters
Definition: HGCConditions.h:107
HGCalParameters.h
ESProduct.h