diff --git a/arraycontext/impl/pyopencl/__init__.py b/arraycontext/impl/pyopencl/__init__.py index c7c23033..7afc8d5a 100644 --- a/arraycontext/impl/pyopencl/__init__.py +++ b/arraycontext/impl/pyopencl/__init__.py @@ -207,8 +207,13 @@ def call_loopy(self, t_unit, **kwargs): for name, ary in result.items()} def freeze(self, array): - array.finish() - return array.with_queue(None) + import pyopencl.array as cl_array + if isinstance(array, cl_array.Array): + array.finish() + return array.with_queue(None) + + raise TypeError(f"{type(self).__name__} cannot freeze" + f" arrays of type '{type(array).__name__}'.") def thaw(self, array): from arraycontext.impl.pyopencl.taggable_cl_array import (TaggableCLArray,