src
HeterogeneousCore
AlpakaCore
src
alpaka
EDMetadataSentry.cc
Go to the documentation of this file.
1
#include "
HeterogeneousCore/AlpakaCore/interface/alpaka/chooseDevice.h
"
2
#include "
HeterogeneousCore/AlpakaCore/interface/alpaka/EDMetadataSentry.h
"
3
#include "
HeterogeneousCore/AlpakaCore/interface/EventCache.h
"
4
#include "
HeterogeneousCore/AlpakaCore/interface/QueueCache.h
"
5
6
namespace
ALPAKA_ACCELERATOR_NAMESPACE
{
7
namespace
detail
{
8
EDMetadataSentry::EDMetadataSentry
(
edm::StreamID
streamID) {
9
auto
const
& device =
detail::chooseDevice
(streamID);
10
#ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED
11
metadata_
= std::make_shared<EDMetadata>(cms::alpakatools::getQueueCache<Queue>().
get
(device));
12
#else
13
metadata_
= std::make_shared<EDMetadata>(cms::alpakatools::getQueueCache<Queue>().
get
(device),
14
cms::alpakatools::getEventCache<Event>().
get
(device));
15
#endif
16
}
17
18
void
EDMetadataSentry::finish
(
bool
launchedAsyncWork) {
19
if
(launchedAsyncWork) {
20
metadata_
->recordEvent();
21
}
else
{
22
// If we are certain no asynchronous work was launched (i.e.
23
// the Queue was not used in any way), there is no need to
24
// synchronize, and the Event can be discarded.
25
metadata_
->discardEvent();
26
}
27
}
28
}
// namespace detail
29
}
// namespace ALPAKA_ACCELERATOR_NAMESPACE
EDMetadataSentry.h
ALPAKA_ACCELERATOR_NAMESPACE::detail::EDMetadataSentry::metadata_
std::shared_ptr< EDMetadata > metadata_
Definition:
EDMetadataSentry.h:33
edm::StreamID
Definition:
StreamID.h:30
chooseDevice.h
ALPAKA_ACCELERATOR_NAMESPACE
Definition:
SiPixelCablingSoAESProducer.cc:21
detail
Definition:
SiStripClustersSOA.h:8
EventCache.h
ALPAKA_ACCELERATOR_NAMESPACE::detail::chooseDevice
Device const & chooseDevice(edm::StreamID id)
Definition:
chooseDevice.cc:9
ALPAKA_ACCELERATOR_NAMESPACE::detail::EDMetadataSentry::EDMetadataSentry
EDMetadataSentry(edm::StreamID stream)
Definition:
EDMetadataSentry.cc:8
QueueCache.h
ALPAKA_ACCELERATOR_NAMESPACE::detail::EDMetadataSentry::finish
void finish(bool launchedAsyncWork)
Definition:
EDMetadataSentry.cc:18
Generated for CMSSW Reference Manual by
1.8.14