On Fri, Sep 30, 2011 at 11:27:55PM +1000, Bogdan Opanchuk wrote:
> Hello Andrew,
>
> You have to transfer your arrays to GPU memory before passing them to
> the kernel (using pyopencl.array.to_device(), for example).
Makes sense, thanks.
I don't want to be that guy who keeps asking dumb questions, but I fixed that
and I am now getting a different error that I don't understand:
pyopencl.LogicError: when processing argument #1 (1-based): Kernel.set_arg
failed: invalid value - invalid kernel argument
The code is:
a = n.zeros(3, dtype=n.uint8)
a[0] = 32
a[1] = 43
a[2] = 129
ctx = cl.create_some_context()
queue = cl.CommandQueue(ctx)
prg = cl.Program(ctx, """
__kernel void test1(__global const uchar *a,
__global int *b,
__global int *c,
__global int *d) {
*b = a[0];
*c = a[1];
*d = a[2];
}
""").build()
b, c, d = map(n.int32, [0, 0, 0])
#print(a,b,c,d)
a_device = cla.to_device(queue, a)
event = prg.test1(queue, 1, None, a_device, b, c, d)
And any further help would be appreciated...
Thanks,
Andrew
_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl