CMS 3D CMS Logo

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

#include <HcalChannelQualityGPU.h>

Classes

struct  Product
 

Public Member Functions

Product const & getProduct (cudaStream_t) const
 
 HcalChannelQualityGPU (HcalChannelQuality const &)
 
 ~HcalChannelQualityGPU ()=default
 

Private Attributes

cms::cuda::ESProduct< Productproduct_
 
std::vector< uint32_t,
cms::cuda::HostAllocator
< uint32_t > > 
status_
 
uint64_t totalChannels_
 

Detailed Description

Definition at line 13 of file HcalChannelQualityGPU.h.

Constructor & Destructor Documentation

HcalChannelQualityGPU::HcalChannelQualityGPU ( HcalChannelQuality const &  quality)

Definition at line 7 of file HcalChannelQualityGPU.cc.

References HcalCondObjectContainer< Item >::getAllContainers().

8  : totalChannels_{quality.getAllContainers()[0].second.size() + quality.getAllContainers()[1].second.size()},
10  auto const containers = quality.getAllContainers();
11 
12  // fill in eb
13  auto const& barrelValues = containers[0].second;
14  for (uint64_t i = 0; i < barrelValues.size(); ++i) {
15  status_[i] = barrelValues[i].getValue();
16  }
17 
18  // fill in ee
19  auto const& endcapValues = containers[1].second;
20  auto const offset = barrelValues.size();
21  for (uint64_t i = 0; i < endcapValues.size(); ++i) {
22  status_[i + offset] = endcapValues[i].getValue();
23  }
24 }
uint32_t const *__restrict__ Quality * quality
unsigned long long uint64_t
Definition: Time.h:13
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > status_
HcalChannelQualityGPU::~HcalChannelQualityGPU ( )
default

Member Function Documentation

HcalChannelQualityGPU::Product const & HcalChannelQualityGPU::getProduct ( cudaStream_t  stream) const

Definition at line 26 of file HcalChannelQualityGPU.cc.

References cms::cuda::copyAsync(), product_, HcalChannelQualityGPU::Product::status, status_, and cms::cuda::stream.

26  {
27  auto const& product =
28  product_.dataForCurrentDeviceAsync(stream, [this](HcalChannelQualityGPU::Product& product, cudaStream_t stream) {
29  // allocate
30  product.status = cms::cuda::make_device_unique<uint32_t[]>(status_.size(), stream);
31 
32  // transfer
33  cms::cuda::copyAsync(product.status, status_, stream);
34  });
35 
36  return product;
37 }
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20
edm::propagate_const_array< cms::cuda::device::unique_ptr< uint32_t[]> > status
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > status_
cms::cuda::ESProduct< Product > product_

Member Data Documentation

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

Definition at line 33 of file HcalChannelQualityGPU.h.

Referenced by getProduct().

std::vector<uint32_t, cms::cuda::HostAllocator<uint32_t> > HcalChannelQualityGPU::status_
private

Definition at line 31 of file HcalChannelQualityGPU.h.

Referenced by getProduct().

uint64_t HcalChannelQualityGPU::totalChannels_
private

Definition at line 30 of file HcalChannelQualityGPU.h.