ATLAS Offline Software
Loading...
Searching...
No Matches
AsyncCopyTool.cxx
Go to the documentation of this file.
1//
2// Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3//
4
5// Local include(s).
6#include "AsyncCopyTool.h"
7
8// VecMem include(s).
9#include <vecmem/utils/cuda/async_copy.hpp>
10
11namespace AthCUDA {
12
14
15 // Retrieve the stream tool.
16 ATH_CHECK(m_streamTool.retrieve());
17
18 // Return gracefully.
19 return StatusCode::SUCCESS;
20}
21
22std::shared_ptr<const vecmem::copy> AsyncCopyTool::copy(
23 const EventContext& ctx) const {
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}
29
30} // namespace AthCUDA
#define ATH_CHECK
Evaluate an expression and check for errors.
virtual std::shared_ptr< const vecmem::copy > copy(const EventContext &ctx) const override
Get the provided vecmem::copy object.
ToolHandle< IStreamTool > m_streamTool
Tool to get the current CUDA stream from.
virtual StatusCode initialize() override
Initialize the tool.
Definition Info.h:14