From 0c34bd18c1036590193ec14e3ebf169b9b6e2cbd Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Tue, 17 Feb 2015 12:23:04 -0600
Subject: [PATCH] Fix invoker code generation for shape=None

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

diff --git a/loopy/compiled.py b/loopy/compiled.py
index 03cb09ab1..02730d868 100644
--- a/loopy/compiled.py
+++ b/loopy/compiled.py
@@ -499,6 +499,9 @@ def generate_array_arg_setup(gen, kernel, impl_arg_info, options):
                         "%% (%s.shape, %s))"
                         % (arg.name, arg.name, strify_tuple(arg.unvec_shape)))
 
+                if kernel_arg.shape is None:
+                    pass
+
                 if any(shape_axis is None for shape_axis in kernel_arg.shape):
                     gen("if len(%s.shape) != %s:"
                             % (arg.name, len(arg.unvec_shape)))
@@ -514,7 +517,7 @@ def generate_array_arg_setup(gen, kernel, impl_arg_info, options):
                         with Indentation(gen):
                             gen(shape_mismatch_msg)
 
-                elif kernel_arg.shape is not None:
+                else:  # not None, no Nones in tuple
                     gen("if %s.shape != %s:"
                             % (arg.name, strify(arg.unvec_shape)))
                     with Indentation(gen):
-- 
GitLab