geopm  3.1.0
GEOPM - Global Extensible Open Power Manager
All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Pages
LevelZeroDevicePoolImp.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 LEVELZERODEVICEPOOLIMP_HPP_INCLUDE
7 #define LEVELZERODEVICEPOOLIMP_HPP_INCLUDE
8 
9 #include <string>
10 #include <cstdint>
11 
12 #include "LevelZeroDevicePool.hpp"
13 #include "LevelZero.hpp"
14 
15 #include "geopm_time.h"
16 
17 namespace geopm
18 {
20  {
21  public:
24  virtual ~LevelZeroDevicePoolImp() = default;
25  int num_gpu(int domain_type) const override;
26  double ras_reset_count(int domain, unsigned int domain_idx,
27  int l0_domain) const override;
28  double ras_programming_errcount(int domain, unsigned int domain_idx,
29  int l0_domain) const override;
30  double ras_driver_errcount(int domain, unsigned int domain_idx,
31  int l0_domain) const override;
32  double ras_compute_errcount(int domain, unsigned int domain_idx,
33  int l0_domain) const override;
34  double ras_noncompute_errcount(int domain, unsigned int domain_idx,
35  int l0_domain) const override;
36  double ras_cache_errcount(int domain, unsigned int domain_idx,
37  int l0_domain) const override;
38  double ras_display_errcount(int domain, unsigned int domain_idx,
39  int l0_domain) const override;
40  double frequency_status(int domain, unsigned int domain_idx,
41  int l0_domain) const override;
42  double frequency_efficient(int domain, unsigned int domain_idx,
43  int l0_domain) const override;
44  double frequency_min(int domain, unsigned int domain_idx,
45  int l0_domain) const override;
46  double frequency_max(int domain, unsigned int domain_idx,
47  int l0_domain) const override;
48  double frequency_step(int domain, unsigned int domain_idx,
49  int l0_domain) const override;
50  uint32_t frequency_throttle_reasons(int domain, unsigned int domain_idx,
51  int l0_domain) const override;
52  std::pair <double, double> frequency_range(int domain,
53  unsigned int domain_idx,
54  int l0_domain) const override;
55  double temperature_max(int domain, unsigned int domain_idx,
56  int l0_domain) const override;
57  std::pair<uint64_t, uint64_t> active_time_pair(int domain,
58  unsigned int device_idx,
59  int l0_domain) const override;
60  uint64_t active_time(int domain, unsigned int device_idx,
61  int l0_domain) const override;
62  uint64_t active_time_timestamp(int domain, unsigned int device_idx,
63  int l0_domain) const override;
64  int32_t power_limit_tdp(int domain, unsigned int domain_idx,
65  int l0_domain) const override;
66  int32_t power_limit_min(int domain, unsigned int domain_idx,
67  int l0_domain) const override;
68  int32_t power_limit_max(int domain, unsigned int domain_idx,
69  int l0_domain) const override;
70  std::pair<uint64_t, uint64_t> energy_pair(int domain, unsigned int domain_idx,
71  int l0_domain) const override;
72  uint64_t energy(int domain, unsigned int domain_idx, int l0_domain) const override;
73  uint64_t energy_timestamp(int domain, unsigned int domain_idx,
74  int l0_domain) const override;
75  double performance_factor(int domain,
76  unsigned int domain_idx,
77  int l0_domain) const override;
78  void frequency_control(int domain, unsigned int domain_idx,
79  int l0_domain, double range_min,
80  double range_max) const override;
81  void performance_factor_control(int domain, unsigned int domain_idx,
82  int l0_domain,
83  double setting) const override;
84 
85  private:
86  const LevelZero &m_levelzero;
87 
88  void check_idx_range(int domain, unsigned int domain_idx) const;
89  void check_domain_exists(int size, const char *func, int line) const;
90  std::pair<unsigned int, unsigned int> subdevice_device_conversion(unsigned int idx) const;
91  };
92 }
93 #endif
Definition: LevelZeroDevicePool.hpp:19
Definition: LevelZeroDevicePoolImp.hpp:20
double frequency_min(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero device mininmum frequency in MHz.
Definition: LevelZeroDevicePool.cpp:252
double ras_display_errcount(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero count of number of errors that have occurred in the display.
Definition: LevelZeroDevicePool.cpp:198
void performance_factor_control(int domain, unsigned int domain_idx, int l0_domain, double setting) const override
Set performance factor for LevelZero device.
Definition: LevelZeroDevicePool.cpp:605
double ras_cache_errcount(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero count of number of errors that have occurred in caches (L1/L3/register file/shared ...
Definition: LevelZeroDevicePool.cpp:180
double frequency_status(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero device actual frequency in MHz.
Definition: LevelZeroDevicePool.cpp:216
uint32_t frequency_throttle_reasons(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero device frequency throttle reasons.
Definition: LevelZeroDevicePool.cpp:316
double temperature_max(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero domain maximum temperature in Celsius.
Definition: LevelZeroDevicePool.cpp:354
double performance_factor(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero device performance factor.
Definition: LevelZeroDevicePool.cpp:563
double ras_driver_errcount(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero count of number of low level driver communication errors have occurred.
Definition: LevelZeroDevicePool.cpp:126
uint64_t active_time(int domain, unsigned int device_idx, int l0_domain) const override
Get the LevelZero device timestamp for the active time value in microseconds.
Definition: LevelZeroDevicePool.cpp:415
LevelZeroDevicePoolImp()
Definition: LevelZeroDevicePool.cpp:31
double frequency_step(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero device frequency step in MHz.
Definition: LevelZeroDevicePool.cpp:288
double frequency_efficient(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero device efficient frequency in MHz.
Definition: LevelZeroDevicePool.cpp:234
void frequency_control(int domain, unsigned int domain_idx, int l0_domain, double range_min, double range_max) const override
Set min and max frequency for LevelZero device.
Definition: LevelZeroDevicePool.cpp:585
virtual ~LevelZeroDevicePoolImp()=default
std::pair< double, double > frequency_range(int domain, unsigned int domain_idx, int l0_domain) const override
Definition: LevelZeroDevicePool.cpp:334
uint64_t energy(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero device energy in microjoules.
Definition: LevelZeroDevicePool.cpp:536
double ras_compute_errcount(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero count of number of errors that have occurred in the compute accelerator hardware.
Definition: LevelZeroDevicePool.cpp:144
int32_t power_limit_min(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero device minimum power limit in milliwatts.
Definition: LevelZeroDevicePool.cpp:434
double frequency_max(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero device maximum frequency in MHz.
Definition: LevelZeroDevicePool.cpp:270
std::pair< uint64_t, uint64_t > energy_pair(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero device energy in microjoules and timestamp in microseconds.
Definition: LevelZeroDevicePool.cpp:475
uint64_t energy_timestamp(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero device energy timestamp in microseconds.
Definition: LevelZeroDevicePool.cpp:505
int32_t power_limit_max(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero device maximum power limit in milliwatts.
Definition: LevelZeroDevicePool.cpp:447
uint64_t active_time_timestamp(int domain, unsigned int device_idx, int l0_domain) const override
Get the LevelZero device timestamp for the active time value in microseconds.
Definition: LevelZeroDevicePool.cpp:394
int32_t power_limit_tdp(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero device default power limit in milliwatts.
Definition: LevelZeroDevicePool.cpp:461
std::pair< uint64_t, uint64_t > active_time_pair(int domain, unsigned int device_idx, int l0_domain) const override
Get the LevelZero device active time and timestamp in microseconds.
Definition: LevelZeroDevicePool.cpp:373
int num_gpu(int domain_type) const override
Number of GPUs on the platform.
Definition: LevelZeroDevicePool.cpp:36
double ras_programming_errcount(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero count of number of hardware exceptions generated by the way workloads have programm...
Definition: LevelZeroDevicePool.cpp:108
double ras_reset_count(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero count of number of accelerator engine resets attempted by the driver.
Definition: LevelZeroDevicePool.cpp:90
double ras_noncompute_errcount(int domain, unsigned int domain_idx, int l0_domain) const override
Get the LevelZero count of number of errors that have occurred in the fixed-function accelerator hard...
Definition: LevelZeroDevicePool.cpp:162
Definition: LevelZero.hpp:18
Definition: Agg.cpp:20
const LevelZero & levelzero()
Definition: LevelZero.cpp:20