Renamed API amdsmi_dev_get_power_ave to

amdsmi_get_power_ave

grep -rli 'amdsmi_dev_get_power_ave' * | xargs -i@ sed -i
's/amdsmi_dev_get_power_ave/amdsmi_get_power_ave/g' @

Change-Id: Ie10de251d1e7b884b6233af05b37ff7b56075d4b
Этот коммит содержится в:
Deepak Mewar authored and Naveen Krishna Chatradhi committed 2023-05-11 10:41:08 -04:00
1 родитель cc1a9d4522
Коммит 394a1b4d67
9 files changed
+19 -19

No files matched your search

+3 -3
Просмотреть файл
@@ -1490,7 +1490,7 @@ except AmdSmiException as e:
print(e)
```
## amdsmi_dev_get_power_ave
## amdsmi_get_power_ave
Description: Get the average power consumption of the device
@@ -1502,7 +1502,7 @@ If a device has more than one sensor, it could be greater than 0.
Output: the average power consumption
Exceptions that can be thrown by `amdsmi_dev_get_power_ave` function:
Exceptions that can be thrown by `amdsmi_get_power_ave` function:
* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`
@@ -1515,7 +1515,7 @@ try:
print("No GPUs on machine")
else:
for device in devices:
power = amdsmi_dev_get_power_ave(device)
power = amdsmi_get_power_ave(device)
print(power)
except AmdSmiException as e:
print(e)
+1 -1
Просмотреть файл
@@ -144,7 +144,7 @@ from .amdsmi_interface import amdsmi_get_gpu_pci_replay_counter
from .amdsmi_interface import amdsmi_get_gpu_topo_numa_affinity
# # Power information
from .amdsmi_interface import amdsmi_dev_get_power_ave
from .amdsmi_interface import amdsmi_get_power_ave
from .amdsmi_interface import amdsmi_dev_get_energy_count
# # Memory information
+2 -2
Просмотреть файл
@@ -1838,7 +1838,7 @@ def amdsmi_dev_set_power_cap(
)
def amdsmi_dev_get_power_ave(processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_id: ctypes.c_uint32):
def amdsmi_get_power_ave(processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_id: ctypes.c_uint32):
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
raise AmdSmiParameterException(
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
@@ -1847,7 +1847,7 @@ def amdsmi_dev_get_power_ave(processor_handle: amdsmi_wrapper.amdsmi_processor_h
power = ctypes.c_uint64()
_check_res(
amdsmi_wrapper.amdsmi_dev_get_power_ave(
amdsmi_wrapper.amdsmi_get_power_ave(
processor_handle, sensor_id, ctypes.byref(power))
)
+4 -4
Просмотреть файл
@@ -1457,9 +1457,9 @@ amdsmi_get_gpu_pci_replay_counter.argtypes = [amdsmi_processor_handle, ctypes.PO
amdsmi_set_gpu_pci_bandwidth = _libraries['libamd_smi.so'].amdsmi_set_gpu_pci_bandwidth
amdsmi_set_gpu_pci_bandwidth.restype = amdsmi_status_t
amdsmi_set_gpu_pci_bandwidth.argtypes = [amdsmi_processor_handle, uint64_t]
amdsmi_dev_get_power_ave = _libraries['libamd_smi.so'].amdsmi_dev_get_power_ave
amdsmi_dev_get_power_ave.restype = amdsmi_status_t
amdsmi_dev_get_power_ave.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_uint64)]
amdsmi_get_power_ave = _libraries['libamd_smi.so'].amdsmi_get_power_ave
amdsmi_get_power_ave.restype = amdsmi_status_t
amdsmi_get_power_ave.argtypes = [amdsmi_processor_handle, uint32_t, ctypes.POINTER(ctypes.c_uint64)]
amdsmi_dev_get_energy_count = _libraries['libamd_smi.so'].amdsmi_dev_get_energy_count
amdsmi_dev_get_energy_count.restype = amdsmi_status_t
amdsmi_dev_get_energy_count.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_uint64)]
@@ -1865,7 +1865,7 @@ __all__ = \
'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_get_gpu_pci_id',
'amdsmi_get_gpu_pci_replay_counter',
'amdsmi_get_gpu_pci_throughput', 'amdsmi_dev_get_perf_level',
'amdsmi_dev_get_power_ave',
'amdsmi_get_power_ave',
'amdsmi_dev_get_power_profile_presets',
'amdsmi_get_gpu_subsystem_id', 'amdsmi_get_gpu_subsystem_name',
'amdsmi_dev_get_temp_metric', 'amdsmi_get_gpu_vendor_name',
+2 -2
Просмотреть файл
@@ -298,7 +298,7 @@ class Formatter:
| """ + self.style.text(" 9 Get device pci throughput. Api: amdsmi_get_gpu_pci_throughput <bdf>") + """ |
| """ + self.style.text("10 Get device pci replay counter. Api: amdsmi_get_gpu_pci_replay_counter <bdf>") + """ |
| """ + self.style.text("11 Get topo numa affinity. Api: amdsmi_get_gpu_topo_numa_affinity <bdf>") + """ |
| """ + self.style.text("12 Get device power ave. Api: amdsmi_dev_get_power_ave <bdf><sensor_id>") + """ |
| """ + self.style.text("12 Get device power ave. Api: amdsmi_get_power_ave <bdf><sensor_id>") + """ |
| """ + self.style.text("13 Get device energy count. Api: amdsmi_dev_get_energy_count <bdf>") + """ |
| """ + self.style.text("14 Get device memory total. Api: amdsmi_dev_get_memory_total <bdf>") + """ |
| """ + self.style.text("15 Get device memory usage. Api: amdsmi_dev_get_memory_usage <bdf>") + """ |
@@ -377,7 +377,7 @@ class Formatter:
##############################################
def amdsmi_tool_dev_power_ave_get(dev, dic):
sensor_id = dic["sensor_id"]
return smi_api.amdsmi_dev_get_power_ave(dev, ctypes.c_uint32(sensor_id))
return smi_api.amdsmi_get_power_ave(dev, ctypes.c_uint32(sensor_id))
def amdsmi_tool_dev_memory_total_get(dev):
result = {}