Difference between memcpy_htod and to_gpu in Pycuda?

I am learning PyCUDA, and while looking at the documentation on pycuda.gpuarray, I am puzzled by the difference between the functions pycuda.driver.memcpy_htod (also _dtoh) and pycuda.gpuarray.to_gpu (also get). According to gpuarray documentation, .get ().

For example, drag the contents of self into an array or the newly allocated numpy.ndarray. If an array is specified, it must have the desired size (not necessarily shape) and dtype. If it is not set, pagelocked indicates whether the new array is assigned as page lock.

Is this a statement that .get () is implemented exactly like pycuda.driver.memcpy_dtoh? For some reason, I think I'm misinterpreting it.

+4
source share

All Articles