libgpuvm
libgpuvm copied to clipboard
discarding data on host or device
sometimes, an array is used to transfer data one way only, host -> device or device -> host. In this case, there's no need to copy data in opposite direction; however, this copying is still done. In order to avoid unnecessary copying, it is possible to add ability to discard data, e.g.:
void gpuvm_discard(void *ptr, int flags, unsigned dev);
if data is discarded on device, then protection on host is removed, and host data is considered actual; device data is not copied back. If data is going to be overwritten on host, it saves one data copy