From 4cab72d69212ef8d0a31ed2796e1392aacbff93c Mon Sep 17 00:00:00 2001 From: "Poag, Charis" Date: Thu, 13 Feb 2025 13:52:34 -0600 Subject: [PATCH] [SWDEV-515298] Fix 'amdsmi_nps_flags_t' refactor (#110) Earlier commit changing union object name needed to update Python/Rust references. Change-Id: I4097dbf3b114abe91d6ca1dfd8aae4ce39fea619 Signed-off-by: Charis Poag --- py-interface/amdsmi_interface.py | 24 ++++++++++++------------ rust-interface/src/amdsmi_wrapper.rs | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/py-interface/amdsmi_interface.py b/py-interface/amdsmi_interface.py index 3423a8268f..3dded49a90 100644 --- a/py-interface/amdsmi_interface.py +++ b/py-interface/amdsmi_interface.py @@ -2842,13 +2842,13 @@ def amdsmi_get_gpu_memory_partition_config(processor_handle: amdsmi_wrapper.amds ) ) mem_caps_list = [] - if config.partition_caps.amdsmi_nps_flags_t.nps1_cap == 1: + if config.partition_caps.nps_flags.nps1_cap == 1: mem_caps_list.append("NPS1") - if config.partition_caps.amdsmi_nps_flags_t.nps2_cap == 1: + if config.partition_caps.nps_flags.nps2_cap == 1: mem_caps_list.append("NPS2") - if config.partition_caps.amdsmi_nps_flags_t.nps4_cap == 1: + if config.partition_caps.nps_flags.nps4_cap == 1: mem_caps_list.append("NPS4") - if config.partition_caps.amdsmi_nps_flags_t.nps8_cap == 1: + if config.partition_caps.nps_flags.nps8_cap == 1: mem_caps_list.append("NPS8") return_dict = { @@ -2926,13 +2926,13 @@ def amdsmi_get_gpu_accelerator_partition_profile( partition_ids = "N/A" mem_caps_list = [] - if profile.memory_caps.amdsmi_nps_flags_t.nps1_cap == 1: + if profile.memory_caps.nps_flags.nps1_cap == 1: mem_caps_list.append("NPS1") - if profile.memory_caps.amdsmi_nps_flags_t.nps2_cap == 1: + if profile.memory_caps.nps_flags.nps2_cap == 1: mem_caps_list.append("NPS2") - if profile.memory_caps.amdsmi_nps_flags_t.nps4_cap == 1: + if profile.memory_caps.nps_flags.nps4_cap == 1: mem_caps_list.append("NPS4") - if profile.memory_caps.amdsmi_nps_flags_t.nps8_cap == 1: + if profile.memory_caps.nps_flags.nps8_cap == 1: mem_caps_list.append("NPS8") partition_profile_dict = { @@ -2980,13 +2980,13 @@ def amdsmi_get_gpu_accelerator_partition_profile_config(processor_handle: amdsmi mem_caps_list = [] - if profile.memory_caps.amdsmi_nps_flags_t.nps1_cap == 1: + if profile.memory_caps.nps_flags.nps1_cap == 1: mem_caps_list.append("NPS1") - if profile.memory_caps.amdsmi_nps_flags_t.nps2_cap == 1: + if profile.memory_caps.nps_flags.nps2_cap == 1: mem_caps_list.append("NPS2") - if profile.memory_caps.amdsmi_nps_flags_t.nps4_cap == 1: + if profile.memory_caps.nps_flags.nps4_cap == 1: mem_caps_list.append("NPS4") - if profile.memory_caps.amdsmi_nps_flags_t.nps8_cap == 1: + if profile.memory_caps.nps_flags.nps8_cap == 1: mem_caps_list.append("NPS8") for r in range(config.num_resource_profiles): diff --git a/rust-interface/src/amdsmi_wrapper.rs b/rust-interface/src/amdsmi_wrapper.rs index 08d5808b38..c52b99d20d 100644 --- a/rust-interface/src/amdsmi_wrapper.rs +++ b/rust-interface/src/amdsmi_wrapper.rs @@ -972,7 +972,7 @@ const _: () = { #[repr(C)] #[derive(Copy, Clone)] pub union AmdsmiNpsCapsT { - pub amdsmi_nps_flags_t: AmdsmiNpsCapsTNpsFlags, + pub nps_flags: AmdsmiNpsCapsTNpsFlags, pub nps_cap_mask: u32, } #[repr(C)] @@ -1079,8 +1079,8 @@ impl AmdsmiNpsCapsTNpsFlags { const _: () = { ["Size of AmdsmiNpsCapsT"][::std::mem::size_of::() - 4usize]; ["Alignment of AmdsmiNpsCapsT"][::std::mem::align_of::() - 4usize]; - ["Offset of field: AmdsmiNpsCapsT::amdsmi_nps_flags_t"] - [::std::mem::offset_of!(AmdsmiNpsCapsT, amdsmi_nps_flags_t) - 0usize]; + ["Offset of field: AmdsmiNpsCapsT::nps_flags"] + [::std::mem::offset_of!(AmdsmiNpsCapsT, nps_flags) - 0usize]; ["Offset of field: AmdsmiNpsCapsT::nps_cap_mask"] [::std::mem::offset_of!(AmdsmiNpsCapsT, nps_cap_mask) - 0usize]; };