Issuing copies to host from within device code

Hi all,

Is it possible for a kernel to issue a copy (possibly DMA) to a host ptr? I guess the answer is probably no, but just want to make sure.

You guessed correctly. The driver code that configures the DMA engines runs on the host. So transfers between host and device must be initiated from host code.

If the host pointer points to pinned host memory, it is directly accessible from within the kernel.

But does the transfer actually happen while the kernel is in flight? Do you have some minimal example?

here is a minimal example: