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

Tool providing an asynchronous vecmem::copy object for CUDA devices. More...

#include <AsyncCopyTool.h>

Inheritance diagram for AthCUDA::AsyncCopyTool:
Collaboration diagram for AthCUDA::AsyncCopyTool:

Public Member Functions

Function(s) inherited from @c AthAlgTool
virtual StatusCode initialize () override
 Initialize the tool.
Function(s) inherited from @c ICopyTool
virtual std::shared_ptr< const vecmem::copy > copy (const EventContext &ctx) const override
 Get the provided vecmem::copy object.

Private Attributes

ToolHandle< IStreamToolm_streamTool
 Tool to get the current CUDA stream from.

Detailed Description

Tool providing an asynchronous vecmem::copy object for CUDA devices.

Definition at line 20 of file AsyncCopyTool.h.

Member Function Documentation

◆ copy()

std::shared_ptr< const vecmem::copy > AthCUDA::AsyncCopyTool::copy ( const EventContext & ctx) const
overridevirtual

Get the provided vecmem::copy object.

Definition at line 22 of file AsyncCopyTool.cxx.

23 {
24
25 // Create an asynchronous copy object, specific to this slot's CUDA stream.
26 return std::make_shared<const vecmem::cuda::async_copy>(
27 m_streamTool->stream(ctx));
28}
ToolHandle< IStreamTool > m_streamTool
Tool to get the current CUDA stream from.

◆ initialize()

StatusCode AthCUDA::AsyncCopyTool::initialize ( )
overridevirtual

Initialize the tool.

Definition at line 13 of file AsyncCopyTool.cxx.

13 {
14
15 // Retrieve the stream tool.
16 ATH_CHECK(m_streamTool.retrieve());
17
18 // Return gracefully.
19 return StatusCode::SUCCESS;
20}
#define ATH_CHECK
Evaluate an expression and check for errors.

Member Data Documentation

◆ m_streamTool

ToolHandle<IStreamTool> AthCUDA::AsyncCopyTool::m_streamTool
private
Initial value:
{
this, "StreamTool", "", "Tool to get the current CUDA stream from"}

Tool to get the current CUDA stream from.

Definition at line 45 of file AsyncCopyTool.h.

45 {
46 this, "StreamTool", "", "Tool to get the current CUDA stream from"};

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