From 2a3c58669dff71c9b00fdf0e77d725a2e3d3b4b7 Mon Sep 17 00:00:00 2001 From: Ishita Ghosh Date: Wed, 18 Sep 2024 14:40:56 -0700 Subject: [PATCH] Fix Debug build warning and error Signed-off-by: Ishita Ghosh --- .../plugin/aie_profile/client/aie_profile.cpp | 9 ++----- .../plugin/aie_trace/client/aie_trace.cpp | 27 +++++-------------- 2 files changed, 9 insertions(+), 27 deletions(-) diff --git a/src/runtime_src/xdp/profile/plugin/aie_profile/client/aie_profile.cpp b/src/runtime_src/xdp/profile/plugin/aie_profile/client/aie_profile.cpp index 3b90b731687..eb579027db8 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_profile/client/aie_profile.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_profile/client/aie_profile.cpp @@ -113,14 +113,9 @@ namespace xdp { } // Get partition columns - // NOTE: for now, assume a single partition - uint8_t startCol = 0; boost::property_tree::ptree aiePartitionPt = xdp::aie::getAIEPartitionInfoClient(metadata->getHandle()); - for (const auto& e : aiePartitionPt) { - startCol = static_cast(e.second.get("start_col")); - // Currently, assuming only one Hw Context is alive at a time - break; - } + // Currently, assuming only one Hw Context is alive at a time + uint8_t startCol = static_cast(aiePartitionPt.front().second.get("start_col")); //Start recording the transaction XAie_StartTransaction(&aieDevInst, XAIE_TRANSACTION_DISABLE_AUTO_FLUSH); diff --git a/src/runtime_src/xdp/profile/plugin/aie_trace/client/aie_trace.cpp b/src/runtime_src/xdp/profile/plugin/aie_trace/client/aie_trace.cpp index 9e9333c8e10..95a6694c119 100644 --- a/src/runtime_src/xdp/profile/plugin/aie_trace/client/aie_trace.cpp +++ b/src/runtime_src/xdp/profile/plugin/aie_trace/client/aie_trace.cpp @@ -223,14 +223,10 @@ namespace xdp { void AieTrace_WinImpl::build2ChannelBroadcastNetwork(void *hwCtxImpl, uint8_t broadcastId1, uint8_t broadcastId2, XAie_Events event) { - uint8_t startCol = 0, numCols = 0; boost::property_tree::ptree aiePartitionPt = xdp::aie::getAIEPartitionInfoClient(hwCtxImpl); - for (const auto& e : aiePartitionPt) { - startCol = static_cast(e.second.get("start_col")); - numCols = static_cast(e.second.get("num_cols")); - // Currently, assuming only one Hw Context is alive at a time - break; - } + // Currently, assuming only one Hw Context is alive at a time + uint8_t startCol = static_cast(aiePartitionPt.front().second.get("start_col")); + uint8_t numCols = static_cast(aiePartitionPt.front().second.get("num_cols")); std::vector maxRowAtCol(startCol + numCols, 0); for (auto& tileMetric : metadata->getConfigMetrics()) { @@ -298,13 +294,9 @@ namespace xdp { //Start recording the transaction XAie_StartTransaction(&aieDevInst, XAIE_TRANSACTION_DISABLE_AUTO_FLUSH); - uint8_t startCol = 0; boost::property_tree::ptree aiePartitionPt = xdp::aie::getAIEPartitionInfoClient(hwCtxImpl); - for (const auto& e : aiePartitionPt) { - startCol = static_cast(e.second.get("start_col")); - // Currently, assuming only one Hw Context is alive at a time - break; - } + // Currently, assuming only one Hw Context is alive at a time + uint8_t startCol = static_cast(aiePartitionPt.front().second.get("start_col")); uint8_t broadcastId1 = 6; uint8_t broadcastId2 = 7; @@ -1022,14 +1014,9 @@ namespace xdp { (void)deviceId; // Get partition columns - // NOTE: for now, assume a single partition - uint8_t startCol = 0; boost::property_tree::ptree aiePartitionPt = xdp::aie::getAIEPartitionInfoClient(hwCtxImpl); - for (const auto& e : aiePartitionPt) { - startCol = static_cast(e.second.get("start_col")); - // Currently, assuming only one Hw Context is alive at a time - break; - } + // Currently, assuming only one Hw Context is alive at a time + uint8_t startCol = static_cast(aiePartitionPt.front().second.get("start_col")); std::string startType = xrt_core::config::get_aie_trace_settings_start_type(); unsigned int startLayer = xrt_core::config::get_aie_trace_settings_start_layer();