ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthDevice
AthDeviceComps
src
PoolMemoryResourceSvc.h
Go to the documentation of this file.
1
//
2
// Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
//
4
#ifndef ATHDEVICECOMPS_POOLMEMORYRESOURCESVC_H
5
#define ATHDEVICECOMPS_POOLMEMORYRESOURCESVC_H
6
7
// Framework include(s).
8
#include "
AthenaBaseComps/AthService.h
"
9
#include "GaudiKernel/ToolHandle.h"
10
11
// AthDevice include(s).
12
#include "
AthDeviceInterfaces/IMemoryResourceSvc.h
"
13
#include "
AthDeviceInterfaces/IMemoryResourceTool.h
"
14
15
// VecMem include(s).
16
#include <vecmem/memory/pool_memory_resource.hpp>
17
18
namespace
AthDevice
{
19
24
class
PoolMemoryResourceSvc
:
public
extends<AthService, IMemoryResourceSvc> {
25
26
public
:
27
// Inherit the base class's constructor(s).
28
using
extends::extends;
29
32
34
virtual
StatusCode
initialize
()
override
;
35
37
40
42
virtual
std::pmr::memory_resource&
mr
()
const override
;
43
45
46
private
:
48
ToolHandle<IMemoryResourceTool>
m_mrTool
{
49
this
,
"MRTool"
,
""
,
"Tool providing the memory resource to be cached"
};
50
51
std::unique_ptr<std::pmr::memory_resource>
m_cachedMR
;
53
std::unique_ptr<std::pmr::memory_resource>
m_syncedMR
;
54
57
59
vecmem::pool_memory_resource::options
m_opts
;
60
61
Gaudi::Property<std::size_t>
m_minBlocksPerChunk
{
62
this
,
"MinBlocksPerChunk"
,
m_opts
.min_blocks_per_chunk,
63
[
this
](Gaudi::Details::PropertyBase&) {
64
m_opts
.min_blocks_per_chunk =
m_minBlocksPerChunk
;
65
}};
66
Gaudi::Property<std::size_t>
m_maxBlocksPerChunk
{
67
this
,
"MaxBlocksPerChunk"
,
m_opts
.max_blocks_per_chunk,
68
[
this
](Gaudi::Details::PropertyBase&) {
69
m_opts
.max_blocks_per_chunk =
m_maxBlocksPerChunk
;
70
}};
71
Gaudi::Property<std::size_t>
m_minBytesPerChunk
{
72
this
,
"MinBytesPerChunk"
,
m_opts
.min_bytes_per_chunk,
73
[
this
](Gaudi::Details::PropertyBase&) {
74
m_opts
.min_bytes_per_chunk =
m_minBytesPerChunk
;
75
}};
76
Gaudi::Property<std::size_t>
m_maxBytesPerChunk
{
77
this
,
"MaxBytesPerChunk"
,
m_opts
.max_bytes_per_chunk,
78
[
this
](Gaudi::Details::PropertyBase&) {
79
m_opts
.max_bytes_per_chunk =
m_maxBytesPerChunk
;
80
}};
81
82
Gaudi::Property<std::size_t>
m_smallestBlockSize
{
83
this
,
"SmallestBlockSize"
,
m_opts
.smallest_block_size,
84
[
this
](Gaudi::Details::PropertyBase&) {
85
m_opts
.smallest_block_size =
m_smallestBlockSize
;
86
}};
87
Gaudi::Property<std::size_t>
m_largestBlockSize
{
88
this
,
"LargestBlockSize"
,
m_opts
.largest_block_size,
89
[
this
](Gaudi::Details::PropertyBase&) {
90
m_opts
.largest_block_size =
m_largestBlockSize
;
91
}};
92
93
Gaudi::Property<std::size_t>
m_alignment
{
94
this
,
"Alignment"
,
m_opts
.alignment,
95
[
this
](Gaudi::Details::PropertyBase&) {
96
m_opts
.alignment =
m_alignment
;
97
}};
98
99
Gaudi::Property<bool>
m_cacheOversized
{
100
this
,
"CacheOversized"
,
m_opts
.cache_oversized,
101
[
this
](Gaudi::Details::PropertyBase&) {
102
m_opts
.cache_oversized =
m_cacheOversized
;
103
}};
104
Gaudi::Property<std::size_t>
m_cachedSizeCutoffFactor
{
105
this
,
"CachedSizeCutoffFactor"
,
m_opts
.cached_size_cutoff_factor,
106
[
this
](Gaudi::Details::PropertyBase&) {
107
m_opts
.cached_size_cutoff_factor =
m_cachedSizeCutoffFactor
;
108
}};
109
Gaudi::Property<std::size_t>
m_cachedAlignmentCutoffFactor
{
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
}};
115
117
118
};
// class PoolMemoryResourceSvc
119
120
}
// namespace AthDevice
121
122
#endif
// ATHDEVICECOMPS_POOLMEMORYRESOURCESVC_H
AthService.h
IMemoryResourceSvc.h
IMemoryResourceTool.h
AthDevice::PoolMemoryResourceSvc
Service implementing "pooled" caching on top of another memory resource.
Definition
PoolMemoryResourceSvc.h:24
AthDevice::PoolMemoryResourceSvc::m_minBytesPerChunk
Gaudi::Property< std::size_t > m_minBytesPerChunk
Definition
PoolMemoryResourceSvc.h:71
AthDevice::PoolMemoryResourceSvc::m_alignment
Gaudi::Property< std::size_t > m_alignment
Definition
PoolMemoryResourceSvc.h:93
AthDevice::PoolMemoryResourceSvc::m_largestBlockSize
Gaudi::Property< std::size_t > m_largestBlockSize
Definition
PoolMemoryResourceSvc.h:87
AthDevice::PoolMemoryResourceSvc::m_smallestBlockSize
Gaudi::Property< std::size_t > m_smallestBlockSize
Definition
PoolMemoryResourceSvc.h:82
AthDevice::PoolMemoryResourceSvc::m_cacheOversized
Gaudi::Property< bool > m_cacheOversized
Definition
PoolMemoryResourceSvc.h:99
AthDevice::PoolMemoryResourceSvc::initialize
virtual StatusCode initialize() override
Initialize the tool.
Definition
PoolMemoryResourceSvc.cxx:17
AthDevice::PoolMemoryResourceSvc::m_cachedAlignmentCutoffFactor
Gaudi::Property< std::size_t > m_cachedAlignmentCutoffFactor
Definition
PoolMemoryResourceSvc.h:109
AthDevice::PoolMemoryResourceSvc::m_maxBlocksPerChunk
Gaudi::Property< std::size_t > m_maxBlocksPerChunk
Definition
PoolMemoryResourceSvc.h:66
AthDevice::PoolMemoryResourceSvc::m_cachedMR
std::unique_ptr< std::pmr::memory_resource > m_cachedMR
The memory resource that this tool uses for caching.
Definition
PoolMemoryResourceSvc.h:51
AthDevice::PoolMemoryResourceSvc::m_maxBytesPerChunk
Gaudi::Property< std::size_t > m_maxBytesPerChunk
Definition
PoolMemoryResourceSvc.h:76
AthDevice::PoolMemoryResourceSvc::m_opts
vecmem::pool_memory_resource::options m_opts
Options object for the underlying pool memory resource.
Definition
PoolMemoryResourceSvc.h:59
AthDevice::PoolMemoryResourceSvc::m_cachedSizeCutoffFactor
Gaudi::Property< std::size_t > m_cachedSizeCutoffFactor
Definition
PoolMemoryResourceSvc.h:104
AthDevice::PoolMemoryResourceSvc::mr
virtual std::pmr::memory_resource & mr() const override
Get the provided std::pmr::memory_resource object.
Definition
PoolMemoryResourceSvc.cxx:33
AthDevice::PoolMemoryResourceSvc::m_mrTool
ToolHandle< IMemoryResourceTool > m_mrTool
Handle to the tool providing the underlying memory resource.
Definition
PoolMemoryResourceSvc.h:48
AthDevice::PoolMemoryResourceSvc::m_syncedMR
std::unique_ptr< std::pmr::memory_resource > m_syncedMR
The memory resource that this tool uses for synchronization.
Definition
PoolMemoryResourceSvc.h:53
AthDevice::PoolMemoryResourceSvc::m_minBlocksPerChunk
Gaudi::Property< std::size_t > m_minBlocksPerChunk
Definition
PoolMemoryResourceSvc.h:61
AthDevice
Definition
BinaryPageMemoryResourceSvc.cxx:15
Generated on
for ATLAS Offline Software by
1.17.0