File indexing completed on 2024-04-06 12:02:09
0001 #ifndef CondFormats_EcalObjects_interface_EcalLinearCorrectionsGPU_h
0002 #define CondFormats_EcalObjects_interface_EcalLinearCorrectionsGPU_h
0003
0004 #include "CondFormats/EcalObjects/interface/EcalLinearCorrections.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 EcalLinearCorrectionsGPU {
0014 public:
0015 struct Product {
0016 edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> p1;
0017 edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> p2;
0018 edm::propagate_const_array<cms::cuda::device::unique_ptr<float[]>> p3;
0019 edm::propagate_const_array<cms::cuda::device::unique_ptr<edm::TimeValue_t[]>> t1;
0020 edm::propagate_const_array<cms::cuda::device::unique_ptr<edm::TimeValue_t[]>> t2;
0021 edm::propagate_const_array<cms::cuda::device::unique_ptr<edm::TimeValue_t[]>> t3;
0022 };
0023
0024 #ifndef __CUDACC__
0025
0026
0027 EcalLinearCorrectionsGPU(EcalLinearCorrections const &);
0028
0029
0030 ~EcalLinearCorrectionsGPU() = default;
0031
0032
0033 Product const &getProduct(cudaStream_t) const;
0034
0035
0036 static std::string name() { return std::string{"ecalLinearCorrectionsGPU"}; }
0037
0038 private:
0039
0040
0041 std::vector<float, cms::cuda::HostAllocator<float>> p1_;
0042 std::vector<float, cms::cuda::HostAllocator<float>> p2_;
0043 std::vector<float, cms::cuda::HostAllocator<float>> p3_;
0044
0045 std::vector<edm::TimeValue_t, cms::cuda::HostAllocator<edm::TimeValue_t>> t1_;
0046 std::vector<edm::TimeValue_t, cms::cuda::HostAllocator<edm::TimeValue_t>> t2_;
0047 std::vector<edm::TimeValue_t, cms::cuda::HostAllocator<edm::TimeValue_t>> t3_;
0048
0049 cms::cuda::ESProduct<Product> product_;
0050
0051 #endif
0052 };
0053
0054 #endif