Feature Request: Host and Heap allocated memory transfers

Is it possible to add a feature to be able to read and write to heap allocated memory from host? My use case is that I have arrays on the device that need to be resized dynamically, which is a great fit for heap allocated memory. However the only supported way to read that memory to host is:

from device to host:

  1. allocate space using host cudaMalloc
  2. allocate space using in-kernel malloc
  3. in the kernel, copy the data from the in-kernel malloc space to the host cudaMalloc space
  4. after completion of the kernel, copy the data from device to host using the previously allocated host cudaMalloc space

from host to device:

  1. allocate space using host cudaMalloc
  2. allocate space using in-kernel malloc
  3. after completion of the kernel, copy the data from host to device to using the previously allocated host cudaMalloc space
  4. in the kernel, copy the data from the host cudaMalloc space to the in-kernel malloc space

It would be more convenient and efficient If reading and writing to heap memory directly was supported!

Please file a bug. You can mark the description with “Feature Request”, or RFE, or similar.

1 Like

Thanks, I wasn’t sure where to put the idea: bug #3579148 has been created!