Renamed API amdsmi_dev_get_memory_total to

amdsmi_get_gpu_memory_total

grep -rli 'amdsmi_dev_get_memory_total' * | xargs -i@ sed -i
's/amdsmi_dev_get_memory_total/amdsmi_get_gpu_memory_total/g' @

Change-Id: I06dc20f4bf783c0ee824a6d4b4f7162166c598cb
This commit is contained in:
Deepak Mewar
2023-02-25 08:06:58 -05:00
committed by Naveen Krishna Chatradhi
orang tua dec22a9b44
melakukan cdad242947
9 mengubah file dengan 18 tambahan dan 18 penghapusan
+3 -3
Melihat File
@@ -1558,7 +1558,7 @@ except AmdSmiException as e:
```
## amdsmi_dev_get_memory_total
## amdsmi_get_gpu_memory_total
Description: Get the total amount of memory that exists
@@ -1569,7 +1569,7 @@ Input parameters:
Output: total amount of memory
Exceptions that can be thrown by `amdsmi_dev_get_memory_total` function:
Exceptions that can be thrown by `amdsmi_get_gpu_memory_total` function:
* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`
@@ -1582,7 +1582,7 @@ try:
print("No GPUs on machine")
else:
for device in devices:
memory = amdsmi_dev_get_memory_total(device)
memory = amdsmi_get_gpu_memory_total(device)
print(memory)
except AmdSmiException as e:
print(e)
+1 -1
Melihat File
@@ -148,7 +148,7 @@ from .amdsmi_interface import amdsmi_get_power_ave
from .amdsmi_interface import amdsmi_get_energy_count
# # Memory information
from .amdsmi_interface import amdsmi_dev_get_memory_total
from .amdsmi_interface import amdsmi_get_gpu_memory_total
from .amdsmi_interface import amdsmi_dev_get_memory_usage
from .amdsmi_interface import amdsmi_dev_get_memory_busy_percent
from .amdsmi_interface import amdsmi_dev_get_memory_reserved_pages
+2 -2
Melihat File
@@ -1929,7 +1929,7 @@ def amdsmi_dev_set_clk_range(
)
def amdsmi_dev_get_memory_total(processor_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType):
def amdsmi_get_gpu_memory_total(processor_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType):
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
raise AmdSmiParameterException(
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
@@ -1943,7 +1943,7 @@ def amdsmi_dev_get_memory_total(processor_handle: amdsmi_wrapper.amdsmi_processo
total = ctypes.c_uint64()
_check_res(
amdsmi_wrapper.amdsmi_dev_get_memory_total(
amdsmi_wrapper.amdsmi_get_gpu_memory_total(
processor_handle, mem_type, ctypes.byref(total))
)
+4 -4
Melihat File
@@ -1469,9 +1469,9 @@ amdsmi_set_power_cap.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t]
amdsmi_set_gpu_power_profile = _libraries['libamd_smi.so'].amdsmi_set_gpu_power_profile
amdsmi_set_gpu_power_profile.restype = amdsmi_status_t
amdsmi_set_gpu_power_profile.argtypes = [amdsmi_processor_handle, uint32_t, amdsmi_power_profile_preset_masks_t]
amdsmi_dev_get_memory_total = _libraries['libamd_smi.so'].amdsmi_dev_get_memory_total
amdsmi_dev_get_memory_total.restype = amdsmi_status_t
amdsmi_dev_get_memory_total.argtypes = [amdsmi_processor_handle, amdsmi_memory_type_t, ctypes.POINTER(ctypes.c_uint64)]
amdsmi_get_gpu_memory_total = _libraries['libamd_smi.so'].amdsmi_get_gpu_memory_total
amdsmi_get_gpu_memory_total.restype = amdsmi_status_t
amdsmi_get_gpu_memory_total.argtypes = [amdsmi_processor_handle, amdsmi_memory_type_t, ctypes.POINTER(ctypes.c_uint64)]
amdsmi_dev_get_memory_usage = _libraries['libamd_smi.so'].amdsmi_dev_get_memory_usage
amdsmi_dev_get_memory_usage.restype = amdsmi_status_t
amdsmi_dev_get_memory_usage.argtypes = [amdsmi_processor_handle, amdsmi_memory_type_t, ctypes.POINTER(ctypes.c_uint64)]
@@ -1859,7 +1859,7 @@ __all__ = \
'amdsmi_dev_get_gpu_clk_freq', 'amdsmi_dev_get_gpu_metrics_info',
'amdsmi_get_gpu_id', 'amdsmi_dev_get_memory_busy_percent',
'amdsmi_dev_get_memory_reserved_pages',
'amdsmi_dev_get_memory_total', 'amdsmi_dev_get_memory_usage',
'amdsmi_get_gpu_memory_total', 'amdsmi_dev_get_memory_usage',
'amdsmi_dev_get_od_volt_curve_regions',
'amdsmi_dev_get_od_volt_info', 'amdsmi_dev_get_overdrive_level',
'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_get_gpu_pci_id',
+2 -2
Melihat File
@@ -300,7 +300,7 @@ class Formatter:
| """ + 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_get_power_ave <bdf><sensor_id>") + """ |
| """ + self.style.text("13 Get device energy count. Api: amdsmi_get_energy_count <bdf>") + """ |
| """ + self.style.text("14 Get device memory total. Api: amdsmi_dev_get_memory_total <bdf>") + """ |
| """ + self.style.text("14 Get device memory total. Api: amdsmi_get_gpu_memory_total <bdf>") + """ |
| """ + self.style.text("15 Get device memory usage. Api: amdsmi_dev_get_memory_usage <bdf>") + """ |
| """ + self.style.text("16 Get device memory busy percent. Api: amdsmi_dev_get_memory_busy_percent <bdf>") + """ |
| """ + self.style.text("17 Get device memory reserved pages. Api: amdsmi_dev_get_memory_reserved_pages <bdf>") + """ |
@@ -383,7 +383,7 @@ def amdsmi_tool_dev_memory_total_get(dev):
result = {}
for memory_type in smi_api.AmdSmiMemoryType:
try:
value = smi_api.amdsmi_dev_get_memory_total(dev, memory_type)
value = smi_api.amdsmi_get_gpu_memory_total(dev, memory_type)
result.update({memory_type.name: value})
except smi_api.AmdSmiException as e:
print("{}:\t{}".format(memory_type.name, e))