ATLAS Offline Software
Loading...
Searching...
No Matches
Control
AthCUDA
AthCUDAServices
src
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).
6
#include "
DeviceMemoryResourceTool.h
"
7
8
// System include(s).
9
#include <cassert>
10
11
namespace
AthCUDA
{
12
13
StatusCode
DeviceMemoryResourceTool::initialize
() {
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
22
std::pmr::memory_resource&
DeviceMemoryResourceTool::mr
()
const
{
23
24
assert(
m_mr
);
25
return
*
m_mr
;
26
}
27
28
}
// namespace AthCUDA
DeviceMemoryResourceTool.h
AthCUDA::DeviceMemoryResourceTool::m_mr
std::unique_ptr< std::pmr::memory_resource > m_mr
The memory resource that this tool uses.
Definition
DeviceMemoryResourceTool.h:46
AthCUDA::DeviceMemoryResourceTool::mr
virtual std::pmr::memory_resource & mr() const override
Definition
DeviceMemoryResourceTool.cxx:22
AthCUDA::DeviceMemoryResourceTool::m_deviceID
Gaudi::Property< int > m_deviceID
Device to allocate memory on.
Definition
DeviceMemoryResourceTool.h:52
AthCUDA::DeviceMemoryResourceTool::initialize
virtual StatusCode initialize() override
Initialize the tool.
Definition
DeviceMemoryResourceTool.cxx:13
AthCUDA
Definition
Info.h:14
Generated on
for ATLAS Offline Software by
1.16.1