diff --git a/projects/amdsmi/include/amd_smi/amdsmi.h b/projects/amdsmi/include/amd_smi/amdsmi.h index 9f655db4e2..200342b262 100644 --- a/projects/amdsmi/include/amd_smi/amdsmi.h +++ b/projects/amdsmi/include/amd_smi/amdsmi.h @@ -2775,7 +2775,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * Once it is determined that events are supported and counters are available, * an event counter can be created/destroyed and controlled. * - * ::amdsmi_dev_create_counter() allocates internal data structures that will be + * ::amdsmi_gpu_create_counter() allocates internal data structures that will be * used to used to control the event counter, and return a handle to this data * structure. * @@ -2825,7 +2825,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * // AMDSMI_EVNT_XGMI_0_BEATS_TX) and get the handle * // (amdsmi_event_handle_t). * - * ret = amdsmi_dev_create_counter(dv_ind, AMDSMI_EVNT_XGMI_0_BEATS_TX, + * ret = amdsmi_gpu_create_counter(dv_ind, AMDSMI_EVNT_XGMI_0_BEATS_TX, * &evnt_handle); * * // A program that generates the events of interest can be started @@ -2895,7 +2895,7 @@ amdsmi_gpu_counter_group_supported(amdsmi_processor_handle processor_handle, amd * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_create_counter(amdsmi_processor_handle processor_handle, amdsmi_event_type_t type, +amdsmi_gpu_create_counter(amdsmi_processor_handle processor_handle, amdsmi_event_type_t type, amdsmi_event_handle_t *evnt_handle); /** diff --git a/projects/amdsmi/py-interface/README.md b/projects/amdsmi/py-interface/README.md index 8fe7a3d0c8..8aa40c5399 100644 --- a/projects/amdsmi/py-interface/README.md +++ b/projects/amdsmi/py-interface/README.md @@ -2262,7 +2262,7 @@ except AmdSmiException as e: print(e) ``` -## amdsmi_dev_create_counter +## amdsmi_gpu_create_counter Description: Creates a performance counter object Input parameters: @@ -2272,7 +2272,7 @@ Input parameters: Output: An event handle of the newly created performance counter object -Exceptions that can be thrown by `amdsmi_dev_create_counter` function: +Exceptions that can be thrown by `amdsmi_gpu_create_counter` function: * `AmdSmiLibraryException` * `AmdSmiRetryException` * `AmdSmiParameterException` @@ -2285,7 +2285,7 @@ try: print("No GPUs on machine") else: for device in devices: - event_handle = amdsmi_dev_create_counter(device, AmdSmiEventGroup.XGMI) + event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventGroup.XGMI) except AmdSmiException as e: print(e) ``` @@ -2311,7 +2311,7 @@ try: print("No GPUs on machine") else: for device in devices: - event_handle = amdsmi_dev_create_counter(device, AmdSmiEventGroup.XGMI) + event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventGroup.XGMI) amdsmi_dev_destroy_counter(event_handle) except AmdSmiException as e: print(e) @@ -2339,7 +2339,7 @@ try: print("No GPUs on machine") else: for device in devices: - event_handle = amdsmi_dev_create_counter(device, AmdSmiEventType.XGMI_1_REQUEST_TX) + event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventType.XGMI_1_REQUEST_TX) amdsmi_control_counter(event_handle, AmdSmiCounterCommand.CMD_START) except AmdSmiException as e: print(e) @@ -2372,7 +2372,7 @@ try: print("No GPUs on machine") else: for device in devices: - event_handle = amdsmi_dev_create_counter(device, AmdSmiEventType.XGMI_1_REQUEST_TX) + event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventType.XGMI_1_REQUEST_TX) amdsmi_read_counter(event_handle) except AmdSmiException as e: print(e) diff --git a/projects/amdsmi/py-interface/__init__.py b/projects/amdsmi/py-interface/__init__.py index ea49b74d19..569dc9053d 100644 --- a/projects/amdsmi/py-interface/__init__.py +++ b/projects/amdsmi/py-interface/__init__.py @@ -117,7 +117,7 @@ from .amdsmi_interface import amdsmi_get_gpu_power_profile_presets # # Performance Counters from .amdsmi_interface import amdsmi_gpu_counter_group_supported -from .amdsmi_interface import amdsmi_dev_create_counter +from .amdsmi_interface import amdsmi_gpu_create_counter from .amdsmi_interface import amdsmi_dev_destroy_counter from .amdsmi_interface import amdsmi_control_counter from .amdsmi_interface import amdsmi_read_counter diff --git a/projects/amdsmi/py-interface/amdsmi_interface.py b/projects/amdsmi/py-interface/amdsmi_interface.py index b352f45d77..57ce6f944e 100644 --- a/projects/amdsmi/py-interface/amdsmi_interface.py +++ b/projects/amdsmi/py-interface/amdsmi_interface.py @@ -1361,7 +1361,7 @@ def amdsmi_gpu_counter_group_supported( ) -def amdsmi_dev_create_counter( +def amdsmi_gpu_create_counter( processor_handle: amdsmi_wrapper.amdsmi_processor_handle, event_type: AmdSmiEventType, ) -> amdsmi_wrapper.amdsmi_event_handle_t: @@ -1374,7 +1374,7 @@ def amdsmi_dev_create_counter( event_handle = amdsmi_wrapper.amdsmi_event_handle_t() _check_res( - amdsmi_wrapper.amdsmi_dev_create_counter( + amdsmi_wrapper.amdsmi_gpu_create_counter( processor_handle, event_type, ctypes.byref(event_handle) ) ) diff --git a/projects/amdsmi/py-interface/amdsmi_wrapper.py b/projects/amdsmi/py-interface/amdsmi_wrapper.py index 20279e73a7..192ca8a569 100644 --- a/projects/amdsmi/py-interface/amdsmi_wrapper.py +++ b/projects/amdsmi/py-interface/amdsmi_wrapper.py @@ -1592,9 +1592,9 @@ amdsmi_status_string.argtypes = [amdsmi_status_t, ctypes.POINTER(ctypes.POINTER( 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)] +amdsmi_gpu_create_counter = _libraries['libamd_smi.so'].amdsmi_gpu_create_counter +amdsmi_gpu_create_counter.restype = amdsmi_status_t +amdsmi_gpu_create_counter.argtypes = [amdsmi_processor_handle, amdsmi_event_type_t, ctypes.POINTER(ctypes.c_uint64)] amdsmi_dev_destroy_counter = _libraries['libamd_smi.so'].amdsmi_dev_destroy_counter amdsmi_dev_destroy_counter.restype = amdsmi_status_t amdsmi_dev_destroy_counter.argtypes = [amdsmi_event_handle_t] @@ -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_gpu_counter_group_supported', 'amdsmi_dev_create_counter', + 'amdsmi_gpu_counter_group_supported', 'amdsmi_gpu_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 f542ffc9c6..ae828089f4 100644 --- a/projects/amdsmi/py-interface/rocm_smi_tool.py +++ b/projects/amdsmi/py-interface/rocm_smi_tool.py @@ -594,7 +594,7 @@ def amdsmi_tool_counter_control(dev): for event_type in smi_api.AmdSmiEventType: for counter_command in smi_api.AmdSmiCounterCommand: try: - event_handle = smi_api.amdsmi_dev_create_counter(dev, event_type) + event_handle = smi_api.amdsmi_gpu_create_counter(dev, event_type) value = smi_api.amdsmi_control_counter(event_handle, counter_command) result.update({event_type.name: value}) except smi_api.AmdSmiException as e: @@ -606,7 +606,7 @@ def amdsmi_tool_counter_read(dev): result = {} for event_type in smi_api.AmdSmiEventType: try: - event_handle = smi_api.amdsmi_dev_create_counter(dev, event_type) + event_handle = smi_api.amdsmi_gpu_create_counter(dev, event_type) value = smi_api.amdsmi_read_counter(event_handle) result.update({event_type.name: value}) except smi_api.AmdSmiException as e: diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index fd48c6e4c6..8ba0962b8b 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -696,7 +696,7 @@ amdsmi_status_t amdsmi_gpu_counter_group_supported( static_cast(group)); } -amdsmi_status_t amdsmi_dev_create_counter(amdsmi_processor_handle processor_handle, +amdsmi_status_t amdsmi_gpu_create_counter(amdsmi_processor_handle processor_handle, amdsmi_event_type_t type, amdsmi_event_handle_t *evnt_handle) { return rsmi_wrapper(rsmi_dev_counter_create, processor_handle, static_cast(type), @@ -924,7 +924,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, {"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_gpu_counter_group_supported"}, - {"rsmi_dev_counter_create", "amdsmi_dev_create_counter"}, + {"rsmi_dev_counter_create", "amdsmi_gpu_create_counter"}, {"rsmi_dev_xgmi_error_status", "amdsmi_dev_xgmi_error_status"}, {"rsmi_dev_xgmi_error_reset", "amdsmi_dev_reset_xgmi_error"}, {"rsmi_dev_memory_reserved_pages_get", "amdsmi_get_gpu_memory_reserved_pages"}, 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 6e4607f0b6..627eac2922 100755 --- a/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/projects/amdsmi/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -297,7 +297,7 @@ void TestMutualExclusion::Run(void) { amdsmi_dev_serial_number_get amdsmi_get_gpu_pci_replay_counter amdsmi_dev_unique_id_get - amdsmi_dev_create_counter + amdsmi_gpu_create_counter amdsmi_counter_get_available_counters amdsmi_gpu_counter_group_supported amdsmi_get_gpu_memory_reserved_pages 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 2b5a48f83e..a9b454718b 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 @@ -115,14 +115,14 @@ void TestPerfCntrReadWrite::CountEvents(amdsmi_processor_handle dv_ind, amdsmi_event_handle_t evt_handle; amdsmi_status_t ret; - ret = amdsmi_dev_create_counter(dv_ind, + ret = amdsmi_gpu_create_counter(dv_ind, static_cast(evnt), &evt_handle); CHK_ERR_ASRT(ret) - // Note that amdsmi_dev_create_counter() should never return + // Note that amdsmi_gpu_create_counter() should never return // AMDSMI_STATUS_NOT_SUPPORTED. It will return AMDSMI_STATUS_OUT_OF_RESOURCES // if it is unable to create a counter. - ret = amdsmi_dev_create_counter(dv_ind, + ret = amdsmi_gpu_create_counter(dv_ind, static_cast(evnt), nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_INVAL); @@ -294,7 +294,7 @@ TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_processor_handle dv_ind) std::cout << "\tEvent Type " << tmp << std::endl; } - ret = amdsmi_dev_create_counter(dv_ind, + ret = amdsmi_gpu_create_counter(dv_ind, static_cast(tmp), &evt_handle.get()[j]); CHK_ERR_ASRT(ret) }