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

Service providing HIP streams to (reentrant) algorithms. More...

#include <PerEventStreamSvc.h>

Inheritance diagram for AthHIP::PerEventStreamSvc:
Collaboration diagram for AthHIP::PerEventStreamSvc:

Public Member Functions

Function(s) inherited from @c AthAlgTool
virtual StatusCode initialize () override
 Initialize the tool.
Function(s) inherited from @c IStreamSvc
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

Service providing HIP streams to (reentrant) algorithms.

In a very simple way. By having one HIP stream per concurrent event (slot), and having algorithms all use a single HIP stream for a given event.

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

Member Function Documentation

◆ initialize()

StatusCode AthHIP::PerEventStreamSvc::initialize ( )
overridevirtual

Initialize the tool.

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

14 {
15
16 // Create the streams 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_INFO("Initialized "
22 << std::distance(m_streams->begin(), m_streams->end())
23 << " HIP stream(s):");
24 for (const auto& stream : *m_streams) {
25 ATH_MSG_INFO(" - " << stream.name());
26 }
27
28 // Return gracefully.
29 return StatusCode::SUCCESS;
30}
#define ATH_MSG_INFO(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::PerEventStreamSvc::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/PerEventStreamSvc.cxx.

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

Member Data Documentation

◆ m_streams

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

Slot specific HIP stream(s).

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


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