ATLAS Offline Software
Loading...
Searching...
No Matches
DeviceMemoryResourceTool.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).
7
8// System include(s).
9#include <cassert>
10
11namespace AthCUDA {
12
14
15 // Construct the appropriate memory resource.
16 m_mr = std::make_unique<vecmem::cuda::device_memory_resource>(m_deviceID);
17
18 // Return gracefully.
19 return StatusCode::SUCCESS;
20}
21
22std::pmr::memory_resource& DeviceMemoryResourceTool::mr() const {
23
24 assert(m_mr);
25 return *m_mr;
26}
27
28} // namespace AthCUDA
std::unique_ptr< std::pmr::memory_resource > m_mr
The memory resource that this tool uses.
virtual std::pmr::memory_resource & mr() const override
Gaudi::Property< int > m_deviceID
Device to allocate memory on.
virtual StatusCode initialize() override
Initialize the tool.
Definition Info.h:14