From 22ad287cbfda54b5d160b3db537f71366e90de56 Mon Sep 17 00:00:00 2001 From: Deepak Mewar Date: Mon, 27 Feb 2023 02:00:14 -0500 Subject: [PATCH] Renamed API amdsmi_dev_counter_group_supported to amdsmi_gpu_counter_group_supported grep -rli 'amdsmi_dev_counter_group_supported' * | xargs -i@ sed -i 's/amdsmi_dev_counter_group_supported/amdsmi_gpu_counter_group_supported/g' @ Change-Id: I69a5534f779dc0013bbe75b3d9b2c6074b2f378b [ROCm/amdsmi commit: fb419ab6554515a21bdd489b46a5a26300033287] --- projects/amdsmi/include/amd_smi/amdsmi.h | 6 +++--- 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 ++-- .../tests/amd_smi_test/functional/mutual_exclusion.cc | 2 +- .../tests/amd_smi_test/functional/perf_cntr_read_write.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 2d845a1475..9f655db4e2 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2765,7 +2765,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * The types of events available and the ability to count those * events are dependent on which device is being targeted and if counters are * still available for that device, respectively. - * ::amdsmi_dev_counter_group_supported() can be used to see which event types + * ::amdsmi_gpu_counter_group_supported() can be used to see which event types * (::amdsmi_event_group_t) are supported for a given device. Assuming a device * supports a given event type, we can then check to see if there are counters * available to count a specific event with @@ -2811,7 +2811,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * amdsmi_counter_value_t value; * * // Determine if AMDSMI_EVNT_GRP_XGMI is supported for device dv_ind - * ret = amdsmi_dev_counter_group_supported(dv_ind, AMDSMI_EVNT_GRP_XGMI); + * ret = amdsmi_gpu_counter_group_supported(dv_ind, AMDSMI_EVNT_GRP_XGMI); * * // See if there are counters available for device dv_ind for event * // AMDSMI_EVNT_GRP_XGMI @@ -2868,7 +2868,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_counter_group_supported(amdsmi_processor_handle processor_handle, amdsmi_event_group_t group); +amdsmi_gpu_counter_group_supported(amdsmi_processor_handle processor_handle, amdsmi_event_group_t group); /** * @brief Create a performance counter object diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 3f2863f896..8fe7a3d0c8 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2234,7 +2234,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_counter_group_supported +## amdsmi_gpu_counter_group_supported Description: Tell if an event group is supported by a given device Input parameters: @@ -2244,7 +2244,7 @@ Input parameters: Output: None -Exceptions that can be thrown by `amdsmi_dev_counter_group_supported` function: +Exceptions that can be thrown by `amdsmi_gpu_counter_group_supported` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2257,7 +2257,7 @@ try: print("No GPUs on machine") else: for device in devices: - amdsmi_dev_counter_group_supported(device, AmdSmiEventGroup.XGMI) + amdsmi_gpu_counter_group_supported(device, AmdSmiEventGroup.XGMI) except AmdSmiException as e: print(e) ``` diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index efdb066dab..ea49b74d19 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -116,7 +116,7 @@ from .amdsmi_interface import amdsmi_dev_get_od_volt_curve_regions from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets # # Performance Counters -from .amdsmi_interface import amdsmi_dev_counter_group_supported +from .amdsmi_interface import amdsmi_gpu_counter_group_supported from .amdsmi_interface import amdsmi_dev_create_counter from .amdsmi_interface import amdsmi_dev_destroy_counter from .amdsmi_interface import amdsmi_control_counter diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index 305bf68f29..b352f45d77 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1344,7 +1344,7 @@ def amdsmi_get_xgmi_info(processor_handle: amdsmi_wrapper.amdsmi_processor_handl } -def amdsmi_dev_counter_group_supported( +def amdsmi_gpu_counter_group_supported( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, event_group: AmdSmiEventGroup, ): @@ -1356,7 +1356,7 @@ def amdsmi_dev_counter_group_supported( raise AmdSmiParameterException(event_group, AmdSmiEventGroup) _check_res( - amdsmi_wrapper.amdsmi_dev_counter_group_supported( + amdsmi_wrapper.amdsmi_gpu_counter_group_supported( processor_handle, event_group) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 7c4e97a631..20279e73a7 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1589,9 +1589,9 @@ amdsmi_dev_get_gpu_ecc_status.argtypes = [amdsmi_processor_handle, amdsmi_gpu_bl amdsmi_status_string = _libraries['libamd_smi.so'].amdsmi_status_string amdsmi_status_string.restype = amdsmi_status_t amdsmi_status_string.argtypes = [amdsmi_status_t, ctypes.POINTER(ctypes.POINTER(ctypes.c_char))] -amdsmi_dev_counter_group_supported = _libraries['libamd_smi.so'].amdsmi_dev_counter_group_supported -amdsmi_dev_counter_group_supported.restype = amdsmi_status_t -amdsmi_dev_counter_group_supported.argtypes = [amdsmi_processor_handle, amdsmi_event_group_t] +amdsmi_gpu_counter_group_supported = _libraries['libamd_smi.so'].amdsmi_gpu_counter_group_supported +amdsmi_gpu_counter_group_supported.restype = amdsmi_status_t +amdsmi_gpu_counter_group_supported.argtypes = [amdsmi_processor_handle, amdsmi_event_group_t] amdsmi_dev_create_counter = _libraries['libamd_smi.so'].amdsmi_dev_create_counter amdsmi_dev_create_counter.restype = amdsmi_status_t amdsmi_dev_create_counter.argtypes = [amdsmi_processor_handle, amdsmi_event_type_t, ctypes.POINTER(ctypes.c_uint64)] @@ -1850,7 +1850,7 @@ __all__ = \ 'amdsmi_counter_command_t__enumvalues', 'amdsmi_counter_get_available_counters', 'amdsmi_counter_value_t', 'amdsmi_dev_close_supported_func_iterator', - 'amdsmi_dev_counter_group_supported', 'amdsmi_dev_create_counter', + 'amdsmi_gpu_counter_group_supported', 'amdsmi_dev_create_counter', 'amdsmi_dev_destroy_counter', 'amdsmi_get_busy_percent', 'amdsmi_get_gpu_drm_render_minor', 'amdsmi_dev_get_gpu_ecc_count', 'amdsmi_dev_get_gpu_ecc_enabled', 'amdsmi_dev_get_gpu_ecc_status', diff --git a/projects/amdsmi/py-interface/rocm_smi_tool.py b/projects/amdsmi/py-interface/rocm_smi_tool.py index 6fdb0aaf36..f542ffc9c6 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -349,7 +349,7 @@ class Formatter: | """ + self.style.text("60 Get counter control. Api: amdsmi_control_counter ") + """ | | """ + self.style.text("61 Get counter read. Api: amdsmi_read_counter ") + """ | | """ + self.style.text("62 Set dev clk range. Api: amdsmi_set_gpu_clk_range ") + """ | - | """ + self.style.text("63 Get dev counter group supported. Api: amdsmi_dev_counter_group_supported ") + """ | + | """ + self.style.text("63 Get dev counter group supported. Api: amdsmi_gpu_counter_group_supported ") + """ | | """ + self.style.text("64 Reset dev fan. Api: amdsmi_reset_gpu_fan ") + """ | | """ + self.style.text("65 Set dev fan speed. Api: amdsmi_set_gpu_fan_speed ") + """ | | """ + self.style.text("66 Set dev gpu clk freq. Api: amdsmi_set_clk_freq ") + """ | @@ -631,7 +631,7 @@ def amdsmi_tool_dev_counter_group_supported(dev): result = {} for event_group in smi_api.AmdSmiEventGroup: try: - value = smi_api.amdsmi_dev_counter_group_supported(dev, event_group) + value = smi_api.amdsmi_gpu_counter_group_supported(dev, event_group) result.update({event_group.name: value}) except smi_api.AmdSmiException as e: print("{}:\t{}".format(event_group.name, e)) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 2da8a8ef73..fd48c6e4c6 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -690,7 +690,7 @@ amdsmi_status_t amdsmi_stop_gpu_event_notification( return rsmi_wrapper(rsmi_event_notification_stop, processor_handle); } -amdsmi_status_t amdsmi_dev_counter_group_supported( +amdsmi_status_t amdsmi_gpu_counter_group_supported( amdsmi_processor_handle processor_handle, amdsmi_event_group_t group) { return rsmi_wrapper(rsmi_dev_counter_group_supported, processor_handle, static_cast(group)); @@ -923,7 +923,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"rsmi_dev_od_volt_curve_regions_get", " amdsmi_dev_get_od_volt_curve_regions"}, {"rsmi_dev_ecc_enabled_get", " amdsmi_dev_get_gpu_ecc_enabled"}, {"rsmi_dev_ecc_status_get", " amdsmi_dev_get_gpu_ecc_status"}, - {"rsmi_dev_counter_group_supported", "amdsmi_dev_counter_group_supported"}, + {"rsmi_dev_counter_group_supported", "amdsmi_gpu_counter_group_supported"}, {"rsmi_dev_counter_create", "amdsmi_dev_create_counter"}, {"rsmi_dev_xgmi_error_status", "amdsmi_dev_xgmi_error_status"}, {"rsmi_dev_xgmi_error_reset", "amdsmi_dev_reset_xgmi_error"}, 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 1599546925..6e4607f0b6 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -299,7 +299,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_unique_id_get amdsmi_dev_create_counter amdsmi_counter_get_available_counters - amdsmi_dev_counter_group_supported + amdsmi_gpu_counter_group_supported amdsmi_get_gpu_memory_reserved_pages amdsmi_dev_xgmi_error_status amdsmi_dev_reset_xgmi_error diff --git a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc index ca27023d67..2b5a48f83e 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/perf_cntr_read_write.cc @@ -202,7 +202,7 @@ TestPerfCntrReadWrite::testEventsIndividually(amdsmi_processor_handle dv_ind) { std::cout << "****************************" << std::endl; } for (PerfCntrEvtGrp grp : s_event_groups) { - ret = amdsmi_dev_counter_group_supported(dv_ind, grp.group()); + ret = amdsmi_gpu_counter_group_supported(dv_ind, grp.group()); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { continue; } @@ -248,7 +248,7 @@ TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_processor_handle dv_ind) * handling 1 event at a time. */ for (PerfCntrEvtGrp grp : s_event_groups) { - ret = amdsmi_dev_counter_group_supported(dv_ind, grp.group()); + ret = amdsmi_gpu_counter_group_supported(dv_ind, grp.group()); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << "\tEvent Group " << grp.name() <<