CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Attributes
EcalLaserAlphasGPU Class Reference

#include <EcalLaserAlphasGPU.h>

Classes

struct  Product
 

Public Member Functions

 EcalLaserAlphasGPU (EcalLaserAlphas const &)
 
uint32_t getOffset () const
 
Product const & getProduct (cudaStream_t) const
 
 ~EcalLaserAlphasGPU ()=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 EcalLaserAlphasGPU.h.

Constructor & Destructor Documentation

◆ EcalLaserAlphasGPU()

EcalLaserAlphasGPU::EcalLaserAlphasGPU ( EcalLaserAlphas const &  values)

Definition at line 6 of file EcalLaserAlphasGPU.cc.

6  {
7  values_.reserve(values.size());
8  values_.insert(values_.end(), values.barrelItems().begin(), values.barrelItems().end());
9  values_.insert(values_.end(), values.endcapItems().begin(), values.endcapItems().end());
10  offset_ = values.barrelItems().size();
11 }

References offset_, contentValuesCheck::values, and values_.

◆ ~EcalLaserAlphasGPU()

EcalLaserAlphasGPU::~EcalLaserAlphasGPU ( )
default

Member Function Documentation

◆ getOffset()

uint32_t EcalLaserAlphasGPU::getOffset ( ) const
inline

Definition at line 31 of file EcalLaserAlphasGPU.h.

31 { return offset_; }

References offset_.

◆ getProduct()

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

Definition at line 13 of file EcalLaserAlphasGPU.cc.

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

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

◆ name()

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

Member Data Documentation

◆ offset_

uint32_t EcalLaserAlphasGPU::offset_
private

Definition at line 38 of file EcalLaserAlphasGPU.h.

Referenced by EcalLaserAlphasGPU(), and getOffset().

◆ product_

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

Definition at line 40 of file EcalLaserAlphasGPU.h.

Referenced by getProduct().

◆ values_

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

Definition at line 37 of file EcalLaserAlphasGPU.h.

Referenced by EcalLaserAlphasGPU(), and getProduct().

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