Advises the driver to enqueue an operation on the stream to prefetch the memory to the CPU. This will cause the driver to fetch the data back to the CPU as soon as the operation is reached on the stream. The CPU must have the attribute [`DeviceAttribute::ConcurrentManagedAccess`]. # Example ```no_run # fn main() -> Result<(), Box > { # let _context = cust::quick_init().unw
(&self, stream: &Stream)
| 634 | /// # } |
| 635 | /// ``` |
| 636 | fn prefetch_to_host(&self, stream: &Stream) -> CudaResult<()> { |
| 637 | let slice = self.as_slice(); |
| 638 | let mem_size = std::mem::size_of_val(slice); |
| 639 | |
| 640 | unsafe { |
| 641 | cuda::cuMemPrefetchAsync( |
| 642 | slice.as_ptr() as cuda::CUdeviceptr, |
| 643 | mem_size, |
| 644 | -1, // CU_DEVICE_CPU #define |
| 645 | stream.as_inner(), |
| 646 | ) |
| 647 | .to_result()?; |
| 648 | } |
| 649 | Ok(()) |
| 650 | } |
| 651 | |
| 652 | /// Advises the driver to enqueue an operation on the stream to prefetch the memory to a certain GPU. |
| 653 | /// This will cause the driver to fetch the data to the specified device as soon as the operation |
nothing calls this directly
no test coverage detected