geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
NVMLGPUTopo.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 - 2024 Intel Corporation
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef NVMLGPUTOPO_HPP_INCLUDE
7 #define NVMLGPUTOPO_HPP_INCLUDE
8 
9 #include <cstdint>
10 #include <vector>
11 #include <set>
12 
13 #include "GPUTopo.hpp"
14 
15 namespace geopm
16 {
17  class NVMLDevicePool;
18 
19  class NVMLGPUTopo : public GPUTopo
20  {
21  public:
22  NVMLGPUTopo();
23  NVMLGPUTopo(const NVMLDevicePool &device_pool, const int num_cpu);
24  virtual ~NVMLGPUTopo() = default;
25  int num_gpu(void) const override;
26  int num_gpu(int domain_type) const override;
27  std::set<int> cpu_affinity_ideal(int gpu_idx) const override;
28  std::set<int> cpu_affinity_ideal(int domain_type, int gpu_idx) const override;
29  private:
30  const NVMLDevicePool &m_nvml_device_pool;
31  std::vector<std::set<int> > m_cpu_affinity_ideal;
32  };
33 }
34 #endif
Definition: GPUTopo.hpp:16
Definition: NVMLDevicePool.hpp:19
Definition: NVMLGPUTopo.hpp:20
int num_gpu(void) const override
Number of GPUs on the platform.
Definition: NVMLGPUTopo.cpp:103
NVMLGPUTopo()
Definition: NVMLGPUTopo.cpp:20
virtual ~NVMLGPUTopo()=default
std::set< int > cpu_affinity_ideal(int gpu_idx) const override
CPU Affinitization set for a particular GPU.
Definition: NVMLGPUTopo.cpp:115
Definition: Agg.cpp:20