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

A bit more verbosity

parent 468e8569
No related branches found
No related tags found
No related merge requests found
......@@ -239,16 +239,29 @@ def level1_optimal_vectorization_strategy(sumfacts, width):
# If we are using the 'target' strategy, we might want to log some information.
if get_form_option("vectorization_strategy") == "target":
# Print the achieved cost and the target cost on the screen
set_form_option("vectorization_strategy", "model")
cost = strategy_cost((qp, optimal_strategies[qp]))
print("The target cost was: {}".format(get_form_option("vectorization_target")))
print("The achieved cost was: {}".format(cost))
set_form_option("vectorization_strategy", "target")
print("The score in 'target' logic was: {}".format(strategy_cost((qp, optimal_strategies[qp]))))
# Print the employed vectorization strategy into a file
from os.path import join
filename = join(get_option("project_basedir"), "targetstrat_{}".format(int(float(get_form_option("vectorization_target")))))
filename = join(get_option("project_basedir"), "costmodel-verification", "targetstrat_{}.txt".format(int(float(get_form_option("vectorization_target")))))
with open(filename, 'w') as f:
f.write("\n".join(stringify_vectorization_strategy((qp, optimal_strategies[qp]))))
set_form_option("vectorization_strategy", "target")
print("The score in 'target' logic was: {}".format(strategy_cost((qp, optimal_strategies[qp]))))
# Write an entry into a csvfile which connects the given measuring identifier with a cost
from dune.testtools.parametertree.parser import parse_ini_file
inifile = parse_ini_file(get_option("inifile"))
identifier = inifile["identifier"]
filename = join(get_option("project_basedir"), "costmodel-verification", "mapping.csv")
#TODO: Depending on the number of samples, we might need a file lock here.
with open(filename, 'a') as f:
f.write("{} {}".format(identifier, cost))
return qp, optimal_strategies[qp]
......
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