From 50d792c844a4dcefc6a8bf7a18335e668ea452c5 Mon Sep 17 00:00:00 2001 From: Colleen Bertoni Date: Tue, 15 Oct 2024 15:59:00 +0000 Subject: [PATCH 1/2] adding in a different return if it's not valid --- src/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 32b01be..1033c8a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -388,9 +388,15 @@ std::pair> validate(const Sample &sample, const Para } // flush at the end to make sure errors are clumped together std::cerr << std::flush; + return {valid, maxDiffPct, s, SummaryStats({ std::numeric_limits::max() }), 0, 0, 0}; } + else if( !valid) + return {valid, maxDiffPct, s, SummaryStats({ std::numeric_limits::max() }), 0, 0, 0}; + else { + return {valid, maxDiffPct, s, SummaryStats(msWithoutWarmup), gflops, gfinsts, interactions_per_sec}; + } + - return {valid, maxDiffPct, s, SummaryStats(msWithoutWarmup), gflops, gfinsts, interactions_per_sec}; } [[nodiscard]] std::pair selectDevice(const std::string &needle, From a99498653ee1c54f7897be7ec15a56659e924ba8 Mon Sep 17 00:00:00 2001 From: Colleen Bertoni Date: Tue, 15 Oct 2024 16:51:26 +0000 Subject: [PATCH 2/2] pushing after running with clang-format --- src/main.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 1033c8a..9d96c90 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,11 +5,11 @@ #include #include +#include #include -#include #include -#include #include +#include #include #include "bude.h" @@ -27,8 +27,7 @@ #endif #ifndef MINIBUDE_COMPILE_COMMANDS - #define MINIBUDE_COMPILE_COMMANDS \ - { MINIBUDE_WARN_NOT_CMAKE } + #define MINIBUDE_COMPILE_COMMANDS {MINIBUDE_WARN_NOT_CMAKE} #endif #ifdef USE_CPU_FEATURES @@ -388,15 +387,12 @@ std::pair> validate(const Sample &sample, const Para } // flush at the end to make sure errors are clumped together std::cerr << std::flush; - return {valid, maxDiffPct, s, SummaryStats({ std::numeric_limits::max() }), 0, 0, 0}; - } - else if( !valid) - return {valid, maxDiffPct, s, SummaryStats({ std::numeric_limits::max() }), 0, 0, 0}; + return {valid, maxDiffPct, s, SummaryStats({std::numeric_limits::max()}), 0, 0, 0}; + } else if (!valid) + return {valid, maxDiffPct, s, SummaryStats({std::numeric_limits::max()}), 0, 0, 0}; else { - return {valid, maxDiffPct, s, SummaryStats(msWithoutWarmup), gflops, gfinsts, interactions_per_sec}; - } - - + return {valid, maxDiffPct, s, SummaryStats(msWithoutWarmup), gflops, gfinsts, interactions_per_sec}; + } } [[nodiscard]] std::pair selectDevice(const std::string &needle,