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

Service implementing "pooled" caching on top of another memory resource. More...

#include <PoolMemoryResourceSvc.h>

Inheritance diagram for AthDevice::PoolMemoryResourceSvc:
Collaboration diagram for AthDevice::PoolMemoryResourceSvc:

Public Member Functions

Function(s) inherited from @c AthService
virtual StatusCode initialize () override
 Initialize the service.
Function(s) inherited from @c IMemoryResourceSvc
virtual std::pmr::memory_resource & mr () const override
 Get the provided std::pmr::memory_resource object.
virtual std::string_view deviceName () const override
 The name of the device for which the memory resource is provided.

Private Attributes

ToolHandle< IMemoryResourceTool > m_mrTool
 Handle to the tool providing the underlying memory resource.
std::unique_ptr< std::pmr::memory_resource > m_cachedMR
 The memory resource that this tool uses for caching.
std::unique_ptr< std::pmr::memory_resource > m_syncedMR
 The memory resource that this tool uses for synchronization.
Service properties
vecmem::pool_memory_resource::options m_opts
 Options object for the underlying pool memory resource.
Gaudi::Property< std::size_t > m_minBlocksPerChunk
Gaudi::Property< std::size_t > m_maxBlocksPerChunk
Gaudi::Property< std::size_t > m_minBytesPerChunk
Gaudi::Property< std::size_t > m_maxBytesPerChunk
Gaudi::Property< std::size_t > m_smallestBlockSize
Gaudi::Property< std::size_t > m_largestBlockSize
Gaudi::Property< std::size_t > m_alignment
Gaudi::Property< bool > m_cacheOversized
Gaudi::Property< std::size_t > m_cachedSizeCutoffFactor
Gaudi::Property< std::size_t > m_cachedAlignmentCutoffFactor

Detailed Description

Service implementing "pooled" caching on top of another memory resource.

Making use of vecmem::pool_memory_resource.

Definition at line 24 of file PoolMemoryResourceSvc.h.

Member Function Documentation

◆ deviceName()

std::string_view AthDevice::PoolMemoryResourceSvc::deviceName ( ) const
overridevirtual

The name of the device for which the memory resource is provided.

Definition at line 40 of file PoolMemoryResourceSvc.cxx.

40 {
41
42 assert(m_mrTool.isValid());
43 return m_mrTool->deviceName();
44}
ToolHandle< IMemoryResourceTool > m_mrTool
Handle to the tool providing the underlying memory resource.

◆ initialize()

StatusCode AthDevice::PoolMemoryResourceSvc::initialize ( )
overridevirtual

Initialize the service.

Definition at line 17 of file PoolMemoryResourceSvc.cxx.

17 {
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::pool_memory_resource>(m_mrTool->mr(), m_opts);
27 std::make_unique<vecmem::synchronized_memory_resource>(*m_cachedMR);
28
29 // Return gracefully.
30 return StatusCode::SUCCESS;
31}
#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.
vecmem::pool_memory_resource::options m_opts
Options object for the underlying pool memory resource.
std::unique_ptr< std::pmr::memory_resource > m_syncedMR
The memory resource that this tool uses for synchronization.

◆ mr()

std::pmr::memory_resource & AthDevice::PoolMemoryResourceSvc::mr ( ) const
overridevirtual

Get the provided std::pmr::memory_resource object.

Definition at line 33 of file PoolMemoryResourceSvc.cxx.

33 {
34
35 assert(m_cachedMR);
36 assert(m_syncedMR);
37 return *m_syncedMR;
38}

Member Data Documentation

◆ m_alignment

Gaudi::Property<std::size_t> AthDevice::PoolMemoryResourceSvc::m_alignment
private
Initial value:
{
this, "Alignment", m_opts.alignment,
[this](Gaudi::Details::PropertyBase&) {
m_opts.alignment = m_alignment;
}}
Gaudi::Property< std::size_t > m_alignment

Definition at line 96 of file PoolMemoryResourceSvc.h.

96 {
97 this, "Alignment", m_opts.alignment,
98 [this](Gaudi::Details::PropertyBase&) {
99 m_opts.alignment = m_alignment;
100 }};

