Skip to content

Commit

Permalink
Bounding the maximum transfer rate we report to 10 GB/s (Xilinx#8456)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvillarre authored Sep 25, 2024
1 parent 3353291 commit cacf47e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -1860,6 +1860,9 @@ namespace xdp {
double durationMS = static_cast<double>((iter).duration) / one_million ;
double rate = (static_cast<double>((iter).size) / one_thousand) / durationMS ;
fout << durationMS << "," ;

if (rate > maxHostTransferRate)
rate = maxHostTransferRate;
fout << rate << "," ;
}
fout << "\n" ;
Expand Down Expand Up @@ -1892,6 +1895,9 @@ namespace xdp {
double durationMS = static_cast<double>((iter).duration) / one_million ;
double rate = (static_cast<double>((iter).size) / one_thousand) / durationMS ;
fout << durationMS << "," ;

if (rate > maxHostTransferRate)
rate = maxHostTransferRate;
fout << rate << "," ;
}
fout << "\n" ;
Expand Down
5 changes: 4 additions & 1 deletion src/runtime_src/xdp/profile/writer/vp_base/summary_writer.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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) ;
Expand Down

0 comments on commit cacf47e

Please sign in to comment.