diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py index 17ab8c52bb5ef1da3724566c2ee178591b5e722f..02fa08e1d7d6a2dd1a0ec5c6a4cf778d70f3ecb2 100644 --- a/pyopencl/__init__.py +++ b/pyopencl/__init__.py @@ -1777,9 +1777,10 @@ def image_from_array(ctx, ary, num_channels=None, mode="r", norm_int=False): dtype = ary.dtype if num_channels is None: - from pyopencl.array import vec + import pyopencl.cltypes try: - dtype, num_channels = vec.type_to_scalar_and_count[dtype] + dtype, num_channels = \ + pyopencl.cltypes.vec_type_to_scalar_and_count[dtype] except KeyError: # It must be a scalar type then. num_channels = 1