CondFormats
EcalObjects
src
EcalTimeCalibConstantsGPU.cc
Go to the documentation of this file.
1
#include "
CondFormats/EcalObjects/interface/EcalTimeCalibConstantsGPU.h
"
2
3
#include "
FWCore/Utilities/interface/typelookup.h
"
4
#include "
HeterogeneousCore/CUDAUtilities/interface/copyAsync.h
"
5
6
EcalTimeCalibConstantsGPU::EcalTimeCalibConstantsGPU
(
EcalTimeCalibConstants
const
&
values
) {
7
values_
.reserve(
values
.size());
8
for
(
size_t
i
= 0;
i
<
values
.size(); ++
i
) {
9
values_
.emplace_back(
values
[
i
]);
10
}
11
offset_
=
values
.barrelItems().size();
12
}
13
14
EcalTimeCalibConstantsGPU::Product
const
&
EcalTimeCalibConstantsGPU::getProduct
(cudaStream_t cudaStream)
const
{
15
auto
const
& product =
product_
.dataForCurrentDeviceAsync(
16
cudaStream, [
this
](
EcalTimeCalibConstantsGPU::Product
& product, cudaStream_t cudaStream) {
17
// allocate
18
product.
values
= cms::cuda::make_device_unique<float[]>(
values_
.size(), cudaStream);
19
// transfer
20
cms::cuda::copyAsync
(product.
values
,
values_
, cudaStream);
21
});
22
23
return
product;
24
}
25
26
TYPELOOKUP_DATA_REG
(
EcalTimeCalibConstantsGPU
);
mps_fire.i
i
Definition:
mps_fire.py:428
EcalTimeCalibConstantsGPU.h
EcalTimeCalibConstantsGPU::Product
Definition:
EcalTimeCalibConstantsGPU.h:15
typelookup.h
EcalCondObjectContainer
Definition:
EcalCondObjectContainer.h:13
EcalTimeCalibConstantsGPU::product_
cms::cuda::ESProduct< Product > product_
Definition:
EcalTimeCalibConstantsGPU.h:40
EcalTimeCalibConstantsGPU::offset_
uint32_t offset_
Definition:
EcalTimeCalibConstantsGPU.h:38
EcalTimeCalibConstantsGPU::getProduct
Product const & getProduct(cudaStream_t) const
Definition:
EcalTimeCalibConstantsGPU.cc:14
contentValuesCheck.values
values
Definition:
contentValuesCheck.py:38
EcalTimeCalibConstantsGPU::values_
std::vector< float, cms::cuda::HostAllocator< float > > values_
Definition:
EcalTimeCalibConstantsGPU.h:37
EcalTimeCalibConstantsGPU
Definition:
EcalTimeCalibConstantsGPU.h:13
EcalTimeCalibConstantsGPU::EcalTimeCalibConstantsGPU
EcalTimeCalibConstantsGPU(EcalTimeCalibConstants const &)
Definition:
EcalTimeCalibConstantsGPU.cc:6
EcalTimeCalibConstantsGPU::Product::values
edm::propagate_const_array< cms::cuda::device::unique_ptr< float[]> > values
Definition:
EcalTimeCalibConstantsGPU.h:16
copyAsync.h
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition:
typelookup.h:102
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