Skip to content
Snippets Groups Projects
Commit 7902335a authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Add a bit of error handling to google benchmark

parent 43e5bcd4
No related branches found
No related tags found
No related merge requests found
...@@ -363,7 +363,11 @@ def autotune_realization(sf): ...@@ -363,7 +363,11 @@ def autotune_realization(sf):
if get_option("autotune_google_benchmark"): if get_option("autotune_google_benchmark"):
import json import json
with open(logname) as json_file: with open(logname) as json_file:
data = json.load(json_file) try:
return data['benchmarks'][0]['cpu_time'] data = json.load(json_file)
return data['benchmarks'][0]['cpu_time']
except Exception as e:
print("Error while loading file {}".format(logname))
raise e
else: else:
return float(next(iter(open(logname, "r")))) / 1000000 return float(next(iter(open(logname, "r")))) / 1000000
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment