HeterogeneousCore
CUDATest
plugins
TestPortableProducerCPU.cc
Go to the documentation of this file.
1
#include "
CUDADataFormats/PortableTestObjects/interface/TestHostCollection.h
"
2
#include "
FWCore/Framework/interface/Event.h
"
3
#include "
FWCore/Framework/interface/EventSetup.h
"
4
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
5
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
6
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
7
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
8
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
9
#include "
FWCore/ServiceRegistry/interface/Service.h
"
10
#include "
FWCore/Utilities/interface/EDGetToken.h
"
11
#include "
FWCore/Utilities/interface/InputTag.h
"
12
#include "
FWCore/Utilities/interface/StreamID.h
"
13
14
#include "
TestAlgo.h
"
15
16
class
TestPortableProducerCPU
:
public
edm::stream::EDProducer
<> {
17
public
:
18
TestPortableProducerCPU
(
edm::ParameterSet
const
&
config
)
19
:
hostToken_
{produces()},
size_
{
config
.getParameter<int32_t>(
"size"
)} {}
20
21
void
produce
(
edm::Event
&
event
,
edm::EventSetup
const
&)
override
{
22
// run the algorithm
23
cudatest::TestHostCollection
hostProduct{
size_
};
24
algo_
.
fill
(hostProduct);
25
26
// put the product into the event
27
event
.emplace(
hostToken_
,
std::move
(hostProduct));
28
}
29
30
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
31
edm::ParameterSetDescription
desc
;
32
desc
.add<int32_t>(
"size"
);
33
descriptions.
addWithDefaultLabel
(
desc
);
34
}
35
36
private
:
37
const
edm::EDPutTokenT<cudatest::TestHostCollection>
hostToken_
;
38
const
int32_t
size_
;
39
40
// implementation of the algorithm
41
cudatest::TestAlgo
algo_
;
42
};
43
44
#include "
FWCore/Framework/interface/MakerMacros.h
"
45
DEFINE_FWK_MODULE
(
TestPortableProducerCPU
);
TestPortableProducerCPU
Definition:
TestPortableProducerCPU.cc:16
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:87
EDProducer.h
Event.h
EventSetup.h
cudatest::TestAlgo::fill
void fill(cudatest::TestDeviceCollection &collection, cudaStream_t stream) const
TestPortableProducerCPU::size_
const int32_t size_
Definition:
TestPortableProducerCPU.cc:38
TestHostCollection.h
config
Definition:
config.py:1
Frameworkfwd.h
edm::EDPutTokenT
Definition:
EDPutToken.h:33
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ParameterSet.h
cms::cuda::PortableHostCollection
Definition:
PortableHostCollection.h:13
ParameterSetDescription.h
TestPortableProducerCPU::algo_
cudatest::TestAlgo algo_
Definition:
TestPortableProducerCPU.cc:41
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
Service.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
StreamID.h
edm::EventSetup
Definition:
EventSetup.h:59
EDGetToken.h
TestAlgo.h
edm::stream::EDProducer
Definition:
EDProducer.h:36
cudatest::TestAlgo
Definition:
TestAlgo.h:9
TestPortableProducerCPU::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
TestPortableProducerCPU.cc:30
TestPortableProducerCPU::TestPortableProducerCPU
TestPortableProducerCPU(edm::ParameterSet const &config)
Definition:
TestPortableProducerCPU.cc:18
InputTag.h
edm::ParameterSet
Definition:
ParameterSet.h:47
ConfigurationDescriptions.h
TestPortableProducerCPU::hostToken_
const edm::EDPutTokenT< cudatest::TestHostCollection > hostToken_
Definition:
TestPortableProducerCPU.cc:37
edm::Event
Definition:
Event.h:73
TestPortableProducerCPU::produce
void produce(edm::Event &event, edm::EventSetup const &) override
Definition:
TestPortableProducerCPU.cc:21
MakerMacros.h
eostools.move
def move(src, dest)
Definition:
eostools.py:511
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
event
Definition:
event.py:1
Generated for CMSSW Reference Manual by
1.8.14