On Sun, 27 Mar 2011 20:28:20 -0400, Ian Johnson <[email protected]> wrote: > Hey guys, > > I'm trying to pass a structure to PyOpenCL (using the struct module and the > pack routine) but everytime i try to pass it as an arguement I get invalid > arg size error. > > I've coded up an example which fails in this way > https://github.com/enjalot/adventures_in_opencl/blob/master/experiments/structs/structs.py > > what am I missing?
Two issues: - __constant refers to constant memory, AFAIK--which is a special type of memory that I am not sure you mean. - I imagine you don't want to pass a pointer to your struct type, but the struct itself. (i.e. remove the '*') > also, the struct in this example is 16bytes on most machines, what if i just > do "ffi" (12 bytes), do i need to pad it on the python side? I was a bit > confused about the struct module documentation on alignment Not sure--struct.calcsize() should tell you, though. Andreas
pgplh30Lcy84a.pgp
Description: PGP signature
_______________________________________________ PyOpenCL mailing list [email protected] http://lists.tiker.net/listinfo/pyopencl
