CMS 3D CMS Logo

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

#include <HcalMahiPulseOffsetsGPU.h>

Classes

struct  Product
 

Public Member Functions

Product const & getProduct (cudaStream_t) const
 
std::vector< int, cms::cuda::HostAllocator< int > > const & getValues () const
 
 HcalMahiPulseOffsetsGPU (edm::ParameterSet const &)
 
 ~HcalMahiPulseOffsetsGPU ()=default
 

Private Attributes

cms::cuda::ESProduct< Productproduct_
 
std::vector< int, cms::cuda::HostAllocator< int > > values_
 

Detailed Description

Definition at line 11 of file HcalMahiPulseOffsetsGPU.h.

Constructor & Destructor Documentation

◆ HcalMahiPulseOffsetsGPU()

HcalMahiPulseOffsetsGPU::HcalMahiPulseOffsetsGPU ( edm::ParameterSet const &  ps)

Definition at line 7 of file HcalMahiPulseOffsetsGPU.cc.

7  {
8  auto const& values = ps.getParameter<std::vector<int>>("pulseOffsets");
9  values_.resize(values.size());
10  std::copy(values.begin(), values.end(), values_.begin());
11 }

References filterCSVwithJSON::copy, edm::ParameterSet::getParameter(), contentValuesCheck::values, and values_.

◆ ~HcalMahiPulseOffsetsGPU()

HcalMahiPulseOffsetsGPU::~HcalMahiPulseOffsetsGPU ( )
default

Member Function Documentation

◆ getProduct()

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

Definition at line 18 of file HcalMahiPulseOffsetsGPU.cc.

18  {
19  auto const& product = product_.dataForCurrentDeviceAsync(
20  cudaStream, [this](HcalMahiPulseOffsetsGPU::Product& product, cudaStream_t cudaStream) {
21  // malloc
22  cudaCheck(cudaMalloc((void**)&product.values, this->values_.size() * sizeof(int)));
23 
24  // transfer
25  cudaCheck(cudaMemcpyAsync(product.values,
26  this->values_.data(),
27  this->values_.size() * sizeof(int),
28  cudaMemcpyHostToDevice,
29  cudaStream));
30  });
31 
32  return product;
33 }

References cudaCheck, createfilelist::int, product_, HcalMahiPulseOffsetsGPU::Product::values, and values_.

Referenced by HBHERecHitProducerGPU::acquire().

◆ getValues()

std::vector<int, cms::cuda::HostAllocator<int> > const& HcalMahiPulseOffsetsGPU::getValues ( ) const
inline

Definition at line 25 of file HcalMahiPulseOffsetsGPU.h.

25 { return values_; }

References values_.

Referenced by HBHERecHitProducerGPU::acquire().

Member Data Documentation

◆ product_

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

Definition at line 33 of file HcalMahiPulseOffsetsGPU.h.

Referenced by getProduct().

◆ values_

std::vector<int, cms::cuda::HostAllocator<int> > HcalMahiPulseOffsetsGPU::values_
private

Definition at line 31 of file HcalMahiPulseOffsetsGPU.h.

Referenced by getProduct(), getValues(), and HcalMahiPulseOffsetsGPU().

filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
HcalMahiPulseOffsetsGPU::values_
std::vector< int, cms::cuda::HostAllocator< int > > values_
Definition: HcalMahiPulseOffsetsGPU.h:31
HcalMahiPulseOffsetsGPU::Product::values
int * values
Definition: HcalMahiPulseOffsetsGPU.h:15
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
HcalMahiPulseOffsetsGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: HcalMahiPulseOffsetsGPU.h:33
createfilelist.int
int
Definition: createfilelist.py:10
HcalMahiPulseOffsetsGPU::Product
Definition: HcalMahiPulseOffsetsGPU.h:13
cudaCheck
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69