diff --git a/pyopencl/array.py b/pyopencl/array.py index e5cdda02609923c50cd8d2c8a6d5f4d33d7cbdbe..874ae92c47adf72ebcf678705745feebd8700ce6 100644 --- a/pyopencl/array.py +++ b/pyopencl/array.py @@ -499,7 +499,7 @@ class Array: # }}} - assert dtype != np.object, \ + assert dtype != object, \ "object arrays on the compute device are not allowed" assert isinstance(shape, tuple) assert isinstance(strides, tuple) @@ -2084,7 +2084,7 @@ def to_device(queue, ary, allocator=None, async_=None, # }}} - if ary.dtype == np.object: + if ary.dtype == object: raise RuntimeError("to_device does not work on object arrays.") if array_queue is _same_as_transfer: diff --git a/test/test_array.py b/test/test_array.py index 899fc2383c1248efc80dbb7a49f8801146376554..deb6ac28f9e1b798dc04a990abe7b5fb5039baed 100644 --- a/test/test_array.py +++ b/test/test_array.py @@ -1469,18 +1469,18 @@ def test_negative_dim_rejection(ctx_factory): queue = cl.CommandQueue(context) with pytest.raises(ValueError): - cl_array.Array(queue, shape=-10, dtype=np.float) + cl_array.Array(queue, shape=-10, dtype=np.float64) with pytest.raises(ValueError): - cl_array.Array(queue, shape=(-10,), dtype=np.float) + cl_array.Array(queue, shape=(-10,), dtype=np.float64) for left_dim in (-1, 0, 1): with pytest.raises(ValueError): - cl_array.Array(queue, shape=(left_dim, -1), dtype=np.float) + cl_array.Array(queue, shape=(left_dim, -1), dtype=np.float64) for right_dim in (-1, 0, 1): with pytest.raises(ValueError): - cl_array.Array(queue, shape=(-1, right_dim), dtype=np.float) + cl_array.Array(queue, shape=(-1, right_dim), dtype=np.float64) @pytest.mark.parametrize("empty_shape", [0, (), (3, 0, 2), (0, 5), (5, 0)])