Thanks!

I'll try it when i get off work.

So i dont have to wrap it in som pretty object, just pass the adress as an
int and it will work

-Tai

On Tue, Apr 3, 2012 at 8:05 AM, Andreas Kloeckner
<li...@informa.tiker.net>wrote:

> <#part sign=pgpmime>
> On Mon, 2 Apr 2012 23:44:08 +0200, Kin Trinh <qinn.tr...@gmail.com> wrote:
> > # how would i go about making this work
> > # i have written my own wrapper for cublas and want to pass my device
> > pointers to pycuda
> >
> > # example psudo code
> >
> > ...
> >
> > mod = SourceModule("""
> > __global__ void multiply_them(float *dest, float *a, float *b)
> > {
> >   const int i = threadIdx.x;
> >   dest[i] = a[i] * b[i] + 2;
> > }
> > """)
> >
> > multiply_them = mod.get_function("multiply_them")
> >
> > # cudaMalloc()
> > # A is a LP_c_float
> >
> > B = numpy.mat(numpy.ones((2, 2)), numpy.float32)
> >
> > # i just want to be able to pass my pointers along somehow...
> > multiply_them( drv.Out(B), A, A, block=(4,1,1), grid=(1,1))
>
> PyCUDA takes integers wherever it wants device pointers--so as long as
> you can turn your ctypes type into an int, you should be good to go.
>
> Andreas
>
>
_______________________________________________
PyCUDA mailing list
PyCUDA@tiker.net
http://lists.tiker.net/listinfo/pycuda

Reply via email to