Hi all,
I have been loading my datasets within Python, but found that
this was too slow. I rewrote in C and now I am trying to get the C
and Python integrated. I have a function which I am calling using
ctypes which returns a CUdeviceptr and I want it to return a
DeviceAllocation instead. Is this possible (to make a DeviceAllocation
object)? I couldn't find a good way to do it from the Python side,
and there doesn't appear to be a way from the C/C++ side either. I
can make my code a Python extension instead of a ctypes library if
that makes it easier, but either way it would be nice to have a C
API for PyCUDA. It seems that DeviceAllocation only exists within
src/wrapper/wrap_cudadrv.cpp, where it isn't accessible from the
outside.
If not, is there another way? A CUdeviceptr is just an int; can
I pass it as an int to my cuda kernel and then cast it to a pointer?
__global__ void run(int addr)
{
char *memory = (char *)addr;
}
I don't know if the address is passed back as a correct device address;
Do I have to run cuMemHostGetDevicePointer() first, or does that return
the address in the host memory space?
Thanks!
nick
_______________________________________________
PyCUDA mailing list
[email protected]
http://tiker.net/mailman/listinfo/pycuda_tiker.net