Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef CondFormats_EcalObjects_interface_EcalPulseCovariancesGPU_h
0002 #define CondFormats_EcalObjects_interface_EcalPulseCovariancesGPU_h
0003 
0004 #include "CondFormats/EcalObjects/interface/EcalPulseCovariances.h"
0005 
0006 #ifndef __CUDACC__
0007 #include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h"
0008 #include "HeterogeneousCore/CUDACore/interface/ESProduct.h"
0009 #endif  // __CUDACC__
0010 
0011 class EcalPulseCovariancesGPU {
0012 public:
0013   struct Product {
0014     ~Product();
0015     EcalPulseCovariance* values = nullptr;
0016   };
0017 
0018 #ifndef __CUDACC__
0019   // rearrange pedestals
0020   EcalPulseCovariancesGPU(EcalPulseCovariances const&);
0021 
0022   // will call dealloation for Product thru ~Product
0023   ~EcalPulseCovariancesGPU() = default;
0024 
0025   // get device pointers
0026   Product const& getProduct(cudaStream_t) const;
0027 
0028   //
0029   static std::string name() { return std::string{"ecalPulseCovariancesGPU"}; }
0030 
0031 private:
0032   // reuse original vectors (although with default allocator)
0033   std::vector<EcalPulseCovariance> const& valuesEB_;
0034   std::vector<EcalPulseCovariance> const& valuesEE_;
0035 
0036   cms::cuda::ESProduct<Product> product_;
0037 #endif  // __CUDACC__
0038 };
0039 
0040 #endif  // CondFormats_EcalObjects_interface_EcalPulseCovariancesGPU_h