ATLAS Offline Software
Loading...
Searching...
No Matches
AthHIP::PerEventAndComponentStreamTool Class Reference

Tool providing a separate, per-event HIP streams to the component using it. More...

#include <PerEventAndComponentStreamTool.h>

Inheritance diagram for AthHIP::PerEventAndComponentStreamTool:
Collaboration diagram for AthHIP::PerEventAndComponentStreamTool:

Public Member Functions

Function(s) inherited from @c AthAlgTool
virtual StatusCode initialize () override
 Initialize the tool.
Function(s) inherited from @c IStreamTool
virtual hipStream_t stream (const EventContext &ctx) const override
 Get the HIP stream to use.

Private Attributes

std::unique_ptr< const SG::SlotSpecificObj< Details::Stream, SG::InvalidSlot::Enabled > > m_streams
 Slot specific HIP stream(s).

Detailed Description

Tool providing a separate, per-event HIP streams to the component using it.

So that all components would use separate streams, and separate in all events as well. Creating/using a large number of streams as a result.

Definition at line 27 of file AthHIP/AthHIPComps/src/PerEventAndComponentStreamTool.h.

Member Function Documentation

◆ initialize()

StatusCode AthHIP::PerEventAndComponentStreamTool::initialize ( )
overridevirtual

Initialize the tool.

Definition at line 14 of file AthHIP/AthHIPComps/src/PerEventAndComponentStreamTool.cxx.

14 {
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 << " HIP 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}
#define ATH_MSG_DEBUG(x,...)
virtual hipStream_t stream(const EventContext &ctx) const override
Get the HIP stream to use.
std::unique_ptr< const SG::SlotSpecificObj< Details::Stream, SG::InvalidSlot::Enabled > > m_streams
Slot specific HIP stream(s).

◆ stream()

hipStream_t AthHIP::PerEventAndComponentStreamTool::stream ( const EventContext & ctx) const
overridevirtual

Get the HIP stream to use.

Parameters
ctxThe event context for which the stream is requested
Returns
The HIP stream to use for the current event context

Definition at line 32 of file AthHIP/AthHIPComps/src/PerEventAndComponentStreamTool.cxx.

33 {
34
35 // Get the stream corresponding to the current slot.
36 assert(m_streams);
37 return m_streams->get(ctx)->stream();
38}

Member Data Documentation

◆ m_streams

std::unique_ptr< const SG::SlotSpecificObj<Details::Stream, SG::InvalidSlot::Enabled> > AthHIP::PerEventAndComponentStreamTool::m_streams
private

Slot specific HIP stream(s).

Definition at line 57 of file AthHIP/AthHIPComps/src/PerEventAndComponentStreamTool.h.


The documentation for this class was generated from the following files: