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

Tool providing a separate (single) HIP stream to the component using it. More...

#include <PerComponentStreamTool.h>

Inheritance diagram for AthHIP::PerComponentStreamTool:
Collaboration diagram for AthHIP::PerComponentStreamTool:

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 Details::Streamm_stream
 Single HIP stream.

Detailed Description

Tool providing a separate (single) HIP stream to the component using it.

This means that in algorithms using this tool, operations from different events would end up being executed in a single stream. But operations from different components/algorithms could be executed in parallel.

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

Member Function Documentation

◆ initialize()

StatusCode AthHIP::PerComponentStreamTool::initialize ( )
overridevirtual

Initialize the tool.

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

14 {
15
16 // Create the stream object.
17 m_stream = std::make_unique<const Details::Stream>();
18
19 // Tell the user what happened.
20 ATH_MSG_DEBUG("Initialized HIP stream on device: " << m_stream->name());
21
22 // Return gracefully.
23 return StatusCode::SUCCESS;
24}
#define ATH_MSG_DEBUG(x,...)
std::unique_ptr< const Details::Stream > m_stream
Single HIP stream.

◆ stream()

hipStream_t AthHIP::PerComponentStreamTool::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 26 of file AthHIP/AthHIPComps/src/PerComponentStreamTool.cxx.

26 {
27
28 // Get the stream corresponding to the current slot.
29 assert(m_stream);
30 assert(m_stream->stream());
31 return m_stream->stream();
32}

Member Data Documentation

◆ m_stream

std::unique_ptr<const Details::Stream> AthHIP::PerComponentStreamTool::m_stream
private

Single HIP stream.

Definition at line 55 of file AthHIP/AthHIPComps/src/PerComponentStreamTool.h.


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