From e410aebb3ae05463c61a5d26597c910ee4b1adfa Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 16 Jun 2015 16:39:51 -0500 Subject: [PATCH] Get rid of prefer_constants=False --- loopy/codegen/loop.py | 4 ++-- loopy/isl_helpers.py | 39 +++++++++++++-------------------------- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/loopy/codegen/loop.py b/loopy/codegen/loop.py index 91c8f5499..33cdc2118 100644 --- a/loopy/codegen/loop.py +++ b/loopy/codegen/loop.py @@ -329,10 +329,10 @@ def generate_sequential_loop_dim_code(kernel, sched_index, codegen_state): static_lbound = static_min_of_pw_aff( lbound, - constants_only=False, prefer_constants=False) + constants_only=False) static_ubound = static_max_of_pw_aff( ubound, - constants_only=False, prefer_constants=False) + constants_only=False) # }}} diff --git a/loopy/isl_helpers.py b/loopy/isl_helpers.py index 3c429b032..5c5298892 100644 --- a/loopy/isl_helpers.py +++ b/loopy/isl_helpers.py @@ -137,8 +137,7 @@ def iname_rel_aff(space, iname, rel, aff): raise ValueError("unknown value of 'rel': %s" % rel) -def static_extremum_of_pw_aff(pw_aff, constants_only, set_method, what, context, - prefer_constants): +def static_extremum_of_pw_aff(pw_aff, constants_only, set_method, what, context): if context is not None: context = isl.align_spaces(context, pw_aff.get_domain_space(), obj_bigger_ok=True).params() @@ -163,21 +162,12 @@ def static_extremum_of_pw_aff(pw_aff, constants_only, set_method, what, context, .is_bounded()) # put constant bounds with unbounded validity first - # FIXME: Heuristi-hack. - if prefer_constants: - order = [ - (True, False), # constant, unbounded validity - (False, False), # nonconstant, unbounded validity - (True, True), # constant, bounded validity - (False, True), # nonconstant, bounded validity - ] - else: - order = [ - (False, False), # nonconstant, unbounded validity - (True, False), # constant, unbounded validity - (False, True), # nonconstant, bounded validity - (True, True), # constant, bounded validity - ] + order = [ + (True, False), # constant, unbounded validity + (False, False), # nonconstant, unbounded validity + (True, True), # constant, bounded validity + (False, True), # nonconstant, bounded validity + ] pieces = flatten([ [(set, aff) for set, aff in pieces @@ -209,22 +199,19 @@ def static_extremum_of_pw_aff(pw_aff, constants_only, set_method, what, context, % (what, pw_aff)) -def static_min_of_pw_aff(pw_aff, constants_only, context=None, - prefer_constants=True): +def static_min_of_pw_aff(pw_aff, constants_only, context=None): return static_extremum_of_pw_aff(pw_aff, constants_only, isl.PwAff.ge_set, - "minimum", context, prefer_constants) + "minimum", context) -def static_max_of_pw_aff(pw_aff, constants_only, context=None, - prefer_constants=True): +def static_max_of_pw_aff(pw_aff, constants_only, context=None): return static_extremum_of_pw_aff(pw_aff, constants_only, isl.PwAff.le_set, - "maximum", context, prefer_constants) + "maximum", context) -def static_value_of_pw_aff(pw_aff, constants_only, context=None, - prefer_constants=True): +def static_value_of_pw_aff(pw_aff, constants_only, context=None): return static_extremum_of_pw_aff(pw_aff, constants_only, isl.PwAff.eq_set, - "value", context, prefer_constants) + "value", context) def duplicate_axes(isl_obj, duplicate_inames, new_inames): -- GitLab