ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthCUDA
AthCUDAServices
src
AthCUDA/AthCUDAServices/src/DeviceMemoryResourceTool.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 ATHCUDASERVICES_DEVICEMEMORYRESOURCETOOL_H
5
#define ATHCUDASERVICES_DEVICEMEMORYRESOURCETOOL_H
6
7
// Framework include(s).
8
#include "
AthenaBaseComps/AthAlgTool.h
"
9
10
// AthDevice include(s).
11
#include "
AthDeviceInterfaces/IMemoryResourceTool.h
"
12
13
// VecMem include(s).
14
#include <vecmem/memory/cuda/device_memory_resource.hpp>
15
16
namespace
AthCUDA
{
17
22
class
DeviceMemoryResourceTool
23
:
public
extends<AthAlgTool, AthDevice::IMemoryResourceTool> {
24
25
public
:
26
// Inherit the base class's constructor(s).
27
using
extends::extends;
28
31
33
virtual
StatusCode
initialize
()
override
;
34
36
39
41
virtual
std::pmr::memory_resource&
mr
()
const override
;
42
44
virtual
std::string_view
deviceName
()
const override
;
45
47
48
private
:
50
std::unique_ptr<std::pmr::memory_resource>
m_mr
;
52
std::string
m_deviceName
;
53
56
58
Gaudi::Property<int>
m_deviceID
{
59
this
,
"DeviceID"
, vecmem::cuda::device_memory_resource::INVALID_DEVICE,
60
"ID of the device to allocate memory on (-1 to use the default device)"
};
61
63
64
};
// class DeviceMemoryResourceTool
65
66
}
// namespace AthCUDA
67
68
#endif
// ATHCUDASERVICES_DEVICEMEMORYRESOURCETOOL_H
AthAlgTool.h
IMemoryResourceTool.h
AthCUDA::DeviceMemoryResourceTool
Tool providing memory resource for device memory.
Definition
AthCUDA/AthCUDAServices/src/DeviceMemoryResourceTool.h:23
AthCUDA::DeviceMemoryResourceTool::m_mr
std::unique_ptr< std::pmr::memory_resource > m_mr
The memory resource that this tool uses.
Definition
AthCUDA/AthCUDAServices/src/DeviceMemoryResourceTool.h:50
AthCUDA::DeviceMemoryResourceTool::m_deviceName
std::string m_deviceName
Name of the device for which the memory resource is provided.
Definition
AthCUDA/AthCUDAServices/src/DeviceMemoryResourceTool.h:52
AthCUDA::DeviceMemoryResourceTool::mr
virtual std::pmr::memory_resource & mr() const override
Get the provided std::pmr::memory_resource object.
Definition
AthCUDA/AthCUDAServices/src/DeviceMemoryResourceTool.cxx:56
AthCUDA::DeviceMemoryResourceTool::m_deviceID
Gaudi::Property< int > m_deviceID
Device to allocate memory on.
Definition
AthCUDA/AthCUDAServices/src/DeviceMemoryResourceTool.h:58
AthCUDA::DeviceMemoryResourceTool::deviceName
virtual std::string_view deviceName() const override
The name of the device for which the memory resource is provided.
Definition
AthCUDA/AthCUDAServices/src/DeviceMemoryResourceTool.cxx:62
AthCUDA::DeviceMemoryResourceTool::initialize
virtual StatusCode initialize() override
Initialize the tool.
Definition
AthCUDA/AthCUDAServices/src/DeviceMemoryResourceTool.cxx:16
AthCUDA
Definition
Info.h:14
Generated on
for ATLAS Offline Software by
1.17.0