[SWDEV-562726] Fix clang + ASAN errors

* Updates:
  - [ASAN] GCC does not support `-shared-libsan flags`, so removed this one
  - [Clang] Fixed refernces to local binding errors (name collision)
    & other strict scope/structure/lamda binding errors
  - [Clang] Fix rsmi_wrapper error: \"error: missing default argument on parameter \'args\'\"
  - [ASAN] Fixed stack-buffer-overflow found in
    `amdsmi_get_gpu_accelerator_partition_profile()`

Change-Id: I854007efb75d828dbb8088c0d56dbc125081f0f2
Signed-off-by: Charis Poag <Charis.Poag@amd.com>


[ROCm/amdsmi commit: 00a04f5810]
This commit is contained in:
Charis Poag
2025-10-27 13:07:49 -05:00
committed by Arif, Maisam
parent 54317f3fe8
commit fee59b2c58
4 changed files with 48 additions and 58 deletions
+3 -3
View File
@@ -145,7 +145,7 @@ static amdsmi_status_t get_gpu_device_from_handle(amdsmi_processor_handle proces
template <typename F, typename ...Args>
amdsmi_status_t rsmi_wrapper(F && f,
amdsmi_processor_handle processor_handle, uint32_t increment_gpu_id = 0, Args &&... args) {
amdsmi_processor_handle processor_handle, uint32_t increment_gpu_id, Args &&... args) {
AMDSMI_CHECK_INIT();
@@ -3057,8 +3057,8 @@ amdsmi_get_gpu_accelerator_partition_profile(amdsmi_processor_handle processor_h
std::end(tokens),
amd::smi::make_ostream_joiner(&ss_1, ", "));
constexpr uint32_t kCurrentPartitionSize = 5;
char current_partition[kCurrentPartitionSize];
constexpr uint32_t kCurrentPartitionSize = 16;
char current_partition[kCurrentPartitionSize] = {0};
std::string current_partition_str = "N/A";
amdsmi_status_t compute_status = amdsmi_get_gpu_compute_partition(processor_handle,
current_partition, kCurrentPartitionSize);