From b6245a952bffd77d7c4d09797f071fd116b2a092 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Mon, 24 Sep 2012 14:31:27 -0500 Subject: [PATCH] Obey constants_only restrictions on min/max/static value even for single-piece PwAffs. --- loopy/isl_helpers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/loopy/isl_helpers.py b/loopy/isl_helpers.py index 57ca2e769..4c585e98a 100644 --- a/loopy/isl_helpers.py +++ b/loopy/isl_helpers.py @@ -168,7 +168,11 @@ def iname_rel_aff(space, iname, rel, aff): def static_extremum_of_pw_aff(pw_aff, constants_only, set_method, what, context): pieces = pw_aff.get_pieces() if len(pieces) == 1: - return pieces[0][1] + (_, result), = pieces + if constants_only and not result.is_cst(): + raise ValueError("a numeric %s was not found for PwAff '%s'" + % (what, pw_aff)) + return result # put constant bounds first pieces = ( -- GitLab