diff --git a/loopy/isl_helpers.py b/loopy/isl_helpers.py index e894e4f9fdba76bf582ee431846dd558be7ee530..201aee16ce3571070aaeeabdce4e6c8b726df7cd 100644 --- a/loopy/isl_helpers.py +++ b/loopy/isl_helpers.py @@ -204,11 +204,10 @@ def static_extremum_of_pw_aff(pw_aff, constants_only, set_method, what, context) % (what, pw_aff)) return result - # Put constant bounds last, they're usually too restrictive. + # put constant bounds first pieces = ( - [(set, aff) for set, aff in pieces if not aff.is_cst()] - + [(set, aff) for set, aff in pieces if aff.is_cst()] - ) + [(set, aff) for set, aff in pieces if aff.is_cst()] + + [(set, aff) for set, aff in pieces if not aff.is_cst()]) reference = pw_aff.get_aggregate_domain() if context is not None: diff --git a/test/test_loopy.py b/test/test_loopy.py index 6d98f93a9a84f29e2e7d2ca206892666f2dc8d31..7957fc9cad3e55d295956df5efbe0ee1159ce319 100644 --- a/test/test_loopy.py +++ b/test/test_loopy.py @@ -1620,8 +1620,7 @@ def test_slab_decomposition_does_not_double_execute(ctx_factory): knl = lp.make_kernel(ctx.devices[0], "{ [i]: 0<=i<n }", - "a[i] = 2*a[i]", - assumptions="n>=1") + "a[i] = 2*a[i]") ref_knl = knl