Renamed API amdsmi_dev_get_gpu_clk_freq

It is renamed to amdsmi_get_clk_freq

grep -rli 'amdsmi_dev_get_gpu_clk_freq' * | xargs -i@ sed -i
's/amdsmi_dev_get_gpu_clk_freq/amdsmi_get_clk_freq/g' @

Change-Id: Ia12dd1282ab501f17667cf9f1f9b7284c2648198
Этот коммит содержится в:
Suma Hegde
2023-02-26 20:54:22 -05:00
коммит произвёл Naveen Krishna Chatradhi
родитель 76eca7892b
Коммит 56aa8059f8
10 изменённых файлов: 25 добавлений и 25 удалений
+3 -3
Просмотреть файл
@@ -1592,7 +1592,7 @@ amdsmi_status_t amdsmi_get_gpu_pci_replay_counter(amdsmi_processor_handle proce
* @details Given a processor handle @p processor_handle and a 64 bit bitmask @p bw_bitmask,
* this function will limit the set of allowable bandwidths. If a bit in @p
* bw_bitmask has a value of 1, then the frequency (as ordered in an
* ::amdsmi_frequencies_t returned by :: amdsmi_dev_get_gpu_clk_freq()) corresponding
* ::amdsmi_frequencies_t returned by :: amdsmi_get_clk_freq()) corresponding
* to that bit index will be allowed.
*
* This function will change the performance level to
@@ -2240,7 +2240,7 @@ amdsmi_status_t amdsmi_dev_get_overdrive_level(amdsmi_processor_handle processor
*
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
*/
amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle processor_handle,
amdsmi_status_t amdsmi_get_clk_freq(amdsmi_processor_handle processor_handle,
amdsmi_clk_type_t clk_type, amdsmi_frequencies_t *f);
/**
@@ -2572,7 +2572,7 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_processor_handle proce
* 64 bit bitmask @p freq_bitmask, this function will limit the set of
* allowable frequencies. If a bit in @p freq_bitmask has a value of 1, then
* the frequency (as ordered in an ::amdsmi_frequencies_t returned by
* amdsmi_dev_get_gpu_clk_freq()) corresponding to that bit index will be
* amdsmi_get_clk_freq()) corresponding to that bit index will be
* allowed.
*
* This function will change the performance level to
+3 -3
Просмотреть файл
@@ -2038,7 +2038,7 @@ try:
except AmdSmiException as e:
print(e)
```
## amdsmi_dev_get_gpu_clk_freq
## amdsmi_get_clk_freq
Description: Get the list of possible system clock speeds of device for a
specified clock type
@@ -2054,7 +2054,7 @@ Field | Description
`current`| The current frequency index
`frequency`| List of frequencies, only the first num_supported frequencies are valid
Exceptions that can be thrown by ` amdsmi_dev_get_gpu_clk_freq` function:
Exceptions that can be thrown by ` amdsmi_get_clk_freq` function:
* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`
@@ -2067,7 +2067,7 @@ try:
print("No GPUs on machine")
else:
for device in devices:
amdsmi_dev_get_gpu_clk_freq(device, AmdSmiClkType.SYS)
amdsmi_get_clk_freq(device, AmdSmiClkType.SYS)
except AmdSmiException as e:
print(e)
```
+1 -1
Просмотреть файл
@@ -109,7 +109,7 @@ from .amdsmi_interface import amdsmi_get_utilization_count
from .amdsmi_interface import amdsmi_get_gpu_perf_level
from .amdsmi_interface import amdsmi_set_gpu_perf_determinism_mode
from .amdsmi_interface import amdsmi_dev_get_overdrive_level
from .amdsmi_interface import amdsmi_dev_get_gpu_clk_freq
from .amdsmi_interface import amdsmi_get_clk_freq
from .amdsmi_interface import amdsmi_dev_get_od_volt_info
from .amdsmi_interface import amdsmi_dev_get_gpu_metrics_info
from .amdsmi_interface import amdsmi_dev_get_od_volt_curve_regions
+2 -2
Просмотреть файл
@@ -2285,7 +2285,7 @@ def amdsmi_dev_get_overdrive_level(
return od_level.value
def amdsmi_dev_get_gpu_clk_freq(
def amdsmi_get_clk_freq(
processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clk_type: AmdSmiClkType
) -> Dict[str, Any]:
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
@@ -2297,7 +2297,7 @@ def amdsmi_dev_get_gpu_clk_freq(
freq = amdsmi_wrapper.amdsmi_frequencies_t()
_check_res(
amdsmi_wrapper. amdsmi_dev_get_gpu_clk_freq(
amdsmi_wrapper. amdsmi_get_clk_freq(
processor_handle, clk_type, ctypes.byref(freq)
)
)
+4 -4
Просмотреть файл
@@ -1529,9 +1529,9 @@ amdsmi_set_gpu_perf_determinism_mode.argtypes = [amdsmi_processor_handle, uint64
amdsmi_dev_get_overdrive_level = _libraries['libamd_smi.so'].amdsmi_dev_get_overdrive_level
amdsmi_dev_get_overdrive_level.restype = amdsmi_status_t
amdsmi_dev_get_overdrive_level.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)]
amdsmi_dev_get_gpu_clk_freq = _libraries['libamd_smi.so'].amdsmi_dev_get_gpu_clk_freq
amdsmi_dev_get_gpu_clk_freq.restype = amdsmi_status_t
amdsmi_dev_get_gpu_clk_freq.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_frequencies_t)]
amdsmi_get_clk_freq = _libraries['libamd_smi.so'].amdsmi_get_clk_freq
amdsmi_get_clk_freq.restype = amdsmi_status_t
amdsmi_get_clk_freq.argtypes = [amdsmi_processor_handle, amdsmi_clk_type_t, ctypes.POINTER(struct_c__SA_amdsmi_frequencies_t)]
amdsmi_dev_reset_gpu = _libraries['libamd_smi.so'].amdsmi_dev_reset_gpu
amdsmi_dev_reset_gpu.restype = amdsmi_status_t
amdsmi_dev_reset_gpu.argtypes = [amdsmi_processor_handle]
@@ -1856,7 +1856,7 @@ __all__ = \
'amdsmi_dev_get_ecc_enabled', 'amdsmi_dev_get_ecc_status',
'amdsmi_get_energy_count', 'amdsmi_get_gpu_fan_rpms',
'amdsmi_get_gpu_fan_speed', 'amdsmi_get_gpu_fan_speed_max',
'amdsmi_dev_get_gpu_clk_freq', 'amdsmi_dev_get_gpu_metrics_info',
'amdsmi_get_clk_freq', 'amdsmi_dev_get_gpu_metrics_info',
'amdsmi_get_gpu_id', 'amdsmi_get_gpu_memory_busy_percent',
'amdsmi_get_gpu_memory_reserved_pages',
'amdsmi_get_gpu_memory_total', 'amdsmi_get_gpu_memory_usage',
+2 -2
Просмотреть файл
@@ -314,7 +314,7 @@ class Formatter:
| """ + self.style.text("25 Get device perf level. Api: amdsmi_get_gpu_perf_level <bdf>") + """ |
| """ + self.style.text("26 Set perf determinism mode. Api: amdsmi_set_gpu_perf_determinism_mode <bdf><clock_value>") + """ |
| """ + self.style.text("27 Get device overdrive level. Api: amdsmi_dev_get_overdrive_level <bdf>") + """ |
| """ + self.style.text("28 Get device gpu clk freq. Api: amdsmi_dev_get_gpu_clk_freq <bdf>") + """ |
| """ + self.style.text("28 Get device gpu clk freq. Api: amdsmi_get_clk_freq <bdf>") + """ |
| """ + self.style.text("29 Get device od volt. Api: amdsmi_dev_get_od_volt_info <bdf>") + """ |
| """ + self.style.text("30 Get device gpu metrics. Api: amdsmi_dev_get_gpu_metrics_info <bdf>") + """ |
| """ + self.style.text("31 Get device od volt curve regions. Api: amdsmi_dev_get_od_volt_curve_regions <bdf><num_regions>") + """ |
@@ -493,7 +493,7 @@ def amdsmi_tool_dev_gpu_clk_freq_get(dev):
result = {}
for clock_type in smi_api.AmdSmiClkType:
try:
value = smi_api. amdsmi_dev_get_gpu_clk_freq(dev, clock_type)
value = smi_api. amdsmi_get_clk_freq(dev, clock_type)
result.update({clock_type.name: value})
except smi_api.AmdSmiException as e:
print("{}:\t{}".format(clock_type.name, e))
+2 -2
Просмотреть файл
@@ -933,7 +933,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle,
{"rsmi_dev_gpu_reset", "amdsmi_dev_reset_gpu"},
{"rsmi_dev_memory_total_get", "amdsmi_get_gpu_memory_total"},
{"rsmi_dev_memory_usage_get", "amdsmi_get_gpu_memory_usage"},
{"rsmi_dev_gpu_clk_freq_get", " amdsmi_dev_get_gpu_clk_freq"},
{"rsmi_dev_gpu_clk_freq_get", " amdsmi_get_clk_freq"},
{"rsmi_dev_gpu_clk_freq_set", " amdsmi_dev_set_clk_freq"},
{"rsmi_dev_firmware_version_get", "amdsmi_get_fw_info"},
{"rsmi_dev_ecc_count_get", " amdsmi_dev_get_ecc_count"},
@@ -1202,7 +1202,7 @@ amdsmi_status_t amdsmi_get_gpu_pci_bandwidth(amdsmi_processor_handle processor_h
}
// TODO(bliu): other frequencies in amdsmi_clk_type_t
amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle processor_handle,
amdsmi_status_t amdsmi_get_clk_freq(amdsmi_processor_handle processor_handle,
amdsmi_clk_type_t clk_type, amdsmi_frequencies_t *f) {
AMDSMI_CHECK_INIT();
+3 -3
Просмотреть файл
@@ -116,12 +116,12 @@ void TestFrequenciesRead::Run(void) {
for (uint32_t x = 0; x < num_iterations(); ++x) {
for (uint32_t i = 0; i < num_monitor_devs(); ++i) {
auto freq_output = [&](amdsmi_clk_type_t t, const char *name) {
err = amdsmi_dev_get_gpu_clk_freq(processor_handles_[i], t, &f);
err = amdsmi_get_clk_freq(processor_handles_[i], t, &f);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout << "\t**Get " << name <<
": Not supported on this machine" << std::endl;
// Verify api support checking functionality is working
err = amdsmi_dev_get_gpu_clk_freq(processor_handles_[i], t, nullptr);
err = amdsmi_get_clk_freq(processor_handles_[i], t, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
} else if (err == AMDSMI_STATUS_NOT_YET_IMPLEMENTED) {
std::cout << "\t**Get " << name <<
@@ -133,7 +133,7 @@ void TestFrequenciesRead::Run(void) {
std::cout << f.num_supported << std::endl;
print_frequencies(&f);
// Verify api support checking functionality is working
err = amdsmi_dev_get_gpu_clk_freq(processor_handles_[i], t, nullptr);
err = amdsmi_get_clk_freq(processor_handles_[i], t, nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
}
+4 -4
Просмотреть файл
@@ -113,7 +113,7 @@ void TestFrequenciesReadWrite::Run(void) {
std::cout << amdsmi_clk << std::endl;
if (amdsmi_clk == CLK_TYPE_PCIE)
return false;
ret = amdsmi_dev_get_gpu_clk_freq(processor_handles_[dv_ind], amdsmi_clk, &f);
ret = amdsmi_get_clk_freq(processor_handles_[dv_ind], amdsmi_clk, &f);
std::cout << ret << std::endl;
if (ret == AMDSMI_STATUS_NOT_SUPPORTED ||
@@ -166,7 +166,7 @@ void TestFrequenciesReadWrite::Run(void) {
return;
}
CHK_ERR_ASRT(ret)
ret = amdsmi_dev_get_gpu_clk_freq(processor_handles_[dv_ind], amdsmi_clk, &f);
ret = amdsmi_get_clk_freq(processor_handles_[dv_ind], amdsmi_clk, &f);
if (ret != AMDSMI_STATUS_SUCCESS) {
return;
}
@@ -194,7 +194,7 @@ void TestFrequenciesReadWrite::Run(void) {
freq_write();
CHK_ERR_ASRT(ret)
#if 0
ret = amdsmi_dev_get_gpu_clk_freq(dv_ind, amdsmi_clk, &f);
ret = amdsmi_get_clk_freq(dv_ind, amdsmi_clk, &f);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
@@ -218,7 +218,7 @@ void TestFrequenciesReadWrite::Run(void) {
ret = amdsmi_dev_set_clk_freq(dv_ind, amdsmi_clk, freq_bitmask);
CHK_ERR_ASRT(ret)
ret = amdsmi_dev_get_gpu_clk_freq(dv_ind, amdsmi_clk, &f);
ret = amdsmi_get_clk_freq(dv_ind, amdsmi_clk, &f);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
+1 -1
Просмотреть файл
@@ -239,7 +239,7 @@ void TestMutualExclusion::Run(void) {
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_get_overdrive_level(processor_handles_[0], &dmy_ui32);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_get_gpu_clk_freq(processor_handles_[0], CLK_TYPE_SYS, &dmy_freqs);
ret = amdsmi_get_clk_freq(processor_handles_[0], CLK_TYPE_SYS, &dmy_freqs);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
ret = amdsmi_dev_get_od_volt_info(processor_handles_[0], &dmy_od_volt);
CHECK_RET(ret, AMDSMI_STATUS_BUSY);