CMS 3D CMS Logo

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

#include <HcalSiPMCharacteristicsGPU.h>

Classes

struct  Product
 

Public Member Functions

const ProductgetProduct (cudaStream_t) const
 
 HcalSiPMCharacteristicsGPU (HcalSiPMCharacteristics const &)
 
 ~HcalSiPMCharacteristicsGPU ()=default
 

Private Attributes

std::vector< int, cms::cuda::HostAllocator< int > > auxi1_
 
std::vector< float, cms::cuda::HostAllocator< float > > auxi2_
 
std::vector< float, cms::cuda::HostAllocator< float > > crossTalk_
 
std::vector< float, cms::cuda::HostAllocator< float > > parLin1_
 
std::vector< float, cms::cuda::HostAllocator< float > > parLin2_
 
std::vector< float, cms::cuda::HostAllocator< float > > parLin3_
 
std::vector< int, cms::cuda::HostAllocator< int > > pixels_
 
cms::cuda::ESProduct< Productproduct_
 

Detailed Description

Definition at line 13 of file HcalSiPMCharacteristicsGPU.h.

Constructor & Destructor Documentation

◆ HcalSiPMCharacteristicsGPU()

HcalSiPMCharacteristicsGPU::HcalSiPMCharacteristicsGPU ( HcalSiPMCharacteristics const &  parameters)

Definition at line 7 of file HcalSiPMCharacteristicsGPU.cc.

8  : pixels_(parameters.getTypes()),
9  auxi1_(parameters.getTypes()),
10  parLin1_(parameters.getTypes()),
11  parLin2_(parameters.getTypes()),
12  parLin3_(parameters.getTypes()),
13  crossTalk_(parameters.getTypes()),
14  auxi2_(parameters.getTypes()) {
15  for (uint32_t i = 0; i < parameters.getTypes(); i++) {
16  auto const type = parameters.getType(i);
17 #ifdef HCAL_MAHI_CPUDEBUG
18  printf("index = %u type = %d\n", i, type);
19 #endif
20 
21  // for now...
22  if (static_cast<uint32_t>(type) != i + 1)
23  throw cms::Exception("HcalSiPMCharacteristics")
24  << "Wrong assumption for HcalSiPMcharacteristics type values, "
25  << "should be type value <- type index + 1" << std::endl
26  << "Observed type value = " << type << " and index = " << i << std::endl;
27 
28  pixels_[i] = parameters.getPixels(type);
29  auxi1_[i] = parameters.getAuxi1(type);
30  parLin1_[i] = parameters.getNonLinearities(type)[0];
31  parLin2_[i] = parameters.getNonLinearities(type)[1];
32  parLin3_[i] = parameters.getNonLinearities(type)[2];
33  crossTalk_[i] = parameters.getCrossTalk(type);
34  auxi2_[i] = parameters.getAuxi2(type);
35  }
36 }

References auxi1_, auxi2_, crossTalk_, Exception, mps_fire::i, parLin1_, parLin2_, parLin3_, and pixels_.

◆ ~HcalSiPMCharacteristicsGPU()

HcalSiPMCharacteristicsGPU::~HcalSiPMCharacteristicsGPU ( )
default

Member Function Documentation

◆ getProduct()

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

Definition at line 38 of file HcalSiPMCharacteristicsGPU.cc.

38  {
39  auto const& product = product_.dataForCurrentDeviceAsync(
40  stream, [this](HcalSiPMCharacteristicsGPU::Product& product, cudaStream_t stream) {
41  // allocate
42  product.pixels = cms::cuda::make_device_unique<int[]>(pixels_.size(), stream);
43  product.auxi1 = cms::cuda::make_device_unique<int[]>(auxi1_.size(), stream);
44  product.parLin1 = cms::cuda::make_device_unique<float[]>(parLin1_.size(), stream);
45  product.parLin2 = cms::cuda::make_device_unique<float[]>(parLin2_.size(), stream);
46  product.parLin3 = cms::cuda::make_device_unique<float[]>(parLin3_.size(), stream);
47  product.crossTalk = cms::cuda::make_device_unique<float[]>(crossTalk_.size(), stream);
48  product.auxi2 = cms::cuda::make_device_unique<float[]>(auxi2_.size(), stream);
49 
50  // transfer
58  });
59 
60  return product;
61 }

References HcalSiPMCharacteristicsGPU::Product::auxi1, auxi1_, HcalSiPMCharacteristicsGPU::Product::auxi2, auxi2_, cms::cuda::copyAsync(), HcalSiPMCharacteristicsGPU::Product::crossTalk, crossTalk_, HcalSiPMCharacteristicsGPU::Product::parLin1, parLin1_, HcalSiPMCharacteristicsGPU::Product::parLin2, parLin2_, HcalSiPMCharacteristicsGPU::Product::parLin3, parLin3_, HcalSiPMCharacteristicsGPU::Product::pixels, pixels_, product_, and cms::cuda::stream.

Referenced by HBHERecHitProducerGPU::acquire().

Member Data Documentation

◆ auxi1_

std::vector<int, cms::cuda::HostAllocator<int> > HcalSiPMCharacteristicsGPU::auxi1_
private

