Tomasz Rybak <[email protected]> writes: > Dnia 2013-03-11, pon o godzinie 11:52 -0400, Andreas Kloeckner pisze: >> Tomasz Rybak <[email protected]> writes: >> >> > I've fixed problem with Python 3 str vs. bytearray. >> > You can find my changes at >> > git://github.com/rybaktomasz/pycuda.git >> > 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 below. >> > 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 >> > >> > /usr/lib/python3/dist-packages/pycuda/driver.py:475: error >> >> 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 > get_pylong. > 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 > __index__.
I've thrown DeviceAllocation.__index__ into git. Can you please try again? Thanks! Andreas _______________________________________________ PyCUDA mailing list [email protected] http://lists.tiker.net/listinfo/pycuda
