SWDEV-373282 - Fixed compiler warnings
Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>
Change-Id: Ieacf1057ad23f9a31d47a6d1199c90d8fa0d12db
[ROCm/amdsmi commit: cf7a92f383]
This commit is contained in:
@@ -271,7 +271,7 @@ int main() {
|
||||
ret = amdsmi_get_device_bdf(device_handles[j], &bdf);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
printf(" Output of amdsmi_get_device_bdf:\n");
|
||||
printf("\tDevice[%d] BDF %04x:%02x:%02x.%d\n\n", i,
|
||||
printf("\tDevice[%d] BDF %04lx:%02x:%02x.%d\n\n", i,
|
||||
bdf.domain_number, bdf.bus_number, bdf.device_number,
|
||||
bdf.function_number);
|
||||
|
||||
@@ -313,7 +313,7 @@ int main() {
|
||||
power_measure.voltage_gfx);
|
||||
printf("\tAverage socket power: %d\n",
|
||||
power_measure.average_socket_power);
|
||||
printf("\tEnergy accumulator: %d\n\n",
|
||||
printf("\tEnergy accumulator: %ld\n\n",
|
||||
power_measure.energy_accumulator);
|
||||
printf("\tGPU Power limit: %d\n\n", power_measure.power_limit);
|
||||
|
||||
@@ -354,7 +354,7 @@ int main() {
|
||||
printf("Number of Microcodes: %d\n", fw_information.num_fw_info);
|
||||
for (int j = 0; j < fw_information.num_fw_info; j++) {
|
||||
getFWNameFromId(fw_information.fw_info_list[j].fw_id, ucode_name);
|
||||
printf(" %s: %d\n", ucode_name, fw_information.fw_info_list[j].fw_version);
|
||||
printf(" %s: %ld\n", ucode_name, fw_information.fw_info_list[j].fw_version);
|
||||
}
|
||||
|
||||
// Get GFX clock measurements
|
||||
@@ -399,14 +399,14 @@ int main() {
|
||||
AMDSMI_TEMP_CRITICAL, &temperature);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
printf(" Output of amdsmi_dev_get_temp_metric:\n");
|
||||
printf("\tGPU VRAM temp limit: %d\n", temperature);
|
||||
printf("\tGPU VRAM temp limit: %ld\n", temperature);
|
||||
|
||||
// Get GFX temperature limit
|
||||
ret = amdsmi_dev_get_temp_metric(
|
||||
device_handles[j], TEMPERATURE_TYPE_EDGE,
|
||||
AMDSMI_TEMP_CRITICAL, &temperature);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
printf("\tGPU GFX temp limit: %d\n\n", temperature);
|
||||
printf("\tGPU GFX temp limit: %ld\n\n", temperature);
|
||||
|
||||
// Get temperature measurements
|
||||
// amdsmi_temperature_t edge_temp, junction_temp, vram_temp,
|
||||
@@ -423,13 +423,13 @@ int main() {
|
||||
CHK_AMDSMI_RET(ret)
|
||||
}
|
||||
printf(" Output of amdsmi_dev_get_temp_metric:\n");
|
||||
printf("\tGPU Edge temp measurement: %d\n",
|
||||
printf("\tGPU Edge temp measurement: %ld\n",
|
||||
temp_measurements[TEMPERATURE_TYPE_EDGE]);
|
||||
printf("\tGPU Junction temp measurement: %d\n",
|
||||
printf("\tGPU Junction temp measurement: %ld\n",
|
||||
temp_measurements[TEMPERATURE_TYPE_JUNCTION]);
|
||||
printf("\tGPU VRAM temp measurement: %d\n",
|
||||
printf("\tGPU VRAM temp measurement: %ld\n",
|
||||
temp_measurements[TEMPERATURE_TYPE_VRAM]);
|
||||
printf("\tGPU PLX temp measurement: %d\n\n",
|
||||
printf("\tGPU PLX temp measurement: %ld\n\n",
|
||||
temp_measurements[TEMPERATURE_TYPE_PLX]);
|
||||
|
||||
// Get RAS features enabled
|
||||
@@ -535,7 +535,7 @@ int main() {
|
||||
uint64_t mem = 0, gtt_mem = 0, cpu_mem = 0, vram_mem = 0;
|
||||
float gfx = 0, comp = 0, dma = 0, enc = 0, dec = 0;
|
||||
char bdf_str[20];
|
||||
sprintf(bdf_str, "%04x:%02x:%02x.%d", bdf.domain_number,
|
||||
sprintf(bdf_str, "%04lx:%02x:%02x.%d", bdf.domain_number,
|
||||
bdf.bus_number, bdf.device_number, bdf.function_number);
|
||||
int num = 0;
|
||||
ret = amdsmi_get_process_list(device_handles[j], process_list,
|
||||
|
||||
@@ -122,7 +122,7 @@ int main() {
|
||||
ret = amdsmi_get_device_bdf(device_handles[j], &bdf);
|
||||
CHK_AMDSMI_RET(ret)
|
||||
printf(" Output of amdsmi_get_device_bdf:\n");
|
||||
printf("\tDevice[%d] BDF %04x:%02x:%02x.%d\n\n", i,
|
||||
printf("\tDevice[%d] BDF %04lx:%02x:%02x.%d\n\n", i,
|
||||
bdf.domain_number, bdf.bus_number, bdf.device_number,
|
||||
bdf.function_number);
|
||||
|
||||
@@ -132,7 +132,7 @@ int main() {
|
||||
printf(" Output of amdsmi_get_asic_info:\n");
|
||||
printf("\tMarket Name: %s\n", asic_info.market_name);
|
||||
printf("\tFamilyID: 0x%x\n", asic_info.family);
|
||||
printf("\tDeviceID: 0x%x\n", asic_info.device_id);
|
||||
printf("\tDeviceID: 0x%lx\n", asic_info.device_id);
|
||||
printf("\tVendorID: 0x%x\n", asic_info.vendor_id);
|
||||
printf("\tRevisionID: 0x%x\n", asic_info.rev_id);
|
||||
printf("\tAsic serial: 0x%s\n\n", asic_info.asic_serial);
|
||||
@@ -233,13 +233,13 @@ int main() {
|
||||
CHK_AMDSMI_RET(ret)
|
||||
}
|
||||
printf(" Output of amdsmi_dev_get_temp_metric:\n");
|
||||
printf("\tGPU Edge temp measurement: %d\n",
|
||||
printf("\tGPU Edge temp measurement: %ld\n",
|
||||
temp_measurements[TEMPERATURE_TYPE_EDGE]);
|
||||
printf("\tGPU Junction temp measurement: %d\n",
|
||||
printf("\tGPU Junction temp measurement: %ld\n",
|
||||
temp_measurements[TEMPERATURE_TYPE_JUNCTION]);
|
||||
printf("\tGPU VRAM temp measurement: %d\n",
|
||||
printf("\tGPU VRAM temp measurement: %ld\n",
|
||||
temp_measurements[TEMPERATURE_TYPE_VRAM]);
|
||||
printf("\tGPU PLX temp measurement: %d\n\n",
|
||||
printf("\tGPU PLX temp measurement: %ld\n\n",
|
||||
temp_measurements[TEMPERATURE_TYPE_PLX]);
|
||||
|
||||
// Get bad pages
|
||||
|
||||
@@ -588,7 +588,7 @@ amdsmi_get_asic_info(amdsmi_device_handle device_handle, amdsmi_asic_info_t *inf
|
||||
std::string path = "/sys/class/drm/" + gpu_device->get_gpu_path() + "/device/unique_id";
|
||||
FILE *fp = fopen(path.c_str(), "r");
|
||||
if (fp) {
|
||||
fscanf(fp, "%s", &info->asic_serial);
|
||||
fscanf(fp, "%s", info->asic_serial);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
@@ -1945,7 +1945,7 @@ amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf,
|
||||
return status;
|
||||
}
|
||||
|
||||
for (auto idx = 0; idx < device_count; idx++) {
|
||||
for (uint32_t idx = 0; idx < device_count; idx++) {
|
||||
amd::smi::AMDSmiGPUDevice* gpu_device = nullptr;
|
||||
status = get_gpu_device_from_handle(devs[idx], &gpu_device);
|
||||
if (status != AMDSMI_STATUS_SUCCESS) {
|
||||
|
||||
Fai riferimento in un nuovo problema
Block a user