Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions benchmark_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# Contributor: Jeremy Bennett <jeremy.bennett@embecosm.com>
# Contributor: Roger Shepherd <roger.shepherd@rcjd.net>
# Contributor: Konrad Moreon <konrad.moron@tum.de>
# Contributor: Madhu Sudhanan <madhu2000u@gmail.com>
#
# This file is part of Embench.

Expand Down Expand Up @@ -297,9 +298,13 @@ def collect_data(benchmarks):
# Want relative results (the default). If baseline is zero, just
# use 0.0 as the value. Note this is inverted compared to the
# speed benchmark, so SMALL is good.
if baseline[bench] > 0:
rel_data[bench] = raw_totals[bench] / baseline[bench]
else:
try:
if baseline[bench] > 0:
rel_data[bench] = raw_totals[bench] / baseline[bench]
else:
rel_data[bench] = 0.0
except KeyError:
log.error(f'Baseline data for {bench} not found. Assuming 0.')
rel_data[bench] = 0.0

# Output it
Expand Down