CondFormats
EcalObjects
src
EcalLaserAPDPNRatiosRefGPU.cc
Go to the documentation of this file.
1
#include "
CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRefGPU.h
"
2
3
#include "
FWCore/Utilities/interface/typelookup.h
"
4
#include "
HeterogeneousCore/CUDAUtilities/interface/copyAsync.h
"
5
6
EcalLaserAPDPNRatiosRefGPU::EcalLaserAPDPNRatiosRefGPU
(
EcalLaserAPDPNRatiosRef
const
&
values
) {
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
}
12
13
EcalLaserAPDPNRatiosRefGPU::Product
const
&
EcalLaserAPDPNRatiosRefGPU::getProduct
(cudaStream_t cudaStream)
const
{
14
auto
const
& product =
product_
.dataForCurrentDeviceAsync(
15
cudaStream, [
this
](
EcalLaserAPDPNRatiosRefGPU::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
}
24
25
TYPELOOKUP_DATA_REG
(
EcalLaserAPDPNRatiosRefGPU
);
EcalLaserAPDPNRatiosRefGPU.h
typelookup.h
EcalCondObjectContainer
Definition:
EcalCondObjectContainer.h:13
contentValuesCheck.values
values
Definition:
contentValuesCheck.py:38
EcalLaserAPDPNRatiosRefGPU::EcalLaserAPDPNRatiosRefGPU
EcalLaserAPDPNRatiosRefGPU(EcalLaserAPDPNRatiosRef const &)
Definition:
EcalLaserAPDPNRatiosRefGPU.cc:6
EcalLaserAPDPNRatiosRefGPU
Definition:
EcalLaserAPDPNRatiosRefGPU.h:13
EcalLaserAPDPNRatiosRefGPU::product_
cms::cuda::ESProduct< Product > product_
Definition:
EcalLaserAPDPNRatiosRefGPU.h:40
EcalLaserAPDPNRatiosRefGPU::values_
std::vector< float, cms::cuda::HostAllocator< float > > values_
Definition:
EcalLaserAPDPNRatiosRefGPU.h:38
copyAsync.h
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition:
typelookup.h:102
EcalLaserAPDPNRatiosRefGPU::getProduct
Product const & getProduct(cudaStream_t) const
Definition:
EcalLaserAPDPNRatiosRefGPU.cc:13
EcalLaserAPDPNRatiosRefGPU::Product::values
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > values
Definition:
EcalLaserAPDPNRatiosRefGPU.h:16
EcalLaserAPDPNRatiosRefGPU::offset_
uint32_t offset_
Definition:
EcalLaserAPDPNRatiosRefGPU.h:32
EcalLaserAPDPNRatiosRefGPU::Product
Definition:
EcalLaserAPDPNRatiosRefGPU.h:15
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition:
copyAsync.h:20
Generated for CMSSW Reference Manual by
1.8.16