From 06cedb0eed45f22151c21e0daeddba115bd3742e Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Sat, 25 Feb 2023 07:06:13 -0500 Subject: [PATCH] Renamed API amdsmi_dev_get_vram_vendor to amdsmi_get_gpu_vram_vendor grep -rli 'amdsmi_dev_get_vram_vendor' * | xargs -i@ sed -i 's/amdsmi_dev_get_vram_vendor/amdsmi_get_gpu_vram_vendor/g' @ Change-Id: I3c11643a778f147027d0d3121b9782931439c752 [ROCm/amdsmi commit: f69a6ea64e31ab2839d99c5b9e253a21be5d2d13] --- projects/amdsmi/include/amd_smi/amdsmi.h | 4 ++-- projects/amdsmi/py-interface/README.md | 6 +++--- projects/amdsmi/py-interface/__init__.py | 2 +- projects/amdsmi/py-interface/amdsmi_interface.py | 4 ++-- projects/amdsmi/py-interface/amdsmi_wrapper.py | 8 ++++---- projects/amdsmi/py-interface/rocm_smi_tool.py | 4 ++-- projects/amdsmi/src/amd_smi/amd_smi.cc | 4 ++-- .../amdsmi/tests/amd_smi_test/functional/id_info_read.cc | 4 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 4 ++-- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index e91a531b17..9b119f8abc 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -1363,7 +1363,7 @@ amdsmi_status_t amdsmi_get_gpu_vendor_name(amdsmi_processor_handle processor_han * buffer @p brand. * * If the vram vendor for the device is not found as one of the values - * contained within amdsmi_dev_get_vram_vendor, then this function will return + * contained within amdsmi_get_gpu_vram_vendor, then this function will return * the string 'unknown' instead of the vram vendor. * * @param[in] processor_handle a device handle @@ -1375,7 +1375,7 @@ amdsmi_status_t amdsmi_get_gpu_vendor_name(amdsmi_processor_handle processor_han * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle processor_handle, char *brand, +amdsmi_status_t amdsmi_get_gpu_vram_vendor(amdsmi_processor_handle processor_handle, char *brand, uint32_t len); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index ce8d5345bd..59c573e3f4 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2930,7 +2930,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_get_vram_vendor +## amdsmi_get_gpu_vram_vendor Description: Get the vram vendor string of a gpu device. Input parameters: @@ -2939,7 +2939,7 @@ Input parameters: Output: vram vendor -Exceptions that can be thrown by `amdsmi_dev_get_vram_vendor` function: +Exceptions that can be thrown by `amdsmi_get_gpu_vram_vendor` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2952,7 +2952,7 @@ try: print("No GPUs on machine") else: for device in devices: - vram_vendor = amdsmi_dev_get_vram_vendor(device) + vram_vendor = amdsmi_get_gpu_vram_vendor(device) print(vram_vendor) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index d6e342f1b8..3c58da1050 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -159,7 +159,7 @@ from .amdsmi_interface import AmdSmiEventReader # # Device Identification information from .amdsmi_interface import amdsmi_get_gpu_vendor_name from .amdsmi_interface import amdsmi_get_gpu_id -from .amdsmi_interface import amdsmi_dev_get_vram_vendor +from .amdsmi_interface import amdsmi_get_gpu_vram_vendor from .amdsmi_interface import amdsmi_dev_get_drm_render_minor from .amdsmi_interface import amdsmi_dev_get_subsystem_id from .amdsmi_interface import amdsmi_dev_get_subsystem_name diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 66cfe9845f..c56a6ea07d 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1102,7 +1102,7 @@ def amdsmi_get_gpu_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): return id.value -def amdsmi_dev_get_vram_vendor(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_gpu_vram_vendor(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 @@ -1114,7 +1114,7 @@ def amdsmi_dev_get_vram_vendor(processor_handle: amdsmi_wrapper.amdsmi_processor vram_vendor = ctypes.create_string_buffer(_AMDSMI_STRING_LENGTH) _check_res( - amdsmi_wrapper.amdsmi_dev_get_vram_vendor( + amdsmi_wrapper.amdsmi_get_gpu_vram_vendor( processor_handle, vram_vendor, length) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index a13dbec41d..bed67a046d 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1427,9 +1427,9 @@ amdsmi_get_gpu_vendor_name = _libraries['libamd_smi.so'].amdsmi_get_gpu_vendor_n amdsmi_get_gpu_vendor_name.restype = amdsmi_status_t amdsmi_get_gpu_vendor_name.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), size_t] uint32_t = ctypes.c_uint32 -amdsmi_dev_get_vram_vendor = _libraries['libamd_smi.so'].amdsmi_dev_get_vram_vendor -amdsmi_dev_get_vram_vendor.restype = amdsmi_status_t -amdsmi_dev_get_vram_vendor.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), uint32_t] +amdsmi_get_gpu_vram_vendor = _libraries['libamd_smi.so'].amdsmi_get_gpu_vram_vendor +amdsmi_get_gpu_vram_vendor.restype = amdsmi_status_t +amdsmi_get_gpu_vram_vendor.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), uint32_t] amdsmi_dev_get_subsystem_id = _libraries['libamd_smi.so'].amdsmi_dev_get_subsystem_id amdsmi_dev_get_subsystem_id.restype = amdsmi_status_t amdsmi_dev_get_subsystem_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)] @@ -1869,7 +1869,7 @@ __all__ = \ 'amdsmi_dev_get_power_profile_presets', 'amdsmi_dev_get_subsystem_id', 'amdsmi_dev_get_subsystem_name', 'amdsmi_dev_get_temp_metric', 'amdsmi_get_gpu_vendor_name', - 'amdsmi_dev_get_volt_metric', 'amdsmi_dev_get_vram_vendor', + 'amdsmi_dev_get_volt_metric', 'amdsmi_get_gpu_vram_vendor', 'amdsmi_dev_open_supported_func_iterator', 'amdsmi_dev_open_supported_variant_iterator', 'amdsmi_dev_perf_level_t', 'amdsmi_dev_perf_level_t__enumvalues', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 5352105245..f4fb46a6bc 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -289,7 +289,7 @@ class Formatter: | | | """ + self.style.text(" 1 Get device vendor name. Api: amdsmi_get_gpu_vendor_name ") + """ | | """ + self.style.text(" 2 Get device id. Api: amdsmi_get_gpu_id ") + """ | - | """ + self.style.text(" 3 Get device vram vendor. Api: amdsmi_dev_get_vram_vendor ") + """ | + | """ + self.style.text(" 3 Get device vram vendor. Api: amdsmi_get_gpu_vram_vendor ") + """ | | """ + self.style.text(" 4 Get device drm render minor. Api: amdsmi_dev_get_drm_render_minor ") + """ | | """ + self.style.text(" 5 Get device subsystem id. Api: amdsmi_dev_get_subsystem_id ") + """ | | """ + self.style.text(" 6 Get device subsystem name. Api: amdsmi_dev_get_subsystem_name ") + """ | @@ -728,7 +728,7 @@ commands = { 2: [smi_api.amdsmi_get_gpu_id, { "device_identifier1": [None, True] }], - 3: [smi_api.amdsmi_dev_get_vram_vendor, { + 3: [smi_api.amdsmi_get_gpu_vram_vendor, { "device_identifier1": [None, True] }], 4: [smi_api.amdsmi_dev_get_drm_render_minor, { diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index e25dd47f85..d511ab69f2 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -638,7 +638,7 @@ amdsmi_status_t amdsmi_get_gpu_vendor_name( return rsmi_wrapper(rsmi_dev_vendor_name_get, processor_handle, name, len); } -amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_get_gpu_vram_vendor(amdsmi_processor_handle processor_handle, char *brand, uint32_t len) { return rsmi_wrapper(rsmi_dev_vram_vendor_get, processor_handle, brand, len); } @@ -888,7 +888,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, return AMDSMI_STATUS_INVAL; static const std::map rsmi_2_amdsmi = { - {"rsmi_dev_vram_vendor_get", "amdsmi_dev_get_vram_vendor"}, + {"rsmi_dev_vram_vendor_get", "amdsmi_get_gpu_vram_vendor"}, {"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"}, diff --git a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc index d8f745affd..b91e6a1186 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/id_info_read.cc @@ -132,11 +132,11 @@ void TestIdInfoRead::Run(void) { err = amdsmi_get_board_info(processor_handles_[0], &board_info); CHK_ERR_ASRT(err) - err = amdsmi_dev_get_vram_vendor(processor_handles_[i], buffer, kBufferLen); + err = amdsmi_get_gpu_vram_vendor(processor_handles_[i], buffer, kBufferLen); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Vram Vendor string not supported on this system." << std::endl; - err = amdsmi_dev_get_vram_vendor(processor_handles_[i], nullptr, kBufferLen); + err = amdsmi_get_gpu_vram_vendor(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) diff --git a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc index c77709526c..5df04d1d59 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -211,7 +211,7 @@ void TestMutualExclusion::Run(void) { ret = amdsmi_get_gpu_vendor_name(processor_handles_[0], dmy_str, 10); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_vram_vendor(processor_handles_[0], dmy_str, 10); + ret = amdsmi_get_gpu_vram_vendor(processor_handles_[0], dmy_str, 10); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_get_subsystem_id(processor_handles_[0], &dmy_ui16); CHECK_RET(ret, AMDSMI_STATUS_BUSY); @@ -265,7 +265,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_firmware_version_get amdsmi_dev_name_get amdsmi_dev_brand_get - amdsmi_dev_get_vram_vendor + amdsmi_get_gpu_vram_vendor amdsmi_dev_get_subsystem_name amdsmi_dev_get_drm_render_minor amdsmi_get_gpu_vendor_name