From 78678b360f92e029b445030d95d36addd11a5d1f Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Tue, 23 Jan 2018 11:37:18 -0600
Subject: [PATCH] OpenCL: do not attempt to mess with storage shape of scalars

---
 loopy/target/pyopencl.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/loopy/target/pyopencl.py b/loopy/target/pyopencl.py
index 9955705a2..186c2e85c 100644
--- a/loopy/target/pyopencl.py
+++ b/loopy/target/pyopencl.py
@@ -61,6 +61,10 @@ def adjust_local_temp_var_storage(kernel, device):
                     temp_var.copy(storage_shape=temp_var.shape)
             continue
 
+        if not temp_var.shape:
+            # scalar, no need to mess with storage shape
+            continue
+
         other_loctemp_nbytes = [
                 tv.nbytes
                 for tv in six.itervalues(kernel.temporary_variables)
-- 
GitLab