Hey Gregor,

Thanks, upgrading to the latest github version (bbb2ca7dd) got rid of the INVALID_VALUE error, however the host-image copy still is off and empties the input data ndarray as a side effect

#--------code
from __future__ import print_function
import numpy as np
import pyopencl as cl

#host -> image
data = np.random.randn(100,100).astype(np.float32)
fmt = cl.ImageFormat(cl.channel_order.R, cl.channel_type.FLOAT)
im = cl.Image(ctx,cl.mem_flags.READ_WRITE, fmt, data.T.shape)

cl.enqueue_copy(queue,im,data, origin  = (0,0), region = data.T.shape)

#image -> host
out = np.empty_like(data)
cl.enqueue_copy(queue,out, im, origin  = (0,0), region = data.T.shape)

print(np.allclose(out,data))
# prints False
# data is zeroed out
#--------

I'll most have to revert to an earlier version then,

cheers,
Martin





Am 05/04/2016 um 15:41 schrieb Gregor Thalhammer:
Am 05.04.2016 um 15:09 schrieb Martin Weigert <mweig...@mpi-cbg.de>:

Hey Gregor,

thanks!
Actually the intial error was on me, as my example included the 
"(interactive=False)" during context creation and the CPU got selected by 
default, of course lacking the right image format.

The code example now (with the Intel Iris selected as device) breaks at

cl.enqueue_copy(queue,out,im, origin  = (0,0), region = (100,100))

which gives (on 2015.2.4 and both the Iris and Titan) a

clenqueuereadimage failed: INVALID_VALUE
but runs fine on 2015.1.

Did my snippet run fine on your machine when selecting either the Iris or GT 
750?

Thanks,

Martin

Hi Martin,

your code runs without error with both GPUs. I am running a (not recent) git 
version of pyopencl, your 2015.2.4 is probably missing a bug fix, issue #106 
for enqueue_copy_buffer_rect.

Gregor

_______________________________________________
PyOpenCL mailing list
PyOpenCL@tiker.net
https://lists.tiker.net/listinfo/pyopencl

Reply via email to