ATLAS Offline Software
Loading...
Searching...
No Matches
Control
AthCUDA
AthCUDAServices
src
PerEventAndComponentStreamTool.cxx
Go to the documentation of this file.
1
//
2
// Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
//
4
5
// Local include(s).
6
#include "
PerEventAndComponentStreamTool.h
"
7
8
// System include(s).
9
#include <cassert>
10
#include <iterator>
11
12
namespace
AthCUDA
{
13
14
StatusCode
PerEventAndComponentStreamTool::initialize
() {
15
16
// Create the stream object.
17
m_streams
= std::make_unique<
18
const
SG::SlotSpecificObj<Details::Stream, SG::InvalidSlot::Enabled>
>();
19
20
// Tell the user what happened.
21
ATH_MSG_DEBUG
(
"Initialized "
22
<< std::distance(
m_streams
->begin(),
m_streams
->end())
23
<<
" CUDA stream(s):"
);
24
for
(
const
auto
&
stream
: *
m_streams
) {
25
ATH_MSG_DEBUG
(
" - "
<<
stream
.name());
26
}
27
28
// Return gracefully.
29
return
StatusCode::SUCCESS;
30
}
31
32
cudaStream_t
PerEventAndComponentStreamTool::stream
(
33
const
EventContext& ctx)
const
{
34
35
// Get the stream corresponding to the current slot.
36
assert(
m_streams
);
37
return
m_streams
->get(ctx)->stream();
38
}
39
40
}
// namespace AthCUDA
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
PerEventAndComponentStreamTool.h
AthCUDA::PerEventAndComponentStreamTool::m_streams
std::unique_ptr< const SG::SlotSpecificObj< Details::Stream, SG::InvalidSlot::Enabled > > m_streams
Slot specific CUDA stream(s).
Definition
PerEventAndComponentStreamTool.h:57
AthCUDA::PerEventAndComponentStreamTool::stream
virtual cudaStream_t stream(const EventContext &ctx) const override
Get the CUDA stream to use.
Definition
PerEventAndComponentStreamTool.cxx:32
AthCUDA::PerEventAndComponentStreamTool::initialize
virtual StatusCode initialize() override
Initialize the tool.
Definition
PerEventAndComponentStreamTool.cxx:14
SG::SlotSpecificObj
Maintain a set of objects, one per slot.
Definition
AthenaKernel/AthenaKernel/SlotSpecificObj.h:84
AthCUDA
Definition
Info.h:14
Generated on
for ATLAS Offline Software by
1.16.1