From fe2ddef897084063bbf756eeba9923b9778637af Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Tue, 21 Feb 2012 09:06:19 +0100 Subject: [PATCH] Fix warning condition in Image constructor. --- pyopencl/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py index 0f7d0947..ee3a7154 100644 --- a/pyopencl/__init__.py +++ b/pyopencl/__init__.py @@ -146,7 +146,7 @@ class Image(_cl._ImageBase): if shape is None and hostbuf is not None: shape = hostbuf.shape - if hostbuf is None and not \ + if hostbuf is not None and not \ (flags & (mem_flags.USE_HOST_PTR | mem_flags.COPY_HOST_PTR)): from warnings import warn warn("'hostbuf' was passed, but no memory flags to make use of it.") -- GitLab