From cacf47eaf9b157d55031f68325f548937ab2393f Mon Sep 17 00:00:00 2001 From: Jason Villarreal <40246282+jvillarre@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:45:34 -0700 Subject: [PATCH] Bounding the maximum transfer rate we report to 10 GB/s (#8456) --- .../xdp/profile/writer/vp_base/summary_writer.cpp | 8 +++++++- .../xdp/profile/writer/vp_base/summary_writer.h | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/runtime_src/xdp/profile/writer/vp_base/summary_writer.cpp b/src/runtime_src/xdp/profile/writer/vp_base/summary_writer.cpp index 954a859b0b3..6aede57ccae 100644 --- a/src/runtime_src/xdp/profile/writer/vp_base/summary_writer.cpp +++ b/src/runtime_src/xdp/profile/writer/vp_base/summary_writer.cpp @@ -1,6 +1,6 @@ /** * Copyright (C) 2016-2022 Xilinx, Inc - * Copyright (C) 2022-2023 Advanced Micro Devices, Inc - All rights reserved + * Copyright (C) 2022-2024 Advanced Micro Devices, Inc - All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"). You may * not use this file except in compliance with the License. A copy of the @@ -1860,6 +1860,9 @@ namespace xdp { double durationMS = static_cast((iter).duration) / one_million ; double rate = (static_cast((iter).size) / one_thousand) / durationMS ; fout << durationMS << "," ; + + if (rate > maxHostTransferRate) + rate = maxHostTransferRate; fout << rate << "," ; } fout << "\n" ; @@ -1892,6 +1895,9 @@ namespace xdp { double durationMS = static_cast((iter).duration) / one_million ; double rate = (static_cast((iter).size) / one_thousand) / durationMS ; fout << durationMS << "," ; + + if (rate > maxHostTransferRate) + rate = maxHostTransferRate; fout << rate << "," ; } fout << "\n" ; diff --git a/src/runtime_src/xdp/profile/writer/vp_base/summary_writer.h b/src/runtime_src/xdp/profile/writer/vp_base/summary_writer.h index db6f5418db5..9143db1299e 100644 --- a/src/runtime_src/xdp/profile/writer/vp_base/summary_writer.h +++ b/src/runtime_src/xdp/profile/writer/vp_base/summary_writer.h @@ -1,6 +1,6 @@ /** * Copyright (C) 2016-2022 Xilinx, Inc - * Copyright (C) 2022-2023 Advanced Micro Devices, Inc. - All rights reserved + * Copyright (C) 2022-2024 Advanced Micro Devices, Inc. - All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"). You may * not use this file except in compliance with the License. A copy of the @@ -107,6 +107,9 @@ namespace xdp { static constexpr double one_million = 1.0e06 ; static constexpr double one_billion = 1.0e09 ; + // Values used for bounding the values we report in tables + static constexpr double maxHostTransferRate = 10000.0; // In MB/s + public: XDP_CORE_EXPORT SummaryWriter(const char* filename) ; XDP_CORE_EXPORT SummaryWriter(const char* filename, VPDatabase* inst) ;