[SWDEV-504583] Resolve Additional Compiler Warnings
Signed-off-by: Joseph Narlo <joseph.narlo@amd.com>
[ROCm/amdsmi commit: dc228398d0]
Αυτή η υποβολή περιλαμβάνεται σε:
υποβλήθηκε από
Maisam Arif
γονέας
cdf612c53c
υποβολή
ab88f38fa0
@@ -871,7 +871,7 @@ int main() {
|
|||||||
idx = 0;
|
idx = 0;
|
||||||
for (const auto& temp : smu.xgmi_link_status) {
|
for (const auto& temp : smu.xgmi_link_status) {
|
||||||
std::cout << temp;
|
std::cout << temp;
|
||||||
if ((idx + 1) != std::size(smu.xgmi_link_status)) {
|
if ((idx + 1) != static_cast<int>(std::size(smu.xgmi_link_status))) {
|
||||||
std::cout << ", ";
|
std::cout << ", ";
|
||||||
} else {
|
} else {
|
||||||
std::cout << "]\n";
|
std::cout << "]\n";
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
@@ -5855,9 +5856,6 @@ rsmi_dev_compute_partition_xcp_config_set(uint32_t dv_ind,
|
|||||||
const int kLen30 = 30;
|
const int kLen30 = 30;
|
||||||
char available_xcp_configs[kLen30];
|
char available_xcp_configs[kLen30];
|
||||||
available_xcp_configs[0] = '\0';
|
available_xcp_configs[0] = '\0';
|
||||||
const int kLen5 = 5;
|
|
||||||
char current_xcp_config[kLen5];
|
|
||||||
current_xcp_config[0] = '\0';
|
|
||||||
|
|
||||||
switch (xcp_config) {
|
switch (xcp_config) {
|
||||||
case RSMI_COMPUTE_PARTITION_CPX:
|
case RSMI_COMPUTE_PARTITION_CPX:
|
||||||
@@ -7126,7 +7124,7 @@ rsmi_event_notification_get(int timeout_ms,
|
|||||||
uint64_t bitmask;
|
uint64_t bitmask;
|
||||||
uint64_t counter;
|
uint64_t counter;
|
||||||
|
|
||||||
sscanf(message, "%llx:%llx\n", &bitmask, &counter);
|
sscanf(message, "%" PRIx64 ":%" PRIx64 "\n", &bitmask, &counter);
|
||||||
std::stringstream final_message;
|
std::stringstream final_message;
|
||||||
final_message << "bitmask: 0x" << std::hex << bitmask
|
final_message << "bitmask: 0x" << std::hex << bitmask
|
||||||
<< " counter: 0x" << std::hex << counter;
|
<< " counter: 0x" << std::hex << counter;
|
||||||
@@ -7152,7 +7150,8 @@ rsmi_event_notification_get(int timeout_ms,
|
|||||||
{
|
{
|
||||||
uint32_t reset_seq_num;
|
uint32_t reset_seq_num;
|
||||||
|
|
||||||
sscanf(message, "%x %[^\n]\n", &reset_seq_num);
|
char tmp[MAX_EVENT_NOTIFICATION_MSG_SIZE];
|
||||||
|
sscanf(message, "%x %[^\n]\n", &reset_seq_num, tmp);
|
||||||
std::stringstream final_message;
|
std::stringstream final_message;
|
||||||
final_message << "reset sequence number: " << std::to_string(reset_seq_num).c_str();
|
final_message << "reset sequence number: " << std::to_string(reset_seq_num).c_str();
|
||||||
|
|
||||||
@@ -7165,13 +7164,13 @@ rsmi_event_notification_get(int timeout_ms,
|
|||||||
int32_t pid;
|
int32_t pid;
|
||||||
uint32_t start;
|
uint32_t start;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
uint16_t from;
|
uint32_t from;
|
||||||
uint16_t to;
|
uint32_t to;
|
||||||
uint16_t prefetch_loc;
|
uint32_t prefetch_loc;
|
||||||
uint16_t preferred_loc;
|
uint32_t preferred_loc;
|
||||||
int32_t migrate_trigger;
|
int32_t migrate_trigger;
|
||||||
|
|
||||||
sscanf(message, "%lld -%d @%lx(%lx) %x->%x %x:%x %d\n", &ns, &pid, &start, &size, &from, &to, &prefetch_loc, &preferred_loc, &migrate_trigger);
|
sscanf(message, "%" PRId64 " -%d @%" PRIu32 "(%" PRIu32 ") %x->%x %x:%x %d\n", &ns, &pid, &start, &size, &from, &to, &prefetch_loc, &preferred_loc, &migrate_trigger);
|
||||||
std::stringstream final_message;
|
std::stringstream final_message;
|
||||||
final_message << "nd: " << std::to_string(ns).c_str()
|
final_message << "nd: " << std::to_string(ns).c_str()
|
||||||
<< " pid: " << std::to_string(pid).c_str()
|
<< " pid: " << std::to_string(pid).c_str()
|
||||||
@@ -7197,7 +7196,7 @@ rsmi_event_notification_get(int timeout_ms,
|
|||||||
uint32_t migrate_trigger;
|
uint32_t migrate_trigger;
|
||||||
uint32_t error_code;
|
uint32_t error_code;
|
||||||
|
|
||||||
sscanf(message, "%lld -%d @%lx(%lx) %x->%x %d %d\n", &ns, &pid, &start, &size, &from, &to, &migrate_trigger, &error_code);
|
sscanf(message, "%" PRId64 " -%d @%" PRIu32 "(%" PRIu32 ") %x->%x %d %d\n", &ns, &pid, &start, &size, &from, &to, &migrate_trigger, &error_code);
|
||||||
std::stringstream final_message;
|
std::stringstream final_message;
|
||||||
final_message << "nd: " << std::to_string(ns).c_str()
|
final_message << "nd: " << std::to_string(ns).c_str()
|
||||||
<< " pid: " << std::to_string(pid).c_str()
|
<< " pid: " << std::to_string(pid).c_str()
|
||||||
@@ -7217,9 +7216,9 @@ rsmi_event_notification_get(int timeout_ms,
|
|||||||
int32_t pid;
|
int32_t pid;
|
||||||
uint32_t addr;
|
uint32_t addr;
|
||||||
uint32_t node;
|
uint32_t node;
|
||||||
char *rw;
|
char *rw = "\0";
|
||||||
|
|
||||||
sscanf(message, "%lld -%d @%lx(%x) %c\n", &ns, &pid, &addr, &node, rw);
|
sscanf(message, "%" PRId64 " -%d @%" PRIx32 "(%x) %c\n", &ns, &pid, &addr, &node, rw);
|
||||||
std::stringstream final_message;
|
std::stringstream final_message;
|
||||||
final_message << "ns: " << std::to_string(ns).c_str()
|
final_message << "ns: " << std::to_string(ns).c_str()
|
||||||
<< " pid: " << std::to_string(pid).c_str()
|
<< " pid: " << std::to_string(pid).c_str()
|
||||||
@@ -7236,9 +7235,9 @@ rsmi_event_notification_get(int timeout_ms,
|
|||||||
int32_t pid;
|
int32_t pid;
|
||||||
uint32_t addr;
|
uint32_t addr;
|
||||||
uint32_t node;
|
uint32_t node;
|
||||||
char *migrate_update;
|
char *migrate_update = "\0";
|
||||||
|
|
||||||
sscanf(message, "%lld -%d @%lx(%x) %c\n", &ns, &pid, &addr, &node, migrate_update);
|
sscanf(message, "%" PRId64 " -%d @%" PRIx32 "(%x) %c\n", &ns, &pid, &addr, &node, migrate_update);
|
||||||
std::stringstream final_message;
|
std::stringstream final_message;
|
||||||
final_message << "ns: " << std::to_string(ns).c_str()
|
final_message << "ns: " << std::to_string(ns).c_str()
|
||||||
<< " pid: " << std::to_string(pid).c_str()
|
<< " pid: " << std::to_string(pid).c_str()
|
||||||
@@ -7256,7 +7255,7 @@ rsmi_event_notification_get(int timeout_ms,
|
|||||||
uint32_t node;
|
uint32_t node;
|
||||||
uint32_t evict_trigger;
|
uint32_t evict_trigger;
|
||||||
|
|
||||||
sscanf(message, "%lld -%d %x %d\n", &ns, &pid, &node, &evict_trigger);
|
sscanf(message, "%" PRId64 "-%d %x %d\n", &ns, &pid, &node, &evict_trigger);
|
||||||
std::stringstream final_message;
|
std::stringstream final_message;
|
||||||
final_message << "ns: " << std::to_string(ns).c_str()
|
final_message << "ns: " << std::to_string(ns).c_str()
|
||||||
<< " pid: " << std::to_string(pid).c_str()
|
<< " pid: " << std::to_string(pid).c_str()
|
||||||
@@ -7271,9 +7270,9 @@ rsmi_event_notification_get(int timeout_ms,
|
|||||||
int64_t ns;
|
int64_t ns;
|
||||||
int32_t pid;
|
int32_t pid;
|
||||||
uint32_t node;
|
uint32_t node;
|
||||||
char *rescheduled;
|
char *rescheduled = "\0";
|
||||||
|
|
||||||
sscanf(message, "%lld -%d %x %c\n", &ns, &pid, &node, rescheduled);
|
sscanf(message, "%" PRId64 "-%d %x %c\n", &ns, &pid, &node, rescheduled);
|
||||||
std::stringstream final_message;
|
std::stringstream final_message;
|
||||||
final_message << "ns: " << std::to_string(ns).c_str()
|
final_message << "ns: " << std::to_string(ns).c_str()
|
||||||
<< " pid: " << std::to_string(pid).c_str()
|
<< " pid: " << std::to_string(pid).c_str()
|
||||||
@@ -7292,7 +7291,7 @@ rsmi_event_notification_get(int timeout_ms,
|
|||||||
uint32_t node;
|
uint32_t node;
|
||||||
uint32_t unmap_trigger;
|
uint32_t unmap_trigger;
|
||||||
|
|
||||||
sscanf(message, "%lld -%d @%lx(%lx) %x %d\n", &ns, &pid, &addr, &size, &node, &unmap_trigger);
|
sscanf(message, "%" PRId64 " -%d @%" PRIx32 "(%" PRIx32 ") %x %d\n", &ns, &pid, &addr, &size, &node, &unmap_trigger);
|
||||||
std::stringstream final_message;
|
std::stringstream final_message;
|
||||||
final_message << "ns: " << std::to_string(ns).c_str()
|
final_message << "ns: " << std::to_string(ns).c_str()
|
||||||
<< " pid: " << std::to_string(pid).c_str()
|
<< " pid: " << std::to_string(pid).c_str()
|
||||||
|
|||||||
@@ -583,11 +583,11 @@ void GpuMetricsBase_v17_t::dump_internal_metrics_table()
|
|||||||
}
|
}
|
||||||
for (auto& col : row.gfx_busy_inst) {
|
for (auto& col : row.gfx_busy_inst) {
|
||||||
ss << "\t [" << idx << "] [" << idy << "]: " << col;
|
ss << "\t [" << idx << "] [" << idy << "]: " << col;
|
||||||
if (idy + 1 != (std::end(row.gfx_busy_inst) - std::end(row.gfx_busy_inst) - 1)) {
|
if (idy + 1 != static_cast<uint64_t>((std::end(row.gfx_busy_inst) - std::end(row.gfx_busy_inst) - 1))) {
|
||||||
ss << ", ";
|
ss << ", ";
|
||||||
}
|
}
|
||||||
if (idx + 1 !=
|
if (idx + 1 !=
|
||||||
(std::end(m_gpu_metrics_tbl.m_xcp_stats) - std::end(m_gpu_metrics_tbl.m_xcp_stats) - 1)) {
|
static_cast<uint64_t>((std::end(m_gpu_metrics_tbl.m_xcp_stats) - std::end(m_gpu_metrics_tbl.m_xcp_stats) - 1))) {
|
||||||
ss << "\n";
|
ss << "\n";
|
||||||
} else {
|
} else {
|
||||||
ss << "]\n";
|
ss << "]\n";
|
||||||
@@ -606,11 +606,11 @@ void GpuMetricsBase_v17_t::dump_internal_metrics_table()
|
|||||||
}
|
}
|
||||||
for (auto& col : row.vcn_busy) {
|
for (auto& col : row.vcn_busy) {
|
||||||
ss << "\t [" << idx << "] [" << idy << "]: " << col;
|
ss << "\t [" << idx << "] [" << idy << "]: " << col;
|
||||||
if (idy + 1 != (std::end(row.vcn_busy) - std::end(row.vcn_busy) - 1)) {
|
if (idy + 1 != static_cast<uint64_t>((std::end(row.vcn_busy) - std::end(row.vcn_busy) - 1))) {
|
||||||
ss << ", ";
|
ss << ", ";
|
||||||
}
|
}
|
||||||
if (idx + 1 !=
|
if (idx + 1 !=
|
||||||
(std::end(m_gpu_metrics_tbl.m_xcp_stats) - std::end(m_gpu_metrics_tbl.m_xcp_stats) - 1)) {
|
static_cast<uint64_t>((std::end(m_gpu_metrics_tbl.m_xcp_stats) - std::end(m_gpu_metrics_tbl.m_xcp_stats) - 1))) {
|
||||||
ss << "\n";
|
ss << "\n";
|
||||||
} else {
|
} else {
|
||||||
ss << "]\n";
|
ss << "]\n";
|
||||||
@@ -629,11 +629,11 @@ void GpuMetricsBase_v17_t::dump_internal_metrics_table()
|
|||||||
}
|
}
|
||||||
for (auto& col : row.jpeg_busy) {
|
for (auto& col : row.jpeg_busy) {
|
||||||
ss << "\t [" << idx << "] [" << idy << "]: " << col;
|
ss << "\t [" << idx << "] [" << idy << "]: " << col;
|
||||||
if (idy + 1 != (std::end(row.jpeg_busy) - std::end(row.jpeg_busy) - 1)) {
|
if (idy + 1 != static_cast<uint64_t>((std::end(row.jpeg_busy) - std::end(row.jpeg_busy) - 1))) {
|
||||||
ss << ", ";
|
ss << ", ";
|
||||||
}
|
}
|
||||||
if (idx + 1 !=
|
if (idx + 1 !=
|
||||||
(std::end(m_gpu_metrics_tbl.m_xcp_stats) - std::end(m_gpu_metrics_tbl.m_xcp_stats) - 1)) {
|
static_cast<uint64_t>((std::end(m_gpu_metrics_tbl.m_xcp_stats) - std::end(m_gpu_metrics_tbl.m_xcp_stats) - 1))) {
|
||||||
ss << "\n";
|
ss << "\n";
|
||||||
} else {
|
} else {
|
||||||
ss << "]\n";
|
ss << "]\n";
|
||||||
@@ -652,11 +652,11 @@ void GpuMetricsBase_v17_t::dump_internal_metrics_table()
|
|||||||
}
|
}
|
||||||
for (auto& col : row.gfx_busy_acc) {
|
for (auto& col : row.gfx_busy_acc) {
|
||||||
ss << "\t [" << idx << "] [" << idy << "]: " << col;
|
ss << "\t [" << idx << "] [" << idy << "]: " << col;
|
||||||
if (idy + 1 != (std::end(row.gfx_busy_acc) - std::end(row.gfx_busy_acc) - 1)) {
|
if (idy + 1 != static_cast<uint64_t>((std::end(row.gfx_busy_acc) - std::end(row.gfx_busy_acc) - 1))) {
|
||||||
ss << ", ";
|
ss << ", ";
|
||||||
}
|
}
|
||||||
if (idx + 1 !=
|
if (idx + 1 !=
|
||||||
(std::end(m_gpu_metrics_tbl.m_xcp_stats) - std::end(m_gpu_metrics_tbl.m_xcp_stats) - 1)) {
|
static_cast<uint64_t>((std::end(m_gpu_metrics_tbl.m_xcp_stats) - std::end(m_gpu_metrics_tbl.m_xcp_stats) - 1))) {
|
||||||
ss << "\n";
|
ss << "\n";
|
||||||
} else {
|
} else {
|
||||||
ss << "]\n";
|
ss << "]\n";
|
||||||
|
|||||||
@@ -1300,7 +1300,7 @@ amdsmi_get_gpu_xgmi_link_status(amdsmi_processor_handle processor_handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t dev_num = 0;
|
uint32_t dev_num = 0;
|
||||||
auto r = rsmi_num_monitor_devices(&dev_num);
|
rsmi_num_monitor_devices(&dev_num);
|
||||||
link_status->total_links = AMDSMI_MAX_NUM_XGMI_LINKS;
|
link_status->total_links = AMDSMI_MAX_NUM_XGMI_LINKS;
|
||||||
if (dev_num <= link_status->total_links) {
|
if (dev_num <= link_status->total_links) {
|
||||||
link_status->total_links = dev_num;
|
link_status->total_links = dev_num;
|
||||||
@@ -2030,7 +2030,7 @@ amdsmi_get_gpu_accelerator_partition_profile_config(amdsmi_processor_handle proc
|
|||||||
LOG_DEBUG(ss);
|
LOG_DEBUG(ss);
|
||||||
auto resource_index = 0;
|
auto resource_index = 0;
|
||||||
// get resource info for each profile
|
// get resource info for each profile
|
||||||
for (auto i = 0; i < profile_config->num_profiles; i++) {
|
for (auto i = 0U; i < profile_config->num_profiles; i++) {
|
||||||
auto it = partition_types_map.find(profile_config->profiles[i].profile_type);
|
auto it = partition_types_map.find(profile_config->profiles[i].profile_type);
|
||||||
std::string partition_type_str = "UNKNOWN";
|
std::string partition_type_str = "UNKNOWN";
|
||||||
if (it != partition_types_map.end()) {
|
if (it != partition_types_map.end()) {
|
||||||
@@ -2223,7 +2223,6 @@ amdsmi_get_gpu_accelerator_partition_profile(amdsmi_processor_handle processor_h
|
|||||||
|
|
||||||
// TODO(amdsmi_team): add resources here ^
|
// TODO(amdsmi_team): add resources here ^
|
||||||
auto tmp_partition_id = uint32_t(0);
|
auto tmp_partition_id = uint32_t(0);
|
||||||
auto tmp_xcd_count = uint16_t(0);
|
|
||||||
amdsmi_status_t status = AMDSMI_STATUS_NOT_SUPPORTED;
|
amdsmi_status_t status = AMDSMI_STATUS_NOT_SUPPORTED;
|
||||||
|
|
||||||
// get xcp config info (this will tell use # of profiles/index's)
|
// get xcp config info (this will tell use # of profiles/index's)
|
||||||
@@ -2279,7 +2278,7 @@ amdsmi_get_gpu_accelerator_partition_profile(amdsmi_processor_handle processor_h
|
|||||||
if (accelerator_capabilities.find(current_partition_str) != std::string::npos) {
|
if (accelerator_capabilities.find(current_partition_str) != std::string::npos) {
|
||||||
auto it = std::find(tokens.begin(), tokens.end(), current_partition_str);
|
auto it = std::find(tokens.begin(), tokens.end(), current_partition_str);
|
||||||
if (it != tokens.end()) {
|
if (it != tokens.end()) {
|
||||||
profile->profile_index = std::distance(tokens.begin(), it);
|
profile->profile_index = static_cast<uint32_t>(std::distance(tokens.begin(), it));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2403,7 +2402,7 @@ amdsmi_set_gpu_accelerator_partition_profile(amdsmi_processor_handle processor_h
|
|||||||
partition_type_str.clear();
|
partition_type_str.clear();
|
||||||
partition_type_str = it->second;
|
partition_type_str = it->second;
|
||||||
}
|
}
|
||||||
config.profiles[i].profile_index;
|
|
||||||
ss << __PRETTY_FUNCTION__ << " | "
|
ss << __PRETTY_FUNCTION__ << " | "
|
||||||
<< "config.profiles[" << i << "].profile_type: "
|
<< "config.profiles[" << i << "].profile_type: "
|
||||||
<< static_cast<int>(config.profiles[i].profile_type) << "\n"
|
<< static_cast<int>(config.profiles[i].profile_type) << "\n"
|
||||||
|
|||||||
@@ -475,7 +475,7 @@ amdsmi_status_t smi_amdgpu_validate_ras_eeprom(amd::smi::AMDSmiGPUDevice* device
|
|||||||
}
|
}
|
||||||
SMIGPUDEVICE_MUTEX(device->get_mutex())
|
SMIGPUDEVICE_MUTEX(device->get_mutex())
|
||||||
|
|
||||||
uint32_t index = GetDeviceIndex(device->get_gpu_path());
|
//uint32_t index = GetDeviceIndex(device->get_gpu_path());
|
||||||
//TODO: need to expose the corresponding interface to validate the checksum of ras eeprom table.
|
//TODO: need to expose the corresponding interface to validate the checksum of ras eeprom table.
|
||||||
//verify fail: return AMDSMI_STATUS_CORRUPTED_EEPROM
|
//verify fail: return AMDSMI_STATUS_CORRUPTED_EEPROM
|
||||||
return AMDSMI_STATUS_NOT_SUPPORTED;
|
return AMDSMI_STATUS_NOT_SUPPORTED;
|
||||||
@@ -625,8 +625,6 @@ amdsmi_status_t smi_amdgpu_get_market_name_from_dev_id(amd::smi::AMDSmiGPUDevice
|
|||||||
|
|
||||||
uint32_t gpu_fd = device->get_gpu_fd();
|
uint32_t gpu_fd = device->get_gpu_fd();
|
||||||
|
|
||||||
char drm_path[32];
|
|
||||||
|
|
||||||
int ret = amdgpu_device_initialize(gpu_fd, &major_version, &minor_version, &device_handle);
|
int ret = amdgpu_device_initialize(gpu_fd, &major_version, &minor_version, &device_handle);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
return AMDSMI_STATUS_DRM_ERROR;
|
return AMDSMI_STATUS_DRM_ERROR;
|
||||||
|
|||||||
Αναφορά σε νέο ζήτημα
Block a user