From d18db7666f932436edaacd6817762466fc9ad96a Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Wed, 18 Apr 2012 15:50:30 -0400
Subject: [PATCH] Fix CSE type assignment if no type specified.

---
 loopy/creation.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/loopy/creation.py b/loopy/creation.py
index 848fa1aaa..0337f7c8b 100644
--- a/loopy/creation.py
+++ b/loopy/creation.py
@@ -53,11 +53,13 @@ def expand_cses(knl):
         if dtype is None:
             from loopy import infer_type
             dtype = infer_type
+        else:
+            dtype=np.dtype(dtype)
 
         from loopy.kernel import TemporaryVariable
         new_temp_vars[new_var_name] = TemporaryVariable(
                 name=new_var_name,
-                dtype=np.dtype(dtype),
+                dtype=dtype,
                 is_local=None,
                 shape=())
 
@@ -288,7 +290,7 @@ def duplicate_inames(knl):
 
 def make_kernel(*args, **kwargs):
     """Second pass of kernel creation. Think about requests for iname duplication
-    and temporary variable declaration received as part of string instructions.
+    and temporary variable creation.
     """
 
     from loopy.kernel import LoopKernel
-- 
GitLab