diff --git a/loopy/isl_helpers.py b/loopy/isl_helpers.py index 49ab3fd68303e18a6bec371fc54db4e63f57346d..5a747d070a47ff89336c22c8237ff03e567d0a8a 100644 --- a/loopy/isl_helpers.py +++ b/loopy/isl_helpers.py @@ -203,7 +203,7 @@ def static_extremum_of_pw_aff(pw_aff, constants_only, set_method, what, context) if len(pieces) == 1: (_, result), = pieces if constants_only and not result.is_cst(): - raise ValueError("a numeric %s was not found for PwAff '%s'" + raise StaticValueFindingError("a numeric %s was not found for PwAff '%s'" % (what, pw_aff)) return result diff --git a/loopy/kernel/__init__.py b/loopy/kernel/__init__.py index 3f8505631edaff9f27d9e31442cf98f4f0af446a..88a5717642af6d9ebc1bd7770936ae44e8cbf44b 100644 --- a/loopy/kernel/__init__.py +++ b/loopy/kernel/__init__.py @@ -41,6 +41,7 @@ from loopy.library.function import ( from loopy.diagnostic import CannotBranchDomainTree, LoopyError from loopy.tools import natsorted +from loopy.diagnostic import StaticValueFindingError # {{{ unique var names @@ -961,7 +962,7 @@ class LoopKernel(ImmutableRecordWithoutPickling): size = static_max_of_pw_aff(size, constants_only=isinstance(tag, LocalIndexTag), context=self.assumptions) - except ValueError: + except StaticValueFindingError: pass tgt_dict[tag.axis] = size