Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-03-25 10:54:40

0001 #ifndef CondFormats_EcalObjects_interface_EcalPulseShapesGPU_h
0002 #define CondFormats_EcalObjects_interface_EcalPulseShapesGPU_h
0003 
0004 #include "CondFormats/EcalObjects/interface/EcalPulseShapes.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 EcalPulseShapesGPU {
0012 public:
0013   struct Product {
0014     ~Product();
0015     EcalPulseShape* values = nullptr;
0016   };
0017 
0018 #ifndef __CUDACC__
0019   // rearrange pedestals
0020   EcalPulseShapesGPU(EcalPulseShapes const&);
0021 
0022   // will call dealloation for Product thru ~Product
0023   ~EcalPulseShapesGPU() = default;
0024 
0025   // get device pointers
0026   Product const& getProduct(cudaStream_t) const;
0027 
0028   //
0029   static std::string name() { return std::string{"ecalPulseShapesGPU"}; }
0030 
0031 private:
0032   // reuse original vectors (although with default allocator)
0033   std::vector<EcalPulseShape> const& valuesEB_;
0034   std::vector<EcalPulseShape> const& valuesEE_;
0035 
0036   cms::cuda::ESProduct<Product> product_;
0037 #endif  // __CUDACC__
0038 };
0039 
0040 #endif  // CondFormats_EcalObjects_interface_EcalPulseShapesGPU_h