From 13304f6801a4b1ed6e80e49e917c4f51f904924c Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni <kaushikcfd@gmail.com> Date: Thu, 9 Jun 2022 14:31:53 -0500 Subject: [PATCH] Simplification: do not exit early out of freeze for 0-size arrays Co-authored-by: Matthew Smith <mjsmith6@illinois.edu> --- arraycontext/impl/pytato/__init__.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/arraycontext/impl/pytato/__init__.py b/arraycontext/impl/pytato/__init__.py index e3813b2..b5e7f63 100644 --- a/arraycontext/impl/pytato/__init__.py +++ b/arraycontext/impl/pytato/__init__.py @@ -296,17 +296,7 @@ class PytatoPyOpenCLArrayContext(_BasePytatoArrayContext): raise TypeError(f"{type(self).__name__}.freeze invoked " f"with non-pytato array of type '{type(array)}'") - if subary.size == 0: - # early exit for 0-sized arrays - key_to_frozen_subary[key] = to_tagged_cl_array( - cla.empty(self.queue.context, - shape=subary.shape, - dtype=subary.dtype, - allocator=self.allocator), - get_cl_axes_from_pt_axes(subary.axes), - subary.tags) - else: - key_to_pt_arrays[key] = subary + key_to_pt_arrays[key] = subary # }}} -- GitLab