◆ m_cachedAlignmentCutoffFactor

Gaudi::Property<std::size_t> AthDevice::PoolMemoryResourceSvc::m_cachedAlignmentCutoffFactor
private
Initial value:
{
this, "CachedAlignmentCutoffFactor",
m_opts.cached_alignment_cutoff_factor,
[this](Gaudi::Details::PropertyBase&) {
m_opts.cached_alignment_cutoff_factor = m_cachedAlignmentCutoffFactor;
}}
Gaudi::Property< std::size_t > m_cachedAlignmentCutoffFactor

Definition at line 112 of file PoolMemoryResourceSvc.h.

112 {
113 this, "CachedAlignmentCutoffFactor",
114 m_opts.cached_alignment_cutoff_factor,
115 [this](Gaudi::Details::PropertyBase&) {
116 m_opts.cached_alignment_cutoff_factor = m_cachedAlignmentCutoffFactor;
117 }};

◆ m_cachedMR

std::unique_ptr<std::pmr::memory_resource> AthDevice::PoolMemoryResourceSvc::m_cachedMR
private

The memory resource that this tool uses for caching.

Definition at line 54 of file PoolMemoryResourceSvc.h.

◆ m_cachedSizeCutoffFactor

Gaudi::Property<std::size_t> AthDevice::PoolMemoryResourceSvc::m_cachedSizeCutoffFactor
private
Initial value:
{
this, "CachedSizeCutoffFactor", m_opts.cached_size_cutoff_factor,
[this](Gaudi::Details::PropertyBase&) {
m_opts.cached_size_cutoff_factor = m_cachedSizeCutoffFactor;
}}
Gaudi::Property< std::size_t > m_cachedSizeCutoffFactor

Definition at line 107 of file PoolMemoryResourceSvc.h.

107 {
108 this, "CachedSizeCutoffFactor", m_opts.cached_size_cutoff_factor,
109 [this](Gaudi::Details::PropertyBase&) {
110 m_opts.cached_size_cutoff_factor = m_cachedSizeCutoffFactor;
111 }};

◆ m_cacheOversized

Gaudi::Property<bool> AthDevice::PoolMemoryResourceSvc::m_cacheOversized
private
Initial value:
{
this, "CacheOversized", m_opts.cache_oversized,
[this](Gaudi::Details::PropertyBase&) {
m_opts.cache_oversized = m_cacheOversized;
}}

Definition at line 102 of file PoolMemoryResourceSvc.h.

102 {
103 this, "CacheOversized", m_opts.cache_oversized,
104 [this](Gaudi::Details::PropertyBase&) {
105 m_opts.cache_oversized = m_cacheOversized;
106 }};

◆ m_largestBlockSize

Gaudi::Property<std::size_t> AthDevice::PoolMemoryResourceSvc::m_largestBlockSize
private
Initial value:
{
this, "LargestBlockSize", m_opts.largest_block_size,
[this](Gaudi::Details::PropertyBase&) {
m_opts.largest_block_size = m_largestBlockSize;
}}
Gaudi::Property< std::size_t > m_largestBlockSize

Definition at line 90 of file PoolMemoryResourceSvc.h.

90 {
91 this, "LargestBlockSize", m_opts.largest_block_size,
92 [this](Gaudi::Details::PropertyBase&) {
93 m_opts.largest_block_size = m_largestBlockSize;
94 }};

◆ m_maxBlocksPerChunk

Gaudi::Property<std::size_t> AthDevice::PoolMemoryResourceSvc::m_maxBlocksPerChunk
private
Initial value:
{
this, "MaxBlocksPerChunk", m_opts.max_blocks_per_chunk,
[this](Gaudi::Details::PropertyBase&) {
m_opts.max_blocks_per_chunk = m_maxBlocksPerChunk;
}}
Gaudi::Property< std::size_t > m_maxBlocksPerChunk

Definition at line 69 of file PoolMemoryResourceSvc.h.

69 {
70 this, "MaxBlocksPerChunk", m_opts.max_blocks_per_chunk,
71 [this](Gaudi::Details::PropertyBase&) {
72 m_opts.max_blocks_per_chunk = m_maxBlocksPerChunk;
73 }};

