CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Attributes
EcalRechitADCToGeVConstantGPU Class Reference

#include <EcalRechitADCToGeVConstantGPU.h>

Classes

struct  Product
 

Public Member Functions

 EcalRechitADCToGeVConstantGPU (EcalADCToGeVConstant const &)
 
Product const & getProduct (cudaStream_t) const
 
 ~EcalRechitADCToGeVConstantGPU ()=default
 

Static Public Member Functions

static std::string name ()
 

Private Attributes

std::vector< float, cms::cuda::HostAllocator< float > > adc2gev_
 
cms::cuda::ESProduct< Productproduct_
 

Detailed Description

Definition at line 13 of file EcalRechitADCToGeVConstantGPU.h.

Constructor & Destructor Documentation

◆ EcalRechitADCToGeVConstantGPU()

EcalRechitADCToGeVConstantGPU::EcalRechitADCToGeVConstantGPU ( EcalADCToGeVConstant const &  values)

Definition at line 6 of file EcalRechitADCToGeVConstantGPU.cc.

References adc2gev_, and contentValuesCheck::values.

7  : adc2gev_(2) // size is 2, one form EB and one for EE
8 {
9  adc2gev_[0] = values.getEBValue();
10  adc2gev_[1] = values.getEEValue();
11 }
std::vector< float, cms::cuda::HostAllocator< float > > adc2gev_

◆ ~EcalRechitADCToGeVConstantGPU()

EcalRechitADCToGeVConstantGPU::~EcalRechitADCToGeVConstantGPU ( )
default

Member Function Documentation

◆ getProduct()

EcalRechitADCToGeVConstantGPU::Product const & EcalRechitADCToGeVConstantGPU::getProduct ( cudaStream_t  cudaStream) const

Definition at line 13 of file EcalRechitADCToGeVConstantGPU.cc.

References EcalRechitADCToGeVConstantGPU::Product::adc2gev, adc2gev_, cms::cuda::copyAsync(), and product_.

13  {
14  auto const& product = product_.dataForCurrentDeviceAsync(
15  cudaStream, [this](EcalRechitADCToGeVConstantGPU::Product& product, cudaStream_t cudaStream) {
16  // allocate
17  product.adc2gev = cms::cuda::make_device_unique<float[]>(adc2gev_.size(), cudaStream);
18  // transfer
19  cms::cuda::copyAsync(product.adc2gev, adc2gev_, cudaStream);
20  });
21 
22  return product;
23 }
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > adc2gev
cms::cuda::ESProduct< Product > product_
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20
std::vector< float, cms::cuda::HostAllocator< float > > adc2gev_

◆ name()

static std::string EcalRechitADCToGeVConstantGPU::name ( )
inlinestatic

Member Data Documentation

◆ adc2gev_

std::vector<float, cms::cuda::HostAllocator<float> > EcalRechitADCToGeVConstantGPU::adc2gev_
private

Definition at line 36 of file EcalRechitADCToGeVConstantGPU.h.

Referenced by EcalRechitADCToGeVConstantGPU(), and getProduct().

◆ product_

cms::cuda::ESProduct<Product> EcalRechitADCToGeVConstantGPU::product_
private

Definition at line 38 of file EcalRechitADCToGeVConstantGPU.h.

Referenced by getProduct().