diff --git a/pyopencl/algorithm.py b/pyopencl/algorithm.py index 513e5ad89b80223cf2928388548cd11fc0ba59cc..a5576796c279c95593b3d577b18a4e66ea5527ae 100644 --- a/pyopencl/algorithm.py +++ b/pyopencl/algorithm.py @@ -1042,8 +1042,8 @@ class ListOfListsBuilder: def __call__(self, queue, n_objects, *args, **kwargs): """ :arg args: arguments corresponding to arg_decls in the constructor. - :class:`pyopencl.array.Array` are not allowed directly and should - be passed as their :attr:`pyopencl.array.Array.data` attribute instead. + Arguments must be either 1D :class:`pyopencl.array.Array' objects + or :class:`pyopencl.MemoryObject' objects. :arg allocator: optionally, the allocator to use to allocate new arrays. :arg omit_lists: An iterable of list names that should *not* be built @@ -1124,6 +1124,9 @@ class ListOfListsBuilder: "but the argument is not an array." % i) continue + if arg_val.ndim != 1: + raise ValueError("Only 1D arrays supported") + data_args.append(arg_val.base_data) if arg_descr.with_offset: data_args.append(arg_val.offset)