Hi all,

It looks like the Image constructor at line 152 of
pyopencl/__init__.py is incorrectly warning when hostbuf is None and
no memory flags are passed.

I believe line 149 should read "if hostbuf is not None and not \" instead.

139 class Image(_cl._ImageBase):
140    def __init__(self, context, flags, format, shape=None, pitches=None,
141             hostbuf=None, is_array=False, buffer=None):
142
143         if shape is None and hostbuf is None:
144             raise Error("'shape' must be passed if 'hostbuf' is not given")
145
146         if shape is None and hostbuf is not None:
147             shape = hostbuf.shape
148
149         if hostbuf is None and not \
150                 (flags & (mem_flags.USE_HOST_PTR |
mem_flags.COPY_HOST_PTR)):
151             from warnings import warn
152             warn("'hostbuf' was passed, but no memory flags to
make use of it.")

Best,
Luke

_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl

Reply via email to