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

Fix short stringification

parent d27ee153
No related branches found
No related tags found
No related merge requests found
......@@ -169,11 +169,14 @@ def short_stringify_vectorization_strategy(strategy):
stage1 = []
stage3 = []
keys = set(sf.cache_key for sf in strategy.values())
for kernel in strategy.values():
if kernel.stage == 1:
stage1.append(_short(kernel))
if kernel.stage == 3:
stage3.append(_short(kernel))
if kernel.cache_key in keys:
keys.discard(kernel.cache_key)
if kernel.stage == 1:
stage1.append(_short(kernel))
if kernel.stage == 3:
stage3.append(_short(kernel))
return "m0={};S1:{};S3:{}".format(qp[0], "|".join(stage1), "|".join(stage3))
......@@ -267,6 +270,7 @@ def level1_optimal_vectorization_strategy(sumfacts, width):
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))
print("The optimal cost would be: {}".format(strategy_cost(level1_optimal_vectorization_strategy(sumfacts, width))))
set_form_option("vectorization_strategy", "target")
print("The score in 'target' logic was: {}".format(strategy_cost((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