File indexing completed on 2024-04-06 12:02:09
0001 #ifndef CondFormats_EcalObjects_interface_EcalGainRatiosGPU_h
0002 #define CondFormats_EcalObjects_interface_EcalGainRatiosGPU_h
0003
0004 #include "CondFormats/EcalObjects/interface/EcalGainRatios.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 EcalGainRatiosGPU {
0014 public:
0015 struct Product {
0016 edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> gain12Over6;
0017 edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> gain6Over1;
0018 };
0019
0020 #ifndef __CUDACC__
0021
0022
0023 EcalGainRatiosGPU(EcalGainRatios const&);
0024
0025
0026 ~EcalGainRatiosGPU() = default;
0027
0028
0029 Product const& getProduct(cudaStream_t) const;
0030
0031
0032 static std::string name() { return std::string{"ecalGainRatiosGPU"}; }
0033
0034 private:
0035
0036
0037 std::vector<float, cms::cuda::HostAllocator<float>> gain12Over6_;
0038 std::vector<float, cms::cuda::HostAllocator<float>> gain6Over1_;
0039
0040 cms::cuda::ESProduct<Product> product_;
0041
0042 #endif
0043 };
0044
0045 #endif