Main Page
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Properties
_
a
c
d
e
f
l
m
o
p
s
t
u
v
+
Related Functions
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Package Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
HeterogeneousCore
AlpakaTest
plugins
alpaka
TestAlpakaProducer.cc
Go to the documentation of this file.
1
#include "
DataFormats/Portable/interface/Product.h
"
2
#include "
DataFormats/PortableTestObjects/interface/alpaka/TestDeviceCollection.h
"
3
#include "
FWCore/Framework/interface/Event.h
"
4
#include "
FWCore/Framework/interface/EventSetup.h
"
5
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
6
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
7
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
8
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
9
#include "
FWCore/ParameterSet/interface/ParameterSetDescription.h
"
10
#include "
FWCore/Utilities/interface/EDGetToken.h
"
11
#include "
FWCore/Utilities/interface/InputTag.h
"
12
#include "
FWCore/Utilities/interface/StreamID.h
"
13
#include "
HeterogeneousCore/AlpakaCore/interface/ScopedContext.h
"
14
#include "
HeterogeneousCore/AlpakaInterface/interface/config.h
"
15
16
#include "
TestAlgo.h
"
17
18
namespace
ALPAKA_ACCELERATOR_NAMESPACE
{
19
20
class
TestAlpakaProducer
:
public
edm::stream::EDProducer
<> {
21
public
:
22
TestAlpakaProducer
(
edm::ParameterSet
const
&
config
)
23
:
deviceToken_
{produces()},
size_
{
config
.getParameter<int32_t>(
"size"
)} {}
24
25
void
produce
(
edm::Event
&
event
,
edm::EventSetup
const
&)
override
{
26
// create a context based on the EDM stream number
27
cms::alpakatools::ScopedContextProduce<Queue>
ctx(
event
.streamID());
28
29
// run the algorithm, potentially asynchronously
30
portabletest::TestDeviceCollection
deviceProduct{
size_
, ctx.queue()};
31
algo_
.
fill
(ctx.queue(), deviceProduct);
32
33
// put the asynchronous product into the event without waiting
34
ctx.emplace(
event
,
deviceToken_
,
std::move
(deviceProduct));
35
}
36
37
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
38
edm::ParameterSetDescription
desc
;
39
desc
.add<int32_t>(
"size"
);
40
descriptions.
addWithDefaultLabel
(
desc
);
41
}
42
43
private
:
44
const
edm::EDPutTokenT<cms::alpakatools::Product<Queue, portabletest::TestDeviceCollection>
>
deviceToken_
;
45
const
int32_t
size_
;
46
47
// implementation of the algorithm
48
TestAlgo
algo_
;
49
};
50
51
}
// namespace ALPAKA_ACCELERATOR_NAMESPACE
52
53
#include "
HeterogeneousCore/AlpakaCore/interface/MakerMacros.h
"
54
DEFINE_FWK_ALPAKA_MODULE
(TestAlpakaProducer);
TestDeviceCollection.h
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:87
MakerMacros.h
EDGetToken.h
ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaProducer::deviceToken_
const edm::EDPutTokenT< cms::alpakatools::Product< Queue, portabletest::TestDeviceCollection > > deviceToken_
Definition:
TestAlpakaProducer.cc:44
ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaProducer::produce
void produce(edm::Event &event, edm::EventSetup const &) override
Definition:
TestAlpakaProducer.cc:25
ALPAKA_ACCELERATOR_NAMESPACE::TestAlgo::fill
void fill(Queue &queue, portabletest::TestDeviceCollection &collection) const
Definition:
TestAlgo.dev.cc:39
Event.h
EventSetup.h
config
Definition:
config.py:1
ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
TestAlpakaProducer.cc:37
Frameworkfwd.h
edm::EDPutTokenT
Definition:
EDPutToken.h:33
cms::alpakatools::ScopedContextProduce
Definition:
ScopedContext.h:199
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ParameterSet.h
ALPAKA_ACCELERATOR_NAMESPACE
Definition:
PortableCollection.h:13
EDProducer.h
ParameterSetDescription.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
StreamID.h
edm::EventSetup
Definition:
EventSetup.h:59
ALPAKA_ACCELERATOR_NAMESPACE::TestAlgo
Definition:
TestAlgo.h:9
Product.h
ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaProducer::TestAlpakaProducer
TestAlpakaProducer(edm::ParameterSet const &config)
Definition:
TestAlpakaProducer.cc:22
edm::stream::EDProducer
Definition:
EDProducer.h:36
TestAlgo.h
ScopedContext.h
PortableDeviceCollection
Definition:
PortableDeviceCollection.h:14
InputTag.h
DEFINE_FWK_ALPAKA_MODULE
#define DEFINE_FWK_ALPAKA_MODULE(name)
Definition:
MakerMacros.h:9
edm::ParameterSet
Definition:
ParameterSet.h:47
ConfigurationDescriptions.h
edm::Event
Definition:
Event.h:73
config.h
ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaProducer
Definition:
TestAlpakaProducer.cc:20
ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaProducer::size_
const int32_t size_
Definition:
TestAlpakaProducer.cc:45
eostools.move
def move(src, dest)
Definition:
eostools.py:511
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
ALPAKA_ACCELERATOR_NAMESPACE::TestAlpakaProducer::algo_
TestAlgo algo_
Definition:
TestAlpakaProducer.cc:48
event
Definition:
event.py:1
Generated for CMSSW Reference Manual by
1.8.14