◆ m_maxBytesPerChunk

Gaudi::Property<std::size_t> AthDevice::PoolMemoryResourceSvc::m_maxBytesPerChunk
private
Initial value:
{
this, "MaxBytesPerChunk", m_opts.max_bytes_per_chunk,
[this](Gaudi::Details::PropertyBase&) {
m_opts.max_bytes_per_chunk = m_maxBytesPerChunk;
}}
Gaudi::Property< std::size_t > m_maxBytesPerChunk

Definition at line 79 of file PoolMemoryResourceSvc.h.

79 {
80 this, "MaxBytesPerChunk", m_opts.max_bytes_per_chunk,
81 [this](Gaudi::Details::PropertyBase&) {
82 m_opts.max_bytes_per_chunk = m_maxBytesPerChunk;
83 }};

◆ m_minBlocksPerChunk

Gaudi::Property<std::size_t> AthDevice::PoolMemoryResourceSvc::m_minBlocksPerChunk
private
Initial value:
{
this, "MinBlocksPerChunk", m_opts.min_blocks_per_chunk,
[this](Gaudi::Details::PropertyBase&) {
m_opts.min_blocks_per_chunk = m_minBlocksPerChunk;
}}
Gaudi::Property< std::size_t > m_minBlocksPerChunk

Definition at line 64 of file PoolMemoryResourceSvc.h.

64 {
65 this, "MinBlocksPerChunk", m_opts.min_blocks_per_chunk,
66 [this](Gaudi::Details::PropertyBase&) {
67 m_opts.min_blocks_per_chunk = m_minBlocksPerChunk;
68 }};

◆ m_minBytesPerChunk

Gaudi::Property<std::size_t> AthDevice::PoolMemoryResourceSvc::m_minBytesPerChunk
private
Initial value:
{
this, "MinBytesPerChunk", m_opts.min_bytes_per_chunk,
[this](Gaudi::Details::PropertyBase&) {
m_opts.min_bytes_per_chunk = m_minBytesPerChunk;
}}
Gaudi::Property< std::size_t > m_minBytesPerChunk

Definition at line 74 of file PoolMemoryResourceSvc.h.

74 {
75 this, "MinBytesPerChunk", m_opts.min_bytes_per_chunk,
76 [this](Gaudi::Details::PropertyBase&) {
77 m_opts.min_bytes_per_chunk = m_minBytesPerChunk;
78 }};

◆ m_mrTool

ToolHandle<IMemoryResourceTool> AthDevice::PoolMemoryResourceSvc::m_mrTool
private
Initial value:
{
this, "MRTool", "", "Tool providing the memory resource to be cached"}

Handle to the tool providing the underlying memory resource.

Definition at line 51 of file PoolMemoryResourceSvc.h.

51 {
52 this, "MRTool", "", "Tool providing the memory resource to be cached"};

◆ m_opts

vecmem::pool_memory_resource::options AthDevice::PoolMemoryResourceSvc::m_opts
private

Options object for the underlying pool memory resource.

Definition at line 62 of file PoolMemoryResourceSvc.h.

◆ m_smallestBlockSize

Gaudi::Property<std::size_t> AthDevice::PoolMemoryResourceSvc::m_smallestBlockSize
private
Initial value:
{
this, "SmallestBlockSize", m_opts.smallest_block_size,
[this](Gaudi::Details::PropertyBase&) {
m_opts.smallest_block_size = m_smallestBlockSize;
}}
Gaudi::Property< std::size_t > m_smallestBlockSize

Definition at line 85 of file PoolMemoryResourceSvc.h.

85 {
86 this, "SmallestBlockSize", m_opts.smallest_block_size,
87 [this](Gaudi::Details::PropertyBase&) {
88 m_opts.smallest_block_size = m_smallestBlockSize;
89 }};

◆ m_syncedMR

std::unique_ptr<std::pmr::memory_resource> AthDevice::PoolMemoryResourceSvc::m_syncedMR
private

The memory resource that this tool uses for synchronization.

Definition at line 56 of file PoolMemoryResourceSvc.h.


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