Definition at line 36 of file HcalSiPMCharacteristicsGPU.h.

Referenced by getProduct(), and HcalSiPMCharacteristicsGPU().

◆ auxi2_

std::vector<float, cms::cuda::HostAllocator<float> > HcalSiPMCharacteristicsGPU::auxi2_
private

Definition at line 37 of file HcalSiPMCharacteristicsGPU.h.

Referenced by getProduct(), and HcalSiPMCharacteristicsGPU().

◆ crossTalk_

std::vector<float, cms::cuda::HostAllocator<float> > HcalSiPMCharacteristicsGPU::crossTalk_
private

Definition at line 37 of file HcalSiPMCharacteristicsGPU.h.

Referenced by getProduct(), and HcalSiPMCharacteristicsGPU().

◆ parLin1_

std::vector<float, cms::cuda::HostAllocator<float> > HcalSiPMCharacteristicsGPU::parLin1_
private

Definition at line 37 of file HcalSiPMCharacteristicsGPU.h.

Referenced by getProduct(), and HcalSiPMCharacteristicsGPU().

◆ parLin2_

std::vector<float, cms::cuda::HostAllocator<float> > HcalSiPMCharacteristicsGPU::parLin2_
private

Definition at line 37 of file HcalSiPMCharacteristicsGPU.h.

Referenced by getProduct(), and HcalSiPMCharacteristicsGPU().

◆ parLin3_

std::vector<float, cms::cuda::HostAllocator<float> > HcalSiPMCharacteristicsGPU::parLin3_
private

Definition at line 37 of file HcalSiPMCharacteristicsGPU.h.

Referenced by getProduct(), and HcalSiPMCharacteristicsGPU().

◆ pixels_

std::vector<int, cms::cuda::HostAllocator<int> > HcalSiPMCharacteristicsGPU::pixels_
private

Definition at line 36 of file HcalSiPMCharacteristicsGPU.h.

Referenced by getProduct(), and HcalSiPMCharacteristicsGPU().

◆ product_

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

Definition at line 39 of file HcalSiPMCharacteristicsGPU.h.

Referenced by getProduct().

BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:30
mps_fire.i
i
Definition: mps_fire.py:428
HcalSiPMCharacteristicsGPU::parLin2_
std::vector< float, cms::cuda::HostAllocator< float > > parLin2_
Definition: HcalSiPMCharacteristicsGPU.h:37
HcalSiPMCharacteristicsGPU::pixels_
std::vector< int, cms::cuda::HostAllocator< int > > pixels_
Definition: HcalSiPMCharacteristicsGPU.h:36
HcalSiPMCharacteristicsGPU::Product::auxi1
edm::propagate_const_array< cms::cuda::device::unique_ptr< int[]> > auxi1
Definition: HcalSiPMCharacteristicsGPU.h:21
HcalSiPMCharacteristicsGPU::parLin1_
std::vector< float, cms::cuda::HostAllocator< float > > parLin1_
Definition: HcalSiPMCharacteristicsGPU.h:37
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
HcalSiPMCharacteristicsGPU::parLin3_
std::vector< float, cms::cuda::HostAllocator< float > > parLin3_
Definition: HcalSiPMCharacteristicsGPU.h:37
HcalSiPMCharacteristicsGPU::Product::parLin1
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > parLin1
Definition: HcalSiPMCharacteristicsGPU.h:17
HcalSiPMCharacteristicsGPU::Product::parLin3
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > parLin3
Definition: HcalSiPMCharacteristicsGPU.h:19
HcalSiPMCharacteristicsGPU::auxi1_
std::vector< int, cms::cuda::HostAllocator< int > > auxi1_
Definition: HcalSiPMCharacteristicsGPU.h:36
HcalSiPMCharacteristicsGPU::Product::parLin2
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > parLin2
Definition: HcalSiPMCharacteristicsGPU.h:18
HcalSiPMCharacteristicsGPU::Product
Definition: HcalSiPMCharacteristicsGPU.h:15
HcalSiPMCharacteristicsGPU::Product::auxi2
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > auxi2
Definition: HcalSiPMCharacteristicsGPU.h:22
HcalSiPMCharacteristicsGPU::Product::pixels
edm::propagate_const_array< cms::cuda::device::unique_ptr< int[]> > pixels
Definition: HcalSiPMCharacteristicsGPU.h:16
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
HcalSiPMCharacteristicsGPU::auxi2_
std::vector< float, cms::cuda::HostAllocator< float > > auxi2_
Definition: HcalSiPMCharacteristicsGPU.h:37
HcalSiPMCharacteristicsGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: HcalSiPMCharacteristicsGPU.h:39
HcalSiPMCharacteristicsGPU::crossTalk_
std::vector< float, cms::cuda::HostAllocator< float > > crossTalk_
Definition: HcalSiPMCharacteristicsGPU.h:37
Exception
Definition: hltDiff.cc:245
HcalSiPMCharacteristicsGPU::Product::crossTalk
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > crossTalk
Definition: HcalSiPMCharacteristicsGPU.h:20
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20