ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthDevice
AthDeviceComps
src
BinaryPageMemoryResourceSvc.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 "
BinaryPageMemoryResourceSvc.h
"
7
8
// VecMem include(s).
9
#include <vecmem/memory/binary_page_memory_resource.hpp>
10
#include <vecmem/memory/synchronized_memory_resource.hpp>
11
12
// System include(s).
13
#include <cassert>
14
15
namespace
AthDevice
{
16
17
StatusCode
BinaryPageMemoryResourceSvc::initialize
() {
18
19
// Retrieve the upstream memory resource tool.
20
ATH_CHECK
(
m_mrTool
.retrieve());
21
22
// Construct the cached and synchronized memory resources around this upstream
23
// memory resource.
24
m_cachedMR
=
25
std::make_unique<vecmem::binary_page_memory_resource>(
m_mrTool
->mr());
26
m_syncedMR
=
27
std::make_unique<vecmem::synchronized_memory_resource>(*
m_cachedMR
);
28
29
// Return gracefully.
30
return
StatusCode::SUCCESS;
31
}
32
33
std::pmr::memory_resource&
BinaryPageMemoryResourceSvc::mr
()
const
{
34
35
assert(
m_cachedMR
);
36
assert(
m_syncedMR
);
37
return
*
m_syncedMR
;
38
}
39
40
}
// namespace AthDevice
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
BinaryPageMemoryResourceSvc.h
AthDevice::BinaryPageMemoryResourceSvc::m_cachedMR
std::unique_ptr< std::pmr::memory_resource > m_cachedMR
The memory resource that this tool uses for caching.
Definition
BinaryPageMemoryResourceSvc.h:49
AthDevice::BinaryPageMemoryResourceSvc::mr
virtual std::pmr::memory_resource & mr() const override
Get the provided std::pmr::memory_resource object.
Definition
BinaryPageMemoryResourceSvc.cxx:33
AthDevice::BinaryPageMemoryResourceSvc::initialize
virtual StatusCode initialize() override
Initialize the tool.
Definition
BinaryPageMemoryResourceSvc.cxx:17
AthDevice::BinaryPageMemoryResourceSvc::m_mrTool
ToolHandle< IMemoryResourceTool > m_mrTool
Handle to the tool providing the underlying memory resource.
Definition
BinaryPageMemoryResourceSvc.h:46
AthDevice::BinaryPageMemoryResourceSvc::m_syncedMR
std::unique_ptr< std::pmr::memory_resource > m_syncedMR
The memory resource that this tool uses for synchronization.
Definition
BinaryPageMemoryResourceSvc.h:51
AthDevice
Definition
BinaryPageMemoryResourceSvc.cxx:15
Generated on
for ATLAS Offline Software by
1.17.0