CondFormats
EcalObjects
src
EcalRechitChannelStatusGPU.cc
Go to the documentation of this file.
1
#include "
CondFormats/EcalObjects/interface/EcalRechitChannelStatusGPU.h
"
2
3
#include "
FWCore/Utilities/interface/typelookup.h
"
4
#include "
HeterogeneousCore/CUDAUtilities/interface/copyAsync.h
"
5
6
EcalRechitChannelStatusGPU::EcalRechitChannelStatusGPU
(
EcalChannelStatus
const
&
values
) : 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
}
20
21
EcalRechitChannelStatusGPU::Product
const
&
EcalRechitChannelStatusGPU::getProduct
(cudaStream_t cudaStream)
const
{
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
}
32
33
TYPELOOKUP_DATA_REG
(
EcalRechitChannelStatusGPU
);
mps_fire.i
i
Definition:
mps_fire.py:428
EcalRechitChannelStatusGPU::status_
std::vector< uint16_t, cms::cuda::HostAllocator< uint16_t > > status_
Definition:
EcalRechitChannelStatusGPU.h:36
EcalRechitChannelStatusGPU::product_
cms::cuda::ESProduct< Product > product_
Definition:
EcalRechitChannelStatusGPU.h:38
typelookup.h
EcalCondObjectContainer
Definition:
EcalCondObjectContainer.h:13
EcalRechitChannelStatusGPU::Product
Definition:
EcalRechitChannelStatusGPU.h:15
contentValuesCheck.values
values
Definition:
contentValuesCheck.py:38
EcalRechitChannelStatusGPU::EcalRechitChannelStatusGPU
EcalRechitChannelStatusGPU(EcalChannelStatus const &)
Definition:
EcalRechitChannelStatusGPU.cc:6
EcalRechitChannelStatusGPU
Definition:
EcalRechitChannelStatusGPU.h:13
EcalRechitChannelStatusGPU::getProduct
Product const & getProduct(cudaStream_t) const
Definition:
EcalRechitChannelStatusGPU.cc:21
copyAsync.h
EcalRechitChannelStatusGPU::Product::status
edm::propagate_const_array< cms::cuda::device::unique_ptr< uint16_t[]> > status
Definition:
EcalRechitChannelStatusGPU.h:16
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition:
typelookup.h:102
EcalRechitChannelStatusGPU.h
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition:
hltrates_dqm_sourceclient-live_cfg.py:82
findQualityFiles.size
size
Write out results.
Definition:
findQualityFiles.py:443
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