Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:47:00

0001 #ifndef CondFormats_HcalObjects_interface_HcalSiPMParametersGPU_h
0002 #define CondFormats_HcalObjects_interface_HcalSiPMParametersGPU_h
0003 
0004 #include "CondFormats/HcalObjects/interface/HcalSiPMParameters.h"
0005 #include "FWCore/Utilities/interface/propagate_const_array.h"
0006 #include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h"
0007 
0008 #ifndef __CUDACC__
0009 #include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h"
0010 #include "HeterogeneousCore/CUDACore/interface/ESProduct.h"
0011 #endif
0012 
0013 class HcalSiPMParametersGPU {
0014 public:
0015   struct Product {
0016     edm::propagate_const_array<cms::cuda::device::unique_ptr<int[]>> type;
0017     edm::propagate_const_array<cms::cuda::device::unique_ptr<int[]>> auxi1;
0018     edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> fcByPE;
0019     edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> darkCurrent;
0020     edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> auxi2;
0021   };
0022 
0023 #ifndef __CUDACC__
0024   // rearrange reco params
0025   HcalSiPMParametersGPU(HcalSiPMParameters const &);
0026 
0027   // will trigger deallocation of Product thru ~Product
0028   ~HcalSiPMParametersGPU() = default;
0029 
0030   // get device pointers
0031   Product const &getProduct(cudaStream_t) const;
0032 
0033 private:
0034   uint64_t totalChannels_;
0035   std::vector<int, cms::cuda::HostAllocator<int>> type_, auxi1_;
0036   std::vector<float, cms::cuda::HostAllocator<float>> fcByPE_, darkCurrent_, auxi2_;
0037 
0038   cms::cuda::ESProduct<Product> product_;
0039 #endif  // __CUDACC__
0040 };
0041 
0042 #endif  // RecoLocalCalo_HcalRecAlgos_interface_HcalSiPMParametersGPU_h