ATLAS Offline Software
Loading...
Searching...
No Matches
AthDevice::MemoryResourcesAdaptorTool Class Reference

Tool implementing AthDevice::IMemoryResourcesTool using two tools. More...

#include <MemoryResourcesAdaptorTool.h>

Inheritance diagram for AthDevice::MemoryResourcesAdaptorTool:
Collaboration diagram for AthDevice::MemoryResourcesAdaptorTool:

Public Member Functions

Function(s) inherited from @c AthAlgTool
virtual StatusCode initialize () override
 Initialize the tool.
Function(s) inherited from @c IMemoryResourcesTool
virtual std::pmr::memory_resource & mainMR () const override
 Get the "main" / "device" std::pmr::memory_resource object.
virtual std::pmr::memory_resource * hostMR () const override
 Get the "host" (accessible) std::pmr::memory_resource object.

Private Attributes

ToolHandle< IMemoryResourceToolm_mainMRTool
 Handle to the "main" / "device" memory resource tool.
ToolHandle< IMemoryResourceToolm_hostMRTool
 Handle to the "host" (accessible) memory resource tool.

Detailed Description

Tool implementing AthDevice::IMemoryResourcesTool using two tools.

This is the simplest way of implementing the AthDevice::IMemoryResourcesTool interface. By making use of two individual AthDevice::IMemoryResourceTool tools.

Definition at line 23 of file MemoryResourcesAdaptorTool.h.

Member Function Documentation

◆ hostMR()

std::pmr::memory_resource * AthDevice::MemoryResourcesAdaptorTool::hostMR ( ) const
overridevirtual

Get the "host" (accessible) std::pmr::memory_resource object.

Definition at line 26 of file MemoryResourcesAdaptorTool.cxx.

26 {
27
28 return m_hostMRTool.isEnabled() ? &(m_hostMRTool->mr()) : nullptr;
29}
ToolHandle< IMemoryResourceTool > m_hostMRTool
Handle to the "host" (accessible) memory resource tool.

◆ initialize()

StatusCode AthDevice::MemoryResourcesAdaptorTool::initialize ( )
overridevirtual

Initialize the tool.

Definition at line 10 of file MemoryResourcesAdaptorTool.cxx.

10 {
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
ToolHandle< IMemoryResourceTool > m_mainMRTool
Handle to the "main" / "device" memory resource tool.

◆ mainMR()

std::pmr::memory_resource & AthDevice::MemoryResourcesAdaptorTool::mainMR ( ) const
overridevirtual

Get the "main" / "device" std::pmr::memory_resource object.

Definition at line 21 of file MemoryResourcesAdaptorTool.cxx.

21 {
22
23 return m_mainMRTool->mr();
24}

Member Data Documentation

◆ m_hostMRTool

ToolHandle<IMemoryResourceTool> AthDevice::MemoryResourcesAdaptorTool::m_hostMRTool
private
Initial value:
{
this, "HostMRTool", "",
"Tool providing the 'host' (accessible) memory resource"}

Handle to the "host" (accessible) memory resource tool.

Definition at line 55 of file MemoryResourcesAdaptorTool.h.

55 {
56 this, "HostMRTool", "",
57 "Tool providing the 'host' (accessible) memory resource"};

◆ m_mainMRTool

ToolHandle<IMemoryResourceTool> AthDevice::MemoryResourcesAdaptorTool::m_mainMRTool
private
Initial value:
{
this, "MainMRTool", "",
"Tool providing the 'main' / 'device' memory resource"}

Handle to the "main" / "device" memory resource tool.

Definition at line 51 of file MemoryResourcesAdaptorTool.h.

51 {
52 this, "MainMRTool", "",
53 "Tool providing the 'main' / 'device' memory resource"};

The documentation for this class was generated from the following files: