ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthCUDA
AthCUDAServices
src
AthCUDA/AthCUDAServices/src/ManagedMemoryResourceTool.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 "
ManagedMemoryResourceTool.h
"
7
8
// VecMem include(s).
9
#include <vecmem/memory/cuda/managed_memory_resource.hpp>
10
11
// System include(s).
12
#include <cassert>
13
14
namespace
AthCUDA
{
15
16
StatusCode
ManagedMemoryResourceTool::initialize
() {
17
18
// Construct the appropriate memory resource.
19
m_mr
= std::make_unique<vecmem::cuda::managed_memory_resource>();
20
21
// Return gracefully.
22
return
StatusCode::SUCCESS;
23
}
24
25
std::pmr::memory_resource&
ManagedMemoryResourceTool::mr
()
const
{
26
27
assert(
m_mr
);
28
return
*
m_mr
;
29
}
30
31
std::string_view
ManagedMemoryResourceTool::deviceName
()
const
{
32
33
return
"CUDA Managed Memory"
;
34
}
35
36
}
// namespace AthCUDA
ManagedMemoryResourceTool.h
AthCUDA::ManagedMemoryResourceTool::deviceName
virtual std::string_view deviceName() const override
The name of the device for which the memory resource is provided.
Definition
AthCUDA/AthCUDAServices/src/ManagedMemoryResourceTool.cxx:31
AthCUDA::ManagedMemoryResourceTool::initialize
virtual StatusCode initialize() override
Initialize the tool.
Definition
AthCUDA/AthCUDAServices/src/ManagedMemoryResourceTool.cxx:16
AthCUDA::ManagedMemoryResourceTool::mr
virtual std::pmr::memory_resource & mr() const override
Get the provided std::pmr::memory_resource object.
Definition
AthCUDA/AthCUDAServices/src/ManagedMemoryResourceTool.cxx:25
AthCUDA::ManagedMemoryResourceTool::m_mr
std::unique_ptr< std::pmr::memory_resource > m_mr
The memory resource that this tool uses.
Definition
AthCUDA/AthCUDAServices/src/ManagedMemoryResourceTool.h:47
AthCUDA
Definition
Info.h:14
Generated on
for ATLAS Offline Software by
1.17.0