ATLAS Offline Software
Loading...
Searching...
No Matches
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).
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
15namespace AthDevice {
16
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.
25 std::make_unique<vecmem::binary_page_memory_resource>(m_mrTool->mr());
27 std::make_unique<vecmem::synchronized_memory_resource>(*m_cachedMR);
28
29 // Return gracefully.
30 return StatusCode::SUCCESS;
31}
32
33std::pmr::memory_resource& BinaryPageMemoryResourceSvc::mr() const {
34
35 assert(m_cachedMR);
36 assert(m_syncedMR);
37 return *m_syncedMR;
38}
39
40} // namespace AthDevice
#define ATH_CHECK
Evaluate an expression and check for errors.
std::unique_ptr< std::pmr::memory_resource > m_cachedMR
The memory resource that this tool uses for caching.
virtual std::pmr::memory_resource & mr() const override
Get the provided std::pmr::memory_resource object.
virtual StatusCode initialize() override
Initialize the tool.
ToolHandle< IMemoryResourceTool > m_mrTool
Handle to the tool providing the underlying memory resource.
std::unique_ptr< std::pmr::memory_resource > m_syncedMR
The memory resource that this tool uses for synchronization.