[PyCUDA] adding an __int__ method to GPUArray?
Andreas Kloeckner
lists at informa.tiker.net
Wed Mar 9 18:56:54 PST 2011
On Tue, 8 Mar 2011 10:53:37 -0500, Lev Givon <lev at columbia.edu> wrote:
> Received from Andreas Kloeckner on Tue, Mar 08, 2011 at 10:43:23AM EST:
> > On Tue, 8 Mar 2011 10:00:43 -0500, Lev Givon <lev at columbia.edu> wrote:
> > > Not sure if this suggestion has already been made, but would it be
> > > possible to add an __int__() method to GPUArray that would return the
> > > output of the instance's gpudata.__int__() method? This would
> > > somewhat facilitate manipulating GPUArray instances with
> > > ctypes-wrapped library functions that expect a pointer to GPU memory.
> >
> > I'm hesitant to do this. A numpy array's __int__ returns an array
> > scalar's value, cast to int. Since GPUArrays are supposed to be
> > numpy workalikes, that would introduce a difference to numpy. How about
> > a .ptr attribute?
> >
> > Andreas
>
> Sure - one less character to type than int().
Done.
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.tiker.net/pipermail/pycuda/attachments/20110309/c138dc31/attachment.pgp>
More information about the PyCUDA
mailing list