Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 23:30:35

0001 #ifndef RecoLocalCalo_HcalRecAlgos_interface_HcalMahiPulseOffsetsGPU_h
0002 #define RecoLocalCalo_HcalRecAlgos_interface_HcalMahiPulseOffsetsGPU_h
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 
0006 #ifndef __CUDACC__
0007 #include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h"
0008 #include "HeterogeneousCore/CUDACore/interface/ESProduct.h"
0009 #endif
0010 
0011 class HcalMahiPulseOffsetsGPU {
0012 public:
0013   struct Product {
0014     ~Product();
0015     int* values;
0016   };
0017 
0018 #ifndef __CUDACC__
0019   // rearrange reco params
0020   HcalMahiPulseOffsetsGPU(edm::ParameterSet const&);
0021 
0022   // will trigger deallocation of Product thru ~Product
0023   ~HcalMahiPulseOffsetsGPU() = default;
0024 
0025   std::vector<int, cms::cuda::HostAllocator<int>> const& getValues() const { return values_; }
0026 
0027   // get device pointers
0028   Product const& getProduct(cudaStream_t) const;
0029 
0030 private:
0031   std::vector<int, cms::cuda::HostAllocator<int>> values_;
0032 
0033   cms::cuda::ESProduct<Product> product_;
0034 #endif
0035 };
0036 
0037 #endif