Allocates device memory asynchronously and asynchronously copies `val` into it. This doesn't actually allocate if `T` is zero-sized. If the memory behind `val` is not page-locked (pinned), a staging buffer will be allocated using a worker thread. If you are going to be making many asynchronous copies, it is generally a good idea to keep the data as a [`crate::memory::LockedBuffer`] or [`crate::m
(val: &T, stream: &Stream)
| 84 | /// # Ok(()) |
| 85 | /// # } |
| 86 | pub unsafe fn new_async(val: &T, stream: &Stream) -> CudaResult<Self> { |
| 87 | let mut dev_box = DeviceBox::uninitialized_async(stream)?; |
| 88 | dev_box.async_copy_from(val, stream)?; |
| 89 | Ok(dev_box) |
| 90 | } |
| 91 | |
| 92 | /// Enqueues an operation to free the memory backed by this [`DeviceBox`] on a |
| 93 | /// particular stream. The stream will free the allocation as soon as it reaches |
nothing calls this directly
no test coverage detected