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:
- allocate space using host cudaMalloc
- allocate space using in-kernel malloc
- in the kernel, copy the data from the in-kernel malloc space to the host cudaMalloc space
- after completion of the kernel, copy the data from device to host using the previously allocated host cudaMalloc space
from host to device:
- allocate space using host cudaMalloc
- allocate space using in-kernel malloc
- after completion of the kernel, copy the data from host to device to using the previously allocated host cudaMalloc space
- 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!