CuPy memcpy_htod

Hello,

I am new to CuPy but am somewhat familiar with pyCuda. Lets say in pyCuda I have a pointer to device memory, called dptr, and a numpy array, called myarray, and I want to move this array to the device I would call something along the lines of the following:

...
import numpy as np
import pycuda.driver as cuda
...
nelems = 512
myarray = np.zeros(nelms)
...
cuda.memcpy_htod(dptr, myarray)
...

Can I use a cupy complex64 array in place of the numpy array myarray in the above example such that I can call memcpy_htod ?

Thanks for any help.

A cupy array is already on the device. Why would you want to call htod on it?

Furthermore, I don’t know of any stated interoperability between pycuda and cupy.

https://docs-cupy.chainer.org/en/stable/reference/interoperability.html

I’d be very surprised if the pycuda object method memcpy_htod understood a cupy array argument.

Okay. Thank you for the information and link.