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

Remove fromlist vectorization strategy

It would be hard to implement on top of the latest feature and contradict
features projected for the near future.
parent 85ef029d
No related branches found
No related tags found
No related merge requests found
...@@ -78,7 +78,7 @@ class PerftoolFormOptionsArray(ImmutableRecord): ...@@ -78,7 +78,7 @@ class PerftoolFormOptionsArray(ImmutableRecord):
fastdg = PerftoolOption(default=False, helpstr="Use FastDGGridOperator from PDELab.") fastdg = PerftoolOption(default=False, helpstr="Use FastDGGridOperator from PDELab.")
sumfact = PerftoolOption(default=False, helpstr="Use sumfactorization") sumfact = PerftoolOption(default=False, helpstr="Use sumfactorization")
vectorization_quadloop = PerftoolOption(default=False, helpstr="whether to generate code with explicit vectorization") vectorization_quadloop = PerftoolOption(default=False, helpstr="whether to generate code with explicit vectorization")
vectorization_strategy = PerftoolOption(default="none", helpstr="The identifier of the vectorization cost model. Possible values: none|explicit|model|fromlist") vectorization_strategy = PerftoolOption(default="none", helpstr="The identifier of the vectorization cost model. Possible values: none|explicit|model")
vectorization_horizontal = PerftoolOption(default=None, helpstr="an explicit value for horizontal vectorization read by the 'explicit' strategy") vectorization_horizontal = PerftoolOption(default=None, helpstr="an explicit value for horizontal vectorization read by the 'explicit' strategy")
vectorization_vertical = PerftoolOption(default=None, helpstr="an explicit value for vertical vectorization read by the 'explicit' strategy") vectorization_vertical = PerftoolOption(default=None, helpstr="an explicit value for vertical vectorization read by the 'explicit' strategy")
vectorization_padding = PerftoolOption(default=None, helpstr="an explicit value for the allowed padding in vectorization") vectorization_padding = PerftoolOption(default=None, helpstr="an explicit value for the allowed padding in vectorization")
......
...@@ -62,12 +62,6 @@ def costmodel(sf): ...@@ -62,12 +62,6 @@ def costmodel(sf):
return sf.operations * vertical_penalty * scalar_penalty return sf.operations * vertical_penalty * scalar_penalty
@backend(interface="vectorization_strategy", name="fromlist")
def fromlist_costmodel(sf):
# The fromlist strategy needs to reuse the cost model!
return costmodel(sf)
@backend(interface="vectorization_strategy", name="explicit") @backend(interface="vectorization_strategy", name="explicit")
def explicit_costfunction(sf): def explicit_costfunction(sf):
# Read the explicitly set values for horizontal and vertical vectorization # Read the explicitly set values for horizontal and vertical vectorization
...@@ -181,40 +175,6 @@ def decide_vectorization_strategy(): ...@@ -181,40 +175,6 @@ def decide_vectorization_strategy():
width = get_vcl_type_size(dtype_floatingpoint()) width = get_vcl_type_size(dtype_floatingpoint())
qp, sfdict = level1_optimal_vectorization_strategy(active_sumfacts, width) qp, sfdict = level1_optimal_vectorization_strategy(active_sumfacts, width)
# TODO: Check how the 'fromlist' generator fits into the new overall picture
#
# if get_form_option("vectorization_strategy") == "fromlist":
# # This is a bit special and does not follow the minimization procedure at all
#
# def _choose_strategy_from_list(stage1_sumfacts):
# strategy = 0
# for qp in quad_points:
# for strat in fixed_quad_vectorization_opportunity_generator(frozenset(stage1_sumfacts), width, qp):
# if strategy == int(get_form_option("vectorization_list_index")):
# # Output the strategy and its cost into a separate file
# if get_global_context_value("form_type") == "jacobian_apply":
# with open("strategycosts.csv", "a") as f:
# f.write("{} {}\n".format(strategy, strategy_cost((qp, strat))))
# return qp, strat
# strategy = strategy + 1
#
# raise PerftoolVectorizationError("Specified vectorization list index '{}' was too high!".format(get_form_option("vectorization_list_index")))
#
# s1_sumfacts = frozenset(sf for sf in active_sumfacts if sf.stage == 1)
#
# total = sum(len([s for s in fixed_quad_vectorization_opportunity_generator(frozenset(s1_sumfacts), width, qp)]) for qp in quad_points)
# print("'fromlist' vectorization is attempting to pick #{} of {} strategies...".format(int(get_form_option("vectorization_list_index")),
# total))
# qp, sfdict = _choose_strategy_from_list(s1_sumfacts)
#
# keys = frozenset(sf.input_key for sf in active_sumfacts if sf.stage != 1)
# for key in keys:
# key_sumfacts = frozenset(sf for sf in active_sumfacts if sf.input_key == key)
# minimum = min(fixed_quad_vectorization_opportunity_generator(key_sumfacts, width, qp),
# key=fixedqp_strategy_costfunction(qp))
# sfdict = add_to_frozendict(sfdict, minimum)
set_quadrature_points(qp) set_quadrature_points(qp)
logger.debug("decide_vectorization_strategy: Decided for the following strategy:" logger.debug("decide_vectorization_strategy: Decided for the following strategy:"
......
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