From 7c8dcfa04b967189609276ddfa39f6bd6a508bbe Mon Sep 17 00:00:00 2001
From: Tim Warburton <timwar@caam.rice.edu>
Date: Tue, 8 Nov 2011 23:58:58 -0600
Subject: [PATCH] Give a better error message for non-matching matching
 variables.

---
 loopy/cse.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/loopy/cse.py b/loopy/cse.py
index 2cbf7f8d8..46c189f3f 100644
--- a/loopy/cse.py
+++ b/loopy/cse.py
@@ -188,7 +188,9 @@ def process_cses(kernel, uni_template,
             if mv_name in matching_var_values:
                 if matching_var_values[mv_name] != csed.unif_var_dict[mv_name]:
                     raise RuntimeError("two different expressions encountered "
-                            "for matching variable: '%s' and '%s'" % (
+                            "for matching variable '%s' in unification template '%s':"
+                            "'%s' and '%s'" % (
+                                mv_name, uni_template,
                                 matching_var_values[mv_name], csed.unif_var_dict[mv_name]))
             else:
                 matching_var_values[mv_name] = csed.unif_var_dict[mv_name]
-- 
GitLab