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