Renamed API amdsmi_dev_get_id to amdsmi_get_gpu_id

grep -rli 'amdsmi_dev_get_id' * | xargs -i@ sed -i
's/amdsmi_dev_get_id/amdsmi_get_gpu_id/g' @

Change-Id: I78faeff9a94250454bcecfaa50b5c7cc7e04cb98


[ROCm/amdsmi commit: 20222f771e]
Этот коммит содержится в:
Deepak Mewar
2023-02-25 06:58:22 -05:00
коммит произвёл Naveen Krishna Chatradhi
родитель cb1d3ef3ce
Коммит 365abf6b0e
10 изменённых файлов: 20 добавлений и 20 удалений
+1 -1
Просмотреть файл
@@ -1317,7 +1317,7 @@ amdsmi_status_t amdsmi_get_processor_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_pr
*
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
*/
amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle processor_handle, uint16_t *id);
amdsmi_status_t amdsmi_get_gpu_id(amdsmi_processor_handle processor_handle, uint16_t *id);
/**
* @brief Get the name string for a give vendor ID
+3 -3
Просмотреть файл
@@ -2902,7 +2902,7 @@ except AmdSmiException as e:
print(e)
```
## amdsmi_dev_get_id
## amdsmi_get_gpu_id
Description: Get the device id associated with the device with provided device handler
Input parameters:
@@ -2911,7 +2911,7 @@ Input parameters:
Output: device id
Exceptions that can be thrown by `amdsmi_dev_get_id` function:
Exceptions that can be thrown by `amdsmi_get_gpu_id` function:
* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`
@@ -2924,7 +2924,7 @@ try:
print("No GPUs on machine")
else:
for device in devices:
dev_id = amdsmi_dev_get_id(device)
dev_id = amdsmi_get_gpu_id(device)
print(dev_id)
except AmdSmiException as e:
print(e)
+1 -1
Просмотреть файл
@@ -158,7 +158,7 @@ from .amdsmi_interface import AmdSmiEventReader
# # Device Identification information
from .amdsmi_interface import amdsmi_dev_get_vendor_name
from .amdsmi_interface import amdsmi_dev_get_id
from .amdsmi_interface import amdsmi_get_gpu_id
from .amdsmi_interface import amdsmi_dev_get_vram_vendor
from .amdsmi_interface import amdsmi_dev_get_drm_render_minor
from .amdsmi_interface import amdsmi_dev_get_subsystem_id
+2 -2
Просмотреть файл
@@ -1089,14 +1089,14 @@ def amdsmi_dev_get_vendor_name(
return vendor_name.value.decode("utf-8")
def amdsmi_dev_get_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle):
def amdsmi_get_gpu_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle):
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
raise AmdSmiParameterException(
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
)
id = ctypes.c_uint16()
_check_res(amdsmi_wrapper.amdsmi_dev_get_id(
_check_res(amdsmi_wrapper.amdsmi_get_gpu_id(
processor_handle, ctypes.byref(id)))
return id.value
+4 -4
Просмотреть файл
@@ -1420,9 +1420,9 @@ amdsmi_get_processor_type.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c_
amdsmi_get_processor_handle_from_bdf = _libraries['libamd_smi.so'].amdsmi_get_processor_handle_from_bdf
amdsmi_get_processor_handle_from_bdf.restype = amdsmi_status_t
amdsmi_get_processor_handle_from_bdf.argtypes = [amdsmi_bdf_t, ctypes.POINTER(ctypes.POINTER(None))]
amdsmi_dev_get_id = _libraries['libamd_smi.so'].amdsmi_dev_get_id
amdsmi_dev_get_id.restype = amdsmi_status_t
amdsmi_dev_get_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)]
amdsmi_get_gpu_id = _libraries['libamd_smi.so'].amdsmi_get_gpu_id
amdsmi_get_gpu_id.restype = amdsmi_status_t
amdsmi_get_gpu_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)]
amdsmi_dev_get_vendor_name = _libraries['libamd_smi.so'].amdsmi_dev_get_vendor_name
amdsmi_dev_get_vendor_name.restype = amdsmi_status_t
amdsmi_dev_get_vendor_name.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), size_t]
@@ -1857,7 +1857,7 @@ __all__ = \
'amdsmi_dev_get_energy_count', 'amdsmi_dev_get_fan_rpms',
'amdsmi_dev_get_fan_speed', 'amdsmi_dev_get_fan_speed_max',
'amdsmi_dev_get_gpu_clk_freq', 'amdsmi_dev_get_gpu_metrics_info',
'amdsmi_dev_get_id', 'amdsmi_dev_get_memory_busy_percent',
'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_dev_get_od_volt_curve_regions',
+2 -2
Просмотреть файл
@@ -288,7 +288,7 @@ class Formatter:
| """ + self.style.header("COMMANDS:") + """ |
| |
| """ + self.style.text(" 1 Get device vendor name. Api: amdsmi_dev_get_vendor_name <bdf>") + """ |
| """ + self.style.text(" 2 Get device id. Api: amdsmi_dev_get_id <bdf>") + """ |
| """ + self.style.text(" 2 Get device id. Api: amdsmi_get_gpu_id <bdf>") + """ |
| """ + self.style.text(" 3 Get device vram vendor. Api: amdsmi_dev_get_vram_vendor <bdf>") + """ |
| """ + self.style.text(" 4 Get device drm render minor. Api: amdsmi_dev_get_drm_render_minor <bdf>") + """ |
| """ + self.style.text(" 5 Get device subsystem id. Api: amdsmi_dev_get_subsystem_id <bdf>") + """ |
@@ -725,7 +725,7 @@ commands = {
1: [smi_api.amdsmi_dev_get_vendor_name, {
"device_identifier1": [None, True]
}],
2: [smi_api.amdsmi_dev_get_id, {
2: [smi_api.amdsmi_get_gpu_id, {
"device_identifier1": [None, True]
}],
3: [smi_api.amdsmi_dev_get_vram_vendor, {
+2 -2
Просмотреть файл
@@ -507,7 +507,7 @@ amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle processor_handl
sensor_ind, speed);
}
amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle processor_handle,
amdsmi_status_t amdsmi_get_gpu_id(amdsmi_processor_handle processor_handle,
uint16_t *id) {
return rsmi_wrapper(rsmi_dev_id_get, processor_handle, id);
}
@@ -889,7 +889,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle,
static const std::map<std::string, const char*> rsmi_2_amdsmi = {
{"rsmi_dev_vram_vendor_get", "amdsmi_dev_get_vram_vendor"},
{"rsmi_dev_id_get", "amdsmi_dev_get_id"},
{"rsmi_dev_id_get", "amdsmi_get_gpu_id"},
{"rsmi_dev_vendor_id_get", "amdsmi_get_asic_info"},
{"rsmi_dev_name_get", "amdsmi_get_board_info"},
{"rsmi_dev_sku_get", "amdsmi_get_board_info"},
+3 -3
Просмотреть файл
@@ -105,11 +105,11 @@ void TestIdInfoRead::Run(void) {
}
// Get the device ID, name, vendor ID and vendor name for the device
err = amdsmi_dev_get_id(processor_handles_[i], &id);
err = amdsmi_get_gpu_id(processor_handles_[i], &id);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
amdsmi_status_t ret;
// Verify api support checking functionality is working
ret = amdsmi_dev_get_id(processor_handles_[i], nullptr);
ret = amdsmi_get_gpu_id(processor_handles_[i], nullptr);
ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED);
} else {
CHK_ERR_ASRT(err)
@@ -118,7 +118,7 @@ void TestIdInfoRead::Run(void) {
std::cout << "\t**Device ID: 0x" << std::hex << id << std::endl;
}
// Verify api support checking functionality is working
err = amdsmi_dev_get_id(processor_handles_[i], nullptr);
err = amdsmi_get_gpu_id(processor_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
+1 -1
Просмотреть файл
@@ -197,7 +197,7 @@ void TestMutualExclusion::Run(void) {
std::cout << "at " << __FILE__ << ":" << __LINE__ << std::endl; \
} \
}
ret = amdsmi_dev_get_id(processor_handles_[0], &dmy_ui16);
ret = amdsmi_get_gpu_id(processor_handles_[0], &dmy_ui16);
// vendor_id, unique_id
amdsmi_asic_info_t asci_info;
+1 -1
Просмотреть файл
@@ -167,7 +167,7 @@ void TestBase::PrintDeviceHeader(amdsmi_processor_handle dv_ind) {
IF_VERB(STANDARD) {
std::cout << "\t**Device handle: " << dv_ind << std::endl;
}
err = amdsmi_dev_get_id(dv_ind, &val_ui16);
err = amdsmi_get_gpu_id(dv_ind, &val_ui16);
CHK_ERR_ASRT(err)
IF_VERB(STANDARD) {
std::cout << "\t**Device ID: 0x" << std::hex << val_ui16 << std::endl;