ATLAS Offline Software
Loading...
Searching...
No Matches
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).
9
10// AthDevice include(s).
12
13// VecMem include(s).
14#include <vecmem/memory/cuda/device_memory_resource.hpp>
15
16namespace AthCUDA {
17
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
40 virtual std::pmr::memory_resource& mr() const override;
41
43
44 private:
46 std::unique_ptr<std::pmr::memory_resource> m_mr;
47
50
52 Gaudi::Property<int> m_deviceID{
53 this, "DeviceID", vecmem::cuda::device_memory_resource::INVALID_DEVICE,
54 "ID of the device to allocate memory on (-1 to use the default device)"};
55
57
58}; // class DeviceMemoryResourceTool
59
60} // namespace AthCUDA
61
62#endif // ATHCUDASERVICES_DEVICEMEMORYRESOURCETOOL_H
Tool providing memory resource for device memory.
std::unique_ptr< std::pmr::memory_resource > m_mr
The memory resource that this tool uses.
virtual std::pmr::memory_resource & mr() const override
Gaudi::Property< int > m_deviceID
Device to allocate memory on.
virtual StatusCode initialize() override
Initialize the tool.
Definition Info.h:14