Dnia 2013-03-11, pon o godzinie 11:52 -0400, Andreas Kloeckner pisze:
Tomasz Rybak <tomasz.rybak(a)post.pl> writes:
I've fixed problem with Python 3 str vs.
You can find my changes at
in branch python3
I've applied most of those. Some seem to break compatibility with old
Python 2.x and should be caught by 2to3, so I haven't applied them.
There is new problem under Python 3, see log
I do not know for now how to fix it.
from pycuda._pvt_struct import pack
arg_buf = pack(func.arg_format, *args)
E struct.error: required argument is not an integer
I'll take a look at this in a bit. Not quite sure what's going on.
I have looked a bit at this.
Exception is generated in file _pvt_struct_v3.cpp in function
This function is called by many functions - in our case
by np_ulong and np_void_p.
func.arg_format is PffL and args is <DeviceAllocation, 1.0, 1.0, 10>.
I suspect the problem lies with DeviceAllocation.
Analogous code in PyOpenCL differs.
When pack is called, it gets <Buffer, 1.0, 1.0, 10>, but arg_letters is:
[None, 'f', 'f', 'l'].
So problem might be with transforming DeviceAllocation into PyLong.
DeviceAllocation either is not seen as PyLong (which is strange
as it is wrapped with __int__ and __long__) or it does not contain
That's all I've discovered so far. I'll let you know if I discover
Tomasz Rybak GPG/PGP key ID: 2AD5 9860
Fingerprint A481 824E 7DD3 9C0E C40A 488E C654 FB33 2AD5 9860