CMS 3D CMS Logo

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

#include <EcalRechitChannelStatusGPU.h>

Classes

struct  Product
 

Public Member Functions

 EcalRechitChannelStatusGPU (EcalChannelStatus const &)
 
Product const & getProduct (cudaStream_t) const
 
 ~EcalRechitChannelStatusGPU ()=default
 

Static Public Member Functions

static std::string name ()
 

Private Attributes

cms::cuda::ESProduct< Productproduct_
 
std::vector< uint16_t, cms::cuda::HostAllocator< uint16_t > > status_
 

Detailed Description

Definition at line 13 of file EcalRechitChannelStatusGPU.h.

Constructor & Destructor Documentation

◆ EcalRechitChannelStatusGPU()

EcalRechitChannelStatusGPU::EcalRechitChannelStatusGPU ( EcalChannelStatus const &  values)

Definition at line 6 of file EcalRechitChannelStatusGPU.cc.

References mps_fire::i, HLT_IsoTrack_cff::offset, status_, and contentValuesCheck::values.

6  : status_(values.size()) {
7  // fill in eb
8  auto const& barrelValues = values.barrelItems();
9  for (unsigned int i = 0; i < barrelValues.size(); i++) {
10  status_[i] = barrelValues[i].getEncodedStatusCode();
11  }
12 
13  // fill in ee
14  auto const& endcapValues = values.endcapItems();
15  auto const offset = barrelValues.size();
16  for (unsigned int i = 0; i < endcapValues.size(); i++) {
17  status_[offset + i] = endcapValues[i].getEncodedStatusCode();
18  }
19 }
std::vector< uint16_t, cms::cuda::HostAllocator< uint16_t > > status_

◆ ~EcalRechitChannelStatusGPU()

EcalRechitChannelStatusGPU::~EcalRechitChannelStatusGPU ( )
default

Member Function Documentation

◆ getProduct()

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

Definition at line 21 of file EcalRechitChannelStatusGPU.cc.

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

21  {
22  auto const& product = product_.dataForCurrentDeviceAsync(
23  cudaStream, [this](EcalRechitChannelStatusGPU::Product& product, cudaStream_t cudaStream) {
24  // allocate
25  product.status = cms::cuda::make_device_unique<uint16_t[]>(status_.size(), cudaStream);
26  // transfer
27  cms::cuda::copyAsync(product.status, status_, cudaStream);
28  });
29 
30  return product;
31 }
cms::cuda::ESProduct< Product > product_
std::vector< uint16_t, cms::cuda::HostAllocator< uint16_t > > status_
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< uint16_t[]> > status

◆ name()

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

Member Data Documentation

◆ product_

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

Definition at line 38 of file EcalRechitChannelStatusGPU.h.

Referenced by getProduct().

◆ status_

std::vector<uint16_t, cms::cuda::HostAllocator<uint16_t> > EcalRechitChannelStatusGPU::status_
private

Definition at line 36 of file EcalRechitChannelStatusGPU.h.

Referenced by EcalRechitChannelStatusGPU(), and getProduct().