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:
committed by
Naveen Krishna Chatradhi
vanhempi
dec22a9b44
commit
cdad242947
@@ -1758,7 +1758,7 @@ amdsmi_status_t
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_dev_get_memory_total(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type,
|
||||
amdsmi_get_gpu_memory_total(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type,
|
||||
uint64_t *total);
|
||||
|
||||
/**
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
)
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -931,7 +931,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle,
|
||||
{"rsmi_topo_numa_affinity_get", "amdsmi_get_gpu_topo_numa_affinity"},
|
||||
{"rsmi_dev_gpu_metrics_info_get", " amdsmi_dev_get_gpu_metrics_info"},
|
||||
{"rsmi_dev_gpu_reset", "amdsmi_dev_reset_gpu"},
|
||||
{"rsmi_dev_memory_total_get", "amdsmi_dev_get_memory_total"},
|
||||
{"rsmi_dev_memory_total_get", "amdsmi_get_gpu_memory_total"},
|
||||
{"rsmi_dev_memory_usage_get", "amdsmi_dev_get_memory_usage"},
|
||||
{"rsmi_dev_gpu_clk_freq_get", " amdsmi_dev_get_gpu_clk_freq"},
|
||||
{"rsmi_dev_gpu_clk_freq_set", " amdsmi_dev_set_clk_freq"},
|
||||
@@ -1269,7 +1269,7 @@ amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle processor_handle,
|
||||
num_pages,
|
||||
reinterpret_cast<rsmi_retired_page_record_t*>(records));
|
||||
}
|
||||
amdsmi_status_t amdsmi_dev_get_memory_total(amdsmi_processor_handle processor_handle,
|
||||
amdsmi_status_t amdsmi_get_gpu_memory_total(amdsmi_processor_handle processor_handle,
|
||||
amdsmi_memory_type_t mem_type, uint64_t *total) {
|
||||
return rsmi_wrapper(rsmi_dev_memory_total_get, processor_handle,
|
||||
static_cast<rsmi_memory_type_t>(mem_type), total);
|
||||
|
||||
@@ -131,9 +131,9 @@ void TestMemUtilRead::Run(void) {
|
||||
#endif
|
||||
for (uint32_t mem_type = AMDSMI_MEM_TYPE_FIRST;
|
||||
mem_type <= AMDSMI_MEM_TYPE_LAST; ++mem_type) {
|
||||
err = amdsmi_dev_get_memory_total(processor_handles_[i],
|
||||
err = amdsmi_get_gpu_memory_total(processor_handles_[i],
|
||||
static_cast<amdsmi_memory_type_t>(mem_type), &total);
|
||||
err_chk("amdsmi_dev_get_memory_total()");
|
||||
err_chk("amdsmi_get_gpu_memory_total()");
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ void TestMutualExclusion::Run(void) {
|
||||
amdsmi_set_power_cap
|
||||
amdsmi_dev_get_power_profile_presets
|
||||
amdsmi_set_gpu_power_profile
|
||||
amdsmi_dev_get_memory_total
|
||||
amdsmi_get_gpu_memory_total
|
||||
amdsmi_dev_get_memory_usage
|
||||
amdsmi_dev_get_memory_busy_percent
|
||||
amdsmi_dev_get_busy_percent
|
||||
|
||||
Viittaa uudesa ongelmassa
Block a user