From 4580634a162ff5b50fc5a5f226a2f804e3cf47a0 Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni Date: Fri, 24 Nov 2017 14:17:29 -0600 Subject: [PATCH 1/3] Some error in `kernel/__init.py__` about `StaticValueFindingError` --- loopy/kernel/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loopy/kernel/__init__.py b/loopy/kernel/__init__.py index 3f8505631..232931afb 100644 --- a/loopy/kernel/__init__.py +++ b/loopy/kernel/__init__.py @@ -41,7 +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 +961,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 -- GitLab From a21fb4c3842b4374c9f147612c9053c0be81b396 Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni Date: Fri, 24 Nov 2017 15:36:48 -0600 Subject: [PATCH 2/3] Flake8 mistake --- loopy/kernel/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/loopy/kernel/__init__.py b/loopy/kernel/__init__.py index 232931afb..88a571764 100644 --- a/loopy/kernel/__init__.py +++ b/loopy/kernel/__init__.py @@ -43,6 +43,7 @@ from loopy.diagnostic import CannotBranchDomainTree, LoopyError from loopy.tools import natsorted from loopy.diagnostic import StaticValueFindingError + # {{{ unique var names class _UniqueVarNameGenerator(UniqueNameGenerator): -- GitLab From 6e7a313354deef3d082fcdd9cc78e494cb698aa8 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 24 Nov 2017 18:18:33 -0600 Subject: [PATCH 3/3] Make exceptions raised by static_extremum_of_pw_aff consistent --- loopy/isl_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loopy/isl_helpers.py b/loopy/isl_helpers.py index 49ab3fd68..5a747d070 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 -- GitLab