Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef CondFormats_EcalObjects_interface_EcalSamplesCorrelationGPU_h
0002 #define CondFormats_EcalObjects_interface_EcalSamplesCorrelationGPU_h
0003 
0004 #include "CondFormats/EcalObjects/interface/EcalSamplesCorrelation.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  // __CUDACC__
0012 
0013 class EcalSamplesCorrelationGPU {
0014 public:
0015   struct Product {
0016     edm::propagate_const_array<cms::cuda::device::unique_ptr<double[]>> EBG12SamplesCorrelation;
0017     edm::propagate_const_array<cms::cuda::device::unique_ptr<double[]>> EBG6SamplesCorrelation;
0018     edm::propagate_const_array<cms::cuda::device::unique_ptr<double[]>> EBG1SamplesCorrelation;
0019     edm::propagate_const_array<cms::cuda::device::unique_ptr<double[]>> EEG12SamplesCorrelation;
0020     edm::propagate_const_array<cms::cuda::device::unique_ptr<double[]>> EEG6SamplesCorrelation;
0021     edm::propagate_const_array<cms::cuda::device::unique_ptr<double[]>> EEG1SamplesCorrelation;
0022   };
0023 
0024 #ifndef __CUDACC__
0025   // rearrange pedestals
0026   EcalSamplesCorrelationGPU(EcalSamplesCorrelation const&);
0027 
0028   // will call dealloation for Product thru ~Product
0029   ~EcalSamplesCorrelationGPU() = default;
0030 
0031   // get device pointers
0032   Product const& getProduct(cudaStream_t) const;
0033 
0034   //
0035   static std::string name() { return std::string{"ecalSamplesCorrelationGPU"}; }
0036 
0037 private:
0038   std::vector<double, cms::cuda::HostAllocator<double>> EBG12SamplesCorrelation_;
0039   std::vector<double, cms::cuda::HostAllocator<double>> EBG6SamplesCorrelation_;
0040   std::vector<double, cms::cuda::HostAllocator<double>> EBG1SamplesCorrelation_;
0041   std::vector<double, cms::cuda::HostAllocator<double>> EEG12SamplesCorrelation_;
0042   std::vector<double, cms::cuda::HostAllocator<double>> EEG6SamplesCorrelation_;
0043   std::vector<double, cms::cuda::HostAllocator<double>> EEG1SamplesCorrelation_;
0044 
0045   cms::cuda::ESProduct<Product> product_;
0046 #endif  // __CUDACC__
0047 };
0048 
0049 #endif  // CondFormats_EcalObjects_interface_EcalSamplesCorrelationGPU_h