Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:13

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