Skip to content

Commit

Permalink
Be more cautious in requesting a read-write buffer in CL1.2 image cre…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
inducer committed Apr 3, 2014
1 parent ef65475 commit 89282bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wrapper/wrap_cl.hpp
Expand Up @@ -2361,7 +2361,9 @@ namespace pyopencl

if (buffer.ptr() != Py_None)
{
if (flags & CL_MEM_USE_HOST_PTR)
if ((flags & CL_MEM_USE_HOST_PTR)
&& ((flags & CL_MEM_READ_WRITE)
|| (flags & CL_MEM_WRITE_ONLY)))
{
if (PyObject_AsWriteBuffer(buffer.ptr(), &buf, &len))
throw py::error_already_set();
Expand Down

0 comments on commit 89282bb

Please sign in to comment.