From 78678b360f92e029b445030d95d36addd11a5d1f Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 23 Jan 2018 11:37:18 -0600 Subject: [PATCH 1/2] 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 From 78a8472a3ec08a2776081fa48549c4b81f423a1a Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 23 Jan 2018 12:38:19 -0600 Subject: [PATCH 2/2] Fix adjust-ltemp-fix-scalars to not silently drop temp vars --- loopy/target/pyopencl.py | 1 + 1 file changed, 1 insertion(+) diff --git a/loopy/target/pyopencl.py b/loopy/target/pyopencl.py index 186c2e85c..744c03d8e 100644 --- a/loopy/target/pyopencl.py +++ b/loopy/target/pyopencl.py @@ -63,6 +63,7 @@ def adjust_local_temp_var_storage(kernel, device): if not temp_var.shape: # scalar, no need to mess with storage shape + new_temp_vars[temp_var.name] = temp_var continue other_loctemp_nbytes = [ -- GitLab