Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:08

0001 #ifndef CondFormats_HcalObjects_interface_HcalConvertedPedestalWidthsGPU_h
0002 #define CondFormats_HcalObjects_interface_HcalConvertedPedestalWidthsGPU_h
0003 
0004 #include "CondFormats/HcalObjects/interface/HcalPedestalWidths.h"
0005 #include "CondFormats/HcalObjects/interface/HcalPedestals.h"
0006 #include "CondFormats/HcalObjects/interface/HcalQIEData.h"
0007 #include "CondFormats/HcalObjects/interface/HcalQIETypes.h"
0008 #include "FWCore/Utilities/interface/propagate_const_array.h"
0009 #include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
0010 
0011 #ifndef __CUDACC__
0012 #include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h"
0013 #include "HeterogeneousCore/CUDACore/interface/ESProduct.h"
0014 #endif
0015 
0016 class HcalConvertedPedestalWidthsGPU {
0017 public:
0018   struct Product {
0019     edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> values;
0020   };
0021 
0022 #ifndef __CUDACC__
0023   // order matters!
0024   HcalConvertedPedestalWidthsGPU(HcalPedestals const&,
0025                                  HcalPedestalWidths const&,
0026                                  HcalQIEData const&,
0027                                  HcalQIETypes const&);
0028 
0029   // will trigger deallocation of Product thru ~Product
0030   ~HcalConvertedPedestalWidthsGPU() = default;
0031 
0032   // get device pointers
0033   Product const& getProduct(cudaStream_t) const;
0034 
0035 private:
0036   uint64_t totalChannels_;
0037   std::vector<float, cms::cuda::HostAllocator<float>> values_;
0038 
0039   cms::cuda::ESProduct<Product> product_;
0040 #endif
0041 };
0042 
0043 #endif