From 52aaab3c0963ed7fc741bb2b24be71fc24efe7e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20F=C3=BCrst?= Date: Wed, 24 Jan 2024 13:31:33 +0100 Subject: [PATCH] prevent illegal instruction exception when no measurements have been conducted --- qdp_project/src/Benchmark.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/qdp_project/src/Benchmark.cpp b/qdp_project/src/Benchmark.cpp index 07c7ebe..67a875a 100644 --- a/qdp_project/src/Benchmark.cpp +++ b/qdp_project/src/Benchmark.cpp @@ -133,8 +133,10 @@ void process_timings( } } - *scana_run /= scana_rc; - *scana_wait /= scana_rc; + if (scana_rc != 0) { + *scana_run /= scana_rc; + *scana_wait /= scana_rc; + } } { uint64_t scanb_rc = 0; @@ -147,8 +149,10 @@ void process_timings( } } - *scana_run /= scanb_rc; - *scana_wait /= scanb_rc; + if (scanb_rc != 0) { + *scana_run /= scanb_rc; + *scana_wait /= scanb_rc; + } } { uint64_t aggrj_rc = 0; @@ -161,8 +165,10 @@ void process_timings( } } - *aggrj_run /= aggrj_rc; - *aggrj_wait /= aggrj_rc; + if (aggrj_rc != 0) { + *aggrj_run /= aggrj_rc; + *aggrj_wait /= aggrj_rc; + } } }