Luke Pfister <[email protected]> writes: > I'm trying to allocate a 3D cudaArray in PyCUDA, then pass the pointer to > this array through Cython. T > > This is easy to do with 'regular' memory on the device via the GPUarray > class; I can just cast GPUarray.gpudata to long and then pass through > Cython. > > Is there a way to do something similar with a pycuda.driver.Array? I don't > see a way to get to the device pointer.
There isn't currently, but it's not hard to patch in. Add a handle_int (or some such) function here: https://github.com/inducer/pycuda/blob/0797e9390c8c85034cf71ccc46f54fa158da92c4/src/cpp/cuda.hpp#L1060 that returns the handle pointer cast to an integer. Realize that you just assumed part of the responsibility for management of the lifetime of the handle. Wrap you new handle_int here: https://github.com/inducer/pycuda/blob/master/src/wrapper/wrap_cudadrv.cpp#L1422 Leave handle_int undocumented. Submit a pull request. HTH, Andreas _______________________________________________ PyCUDA mailing list [email protected] http://lists.tiker.net/listinfo/pycuda
