Hello, PyCUDA users!

I'm trying to construct a GPUArray from device memory allocated using
petsc4py. I've written some C code that extracts a raw pointer from a PETSc
"cusp" vector. Now, I am hoping to 'place' this memory into a gpuarray,
using PyCUDA and Cython in some way. Here's a Cython snippet that I hope
will make it clear:

def getGPUArray(Vec V):
    cdef double *array
    VecGetGPUArray(V.vec, &array)
    G = gpuarray.??? # how to construct this gpuarray?
    print G.get()

`VecGetGPUArray` is some C code that extracts the raw pointer from Vec.
`array` is the raw pointer from which I want to be able to construct a
gpuarray.

I think this could be very useful to petsc4py users, and I'd be happy to
provide more information/code to make this work :)

Thanks so much,
Ashwin
_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to