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 tool.
Function(s) inherited from @c IMemoryResourceSvc
virtual std::pmr::memory_resource & mr () const override
 Get the provided std::pmr::memory_resource object.

Private Attributes

ToolHandle< IMemoryResourceToolm_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

◆ initialize()

StatusCode AthDevice::PoolMemoryResourceSvc::initialize ( )
overridevirtual

Initialize the tool.

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.
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.

◆ 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 93 of file PoolMemoryResourceSvc.h.

93 {
94 this, "Alignment", m_opts.alignment,
95 [this](Gaudi::Details::PropertyBase&) {
96 m_opts.alignment = m_alignment;
97 }};

◆ 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 109 of file PoolMemoryResourceSvc.h.

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

◆ 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 51 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 104 of file PoolMemoryResourceSvc.h.

104 {
105 this, "CachedSizeCutoffFactor", m_opts.cached_size_cutoff_factor,
106 [this](Gaudi::Details::PropertyBase&) {
107 m_opts.cached_size_cutoff_factor = m_cachedSizeCutoffFactor;
108 }};

◆ 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;
}}
Gaudi::Property< bool > m_cacheOversized

Definition at line 99 of file PoolMemoryResourceSvc.h.

99 {
100 this, "CacheOversized", m_opts.cache_oversized,
101 [this](Gaudi::Details::PropertyBase&) {
102 m_opts.cache_oversized = m_cacheOversized;
103 }};

◆ 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 87 of file PoolMemoryResourceSvc.h.

87 {
88 this, "LargestBlockSize", m_opts.largest_block_size,
89 [this](Gaudi::Details::PropertyBase&) {
90 m_opts.largest_block_size = m_largestBlockSize;
91 }};

◆ 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 66 of file PoolMemoryResourceSvc.h.

66 {
67 this, "MaxBlocksPerChunk", m_opts.max_blocks_per_chunk,
68 [this](Gaudi::Details::PropertyBase&) {
69 m_opts.max_blocks_per_chunk = m_maxBlocksPerChunk;
70 }};

◆ 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 76 of file PoolMemoryResourceSvc.h.

76 {
77 this, "MaxBytesPerChunk", m_opts.max_bytes_per_chunk,
78 [this](Gaudi::Details::PropertyBase&) {
79 m_opts.max_bytes_per_chunk = m_maxBytesPerChunk;
80 }};

◆ 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 61 of file PoolMemoryResourceSvc.h.

61 {
62 this, "MinBlocksPerChunk", m_opts.min_blocks_per_chunk,
63 [this](Gaudi::Details::PropertyBase&) {
64 m_opts.min_blocks_per_chunk = m_minBlocksPerChunk;
65 }};

◆ 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 71 of file PoolMemoryResourceSvc.h.

71 {
72 this, "MinBytesPerChunk", m_opts.min_bytes_per_chunk,
73 [this](Gaudi::Details::PropertyBase&) {
74 m_opts.min_bytes_per_chunk = m_minBytesPerChunk;
75 }};

◆ 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 48 of file PoolMemoryResourceSvc.h.

48 {
49 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 59 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 82 of file PoolMemoryResourceSvc.h.

82 {
83 this, "SmallestBlockSize", m_opts.smallest_block_size,
84 [this](Gaudi::Details::PropertyBase&) {
85 m_opts.smallest_block_size = m_smallestBlockSize;
86 }};

◆ 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 53 of file PoolMemoryResourceSvc.h.


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