ATLAS Offline Software
Loading...
Searching...
No Matches
AthCUDA::SingleStreamSvc Class Reference

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

#include <SingleStreamSvc.h>

Inheritance diagram for AthCUDA::SingleStreamSvc:
Collaboration diagram for AthCUDA::SingleStreamSvc:

Public Member Functions

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

Private Attributes

std::unique_ptr< const Details::Streamm_stream
 Single CUDA stream.

Detailed Description

Service providing CUDA streams to (reentrant) algorithms.

In a very simple way. By having one CUDA stream. Period.

Definition at line 25 of file SingleStreamSvc.h.

Member Function Documentation

◆ initialize()

StatusCode AthCUDA::SingleStreamSvc::initialize ( )
overridevirtual

Initialize the tool.

Definition at line 13 of file SingleStreamSvc.cxx.

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

◆ stream()

cudaStream_t AthCUDA::SingleStreamSvc::stream ( const EventContext & ctx) const
overridevirtual

Get the CUDA stream to use.

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

Definition at line 25 of file SingleStreamSvc.cxx.

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

Member Data Documentation

◆ m_stream

std::unique_ptr<const Details::Stream> AthCUDA::SingleStreamSvc::m_stream
private

Single CUDA stream.

Definition at line 53 of file SingleStreamSvc.h.


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