ATLAS Offline Software
Loading...
Searching...
No Matches
MemoryResourcesAdaptorTool.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
8namespace AthDevice {
9
11
12 // Retrieve the sub-tool(s).
13 ATH_CHECK(m_mainMRTool.retrieve());
15 m_hostMRTool.retrieve(DisableTool{m_hostMRTool.typeAndName().empty()}));
16
17 // Return gracefully.
18 return StatusCode::SUCCESS;
19}
20
21std::pmr::memory_resource& MemoryResourcesAdaptorTool::mainMR() const {
22
23 return m_mainMRTool->mr();
24}
25
26std::pmr::memory_resource* MemoryResourcesAdaptorTool::hostMR() const {
27
28 return m_hostMRTool.isEnabled() ? &(m_hostMRTool->mr()) : nullptr;
29}
30
31} // namespace AthDevice
#define ATH_CHECK
Evaluate an expression and check for errors.
ToolHandle< IMemoryResourceTool > m_mainMRTool
Handle to the "main" / "device" memory resource tool.
ToolHandle< IMemoryResourceTool > m_hostMRTool
Handle to the "host" (accessible) memory resource tool.
virtual std::pmr::memory_resource * hostMR() const override
Get the "host" (accessible) std::pmr::memory_resource object.
virtual StatusCode initialize() override
Initialize the tool.
virtual std::pmr::memory_resource & mainMR() const override
Get the "main" / "device" std::pmr::memory_resource object.