From 4b05aa231cc74bf830a2b91cecf4ccb2bbdc8b6b Mon Sep 17 00:00:00 2001 From: Ryan Chane <103678133+rchane@users.noreply.github.com> Date: Sat, 20 Apr 2024 21:21:51 -0700 Subject: [PATCH] Remove MaxPower from electrical report for Ryzen (#8088) Signed-off-by: Ryan Chane --- .../tools/common/reports/ReportElectrical.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/runtime_src/core/tools/common/reports/ReportElectrical.cpp b/src/runtime_src/core/tools/common/reports/ReportElectrical.cpp index 256d027027d..c0759368a9c 100644 --- a/src/runtime_src/core/tools/common/reports/ReportElectrical.cpp +++ b/src/runtime_src/core/tools/common/reports/ReportElectrical.cpp @@ -5,6 +5,7 @@ #include "ReportElectrical.h" #include "tools/common/Table2D.h" #include "core/common/sensor.h" +#include "core/common/query_requests.h" #include @@ -26,7 +27,7 @@ ReportElectrical::getPropertyTree20202( const xrt_core::device * _pDevice, } void -ReportElectrical::writeReport( const xrt_core::device* /*_pDevice*/, +ReportElectrical::writeReport( const xrt_core::device* _pDevice, const boost::property_tree::ptree& _pt, const std::vector& /*_elementsFilter*/, std::ostream & _output) const @@ -36,9 +37,19 @@ ReportElectrical::writeReport( const xrt_core::device* /*_pDevice*/, _output << "Electrical\n"; const boost::property_tree::ptree& electricals = _pt.get_child("electrical.power_rails", empty_ptree); - auto max_watts = _pt.get("electrical.power_consumption_max_watts", "N/A"); - if (max_watts != "N/A") - _output << boost::format(" %-23s: %s Watts\n") % "Max Power" % max_watts; + std::string max_watts = "N/A"; + switch (xrt_core::device_query_default(_pDevice, xrt_core::query::device_class::type::alveo)) { + case xrt_core::query::device_class::type::alveo: + { + max_watts = _pt.get("electrical.power_consumption_max_watts", "N/A"); + if (max_watts != "N/A") + _output << boost::format(" %-23s: %s Watts\n") % "Max Power" % max_watts; + break; + } + case xrt_core::query::device_class::type::ryzen: + // We currently do not have Max Power from Ryzen devices. + break; + } auto watts = _pt.get("electrical.power_consumption_watts", "N/A"); if (watts != "N/A")