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

Tool exposing a CUDA stream service as a CUDA stream tool. More...

#include <StreamSvcAdaptorTool.h>

Inheritance diagram for AthCUDA::StreamSvcAdaptorTool:
Collaboration diagram for AthCUDA::StreamSvcAdaptorTool:

Public Member Functions

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

Private Attributes

ServiceHandle< IStreamSvcm_svc
 Handle to the service providing the CUDA streams.

Detailed Description

Tool exposing a CUDA stream service as a CUDA stream tool.

Client components should ideally only use CUDA streams through the AthCUDA::IStreamTool interface. (For possible future flexibility.) But, at least initially, streams will just be provided by a relatively simple service.

This tool allows us to expose such services with a tool interface.

Definition at line 26 of file StreamSvcAdaptorTool.h.

Member Function Documentation

◆ initialize()

StatusCode AthCUDA::StreamSvcAdaptorTool::initialize ( )
overridevirtual

Initialize the tool.

Definition at line 13 of file StreamSvcAdaptorTool.cxx.

13 {
14
15 // Retrieve the "wrapped" service.
16 ATH_CHECK(m_svc.retrieve());
17
18 // Return gracefully.
19 return StatusCode::SUCCESS;
20}
#define ATH_CHECK
Evaluate an expression and check for errors.
ServiceHandle< IStreamSvc > m_svc
Handle to the service providing the CUDA streams.

◆ stream()

cudaStream_t AthCUDA::StreamSvcAdaptorTool::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 22 of file StreamSvcAdaptorTool.cxx.

22 {
23
24 // Just return the stream provided by the service.
25 assert(m_svc.isValid());
26 return m_svc->stream(ctx);
27}

Member Data Documentation

◆ m_svc

ServiceHandle<IStreamSvc> AthCUDA::StreamSvcAdaptorTool::m_svc
private
Initial value:
{
this, "StreamSvc", "", "Service providing the 'adapted' CUDA streams"}

Handle to the service providing the CUDA streams.

Definition at line 54 of file StreamSvcAdaptorTool.h.

54 {
55 this, "StreamSvc", "", "Service providing the 'adapted' CUDA streams"};

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