CMS 3D CMS Logo

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

#include <EcalTimeCalibConstantsGPU.h>

Classes

struct  Product
 

Public Member Functions

 EcalTimeCalibConstantsGPU (EcalTimeCalibConstants const &)
 
uint32_t getOffset () const
 
Product const & getProduct (cudaStream_t) const
 
 ~EcalTimeCalibConstantsGPU ()=default
 

Static Public Member Functions

static std::string name ()
 

Private Attributes

uint32_t offset_
 
cms::cuda::ESProduct< Productproduct_
 
std::vector< float, cms::cuda::HostAllocator< float > > values_
 

Detailed Description

Definition at line 13 of file EcalTimeCalibConstantsGPU.h.

Constructor & Destructor Documentation

◆ EcalTimeCalibConstantsGPU()

EcalTimeCalibConstantsGPU::EcalTimeCalibConstantsGPU ( EcalTimeCalibConstants const &  values)

Definition at line 6 of file EcalTimeCalibConstantsGPU.cc.

6  {
7  values_.reserve(values.size());
8  for (size_t i = 0; i < values.size(); ++i) {
9  values_.emplace_back(values[i]);
10  }
11  offset_ = values.barrelItems().size();
12 }

References mps_fire::i, offset_, contentValuesCheck::values, and values_.

◆ ~EcalTimeCalibConstantsGPU()

EcalTimeCalibConstantsGPU::~EcalTimeCalibConstantsGPU ( )
default

Member Function Documentation

◆ getOffset()

uint32_t EcalTimeCalibConstantsGPU::getOffset ( ) const
inline

Definition at line 31 of file EcalTimeCalibConstantsGPU.h.

31 { return offset_; }

References offset_.

◆ getProduct()

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

Definition at line 14 of file EcalTimeCalibConstantsGPU.cc.

14  {
15  auto const& product = product_.dataForCurrentDeviceAsync(
16  cudaStream, [this](EcalTimeCalibConstantsGPU::Product& product, cudaStream_t cudaStream) {
17  // allocate
18  product.values = cms::cuda::make_device_unique<float[]>(values_.size(), cudaStream);
19  // transfer
20  cms::cuda::copyAsync(product.values, values_, cudaStream);
21  });
22 
23  return product;
24 }

References cms::cuda::copyAsync(), product_, EcalTimeCalibConstantsGPU::Product::values, and values_.

◆ name()

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

Definition at line 34 of file EcalTimeCalibConstantsGPU.h.

34 { return std::string{"ecalTimeCalibConstantsGPU"}; }

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by config.CFG::__str__(), validation.Sample::digest(), and VIDSelectorBase.VIDSelectorBase::initialize().

Member Data Documentation

◆ offset_

uint32_t EcalTimeCalibConstantsGPU::offset_
private

Definition at line 38 of file EcalTimeCalibConstantsGPU.h.

Referenced by EcalTimeCalibConstantsGPU(), and getOffset().

◆ product_

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

Definition at line 40 of file EcalTimeCalibConstantsGPU.h.

Referenced by getProduct().

◆ values_

std::vector<float, cms::cuda::HostAllocator<float> > EcalTimeCalibConstantsGPU::values_
private

Definition at line 37 of file EcalTimeCalibConstantsGPU.h.

Referenced by EcalTimeCalibConstantsGPU(), and getProduct().

mps_fire.i
i
Definition: mps_fire.py:428
EcalTimeCalibConstantsGPU::Product
Definition: EcalTimeCalibConstantsGPU.h:15
EcalTimeCalibConstantsGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: EcalTimeCalibConstantsGPU.h:40
EcalTimeCalibConstantsGPU::offset_
uint32_t offset_
Definition: EcalTimeCalibConstantsGPU.h:38
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
EcalTimeCalibConstantsGPU::values_
std::vector< float, cms::cuda::HostAllocator< float > > values_
Definition: EcalTimeCalibConstantsGPU.h:37
EcalTimeCalibConstantsGPU::Product::values
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > values
Definition: EcalTimeCalibConstantsGPU.h:16
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20