On Fri, Dec 18, 2009 at 6:59 PM, Andreas Klöckner
<[email protected]> wrote:
> Right. You can pack a struct into a string using Python's struct module, and
> since string support the buffer protocol, they can be passed to PyCUDA
> routines.

So are you saying that if I have a kernel with

struct test
{
  int x;
}

__global__ go(test a)
{
   ... = a.x;
}

and call it with

go.prepare("s", ...)   # tell PyCuda we're passing in a string buffer
go.prepared_call(grid, struct.pack("i",12345))    # pack integer into
string buffer

a.x will equal 12345 in the kernel?

I don't get any error messages but I just get garbage values for a.x.
--
Dan

_______________________________________________
PyCUDA mailing list
[email protected]
http://tiker.net/mailman/listinfo/pycuda_tiker.net

Reply via email to