Skip to content

Commit

Permalink
regression: PyOpenCLArrayContext: raise TypeError for incorrect freez…
Browse files Browse the repository at this point in the history
…e types
  • Loading branch information
kaushikcfd committed May 2, 2022
1 parent 8818204 commit a2d3deb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions arraycontext/impl/pyopencl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a2d3deb

Please sign in to comment.