Trait DevicePtrMut
pub trait DevicePtrMut<T>: DeviceSlice<T> {
// Required method
fn device_ptr_mut<'a>(
&'a mut self,
stream: &'a CudaStream,
) -> (u64, SyncOnDrop<'a>);
}Expand description
Abstraction over CudaSlice/CudaViewMut
Required Methods§
fn device_ptr_mut<'a>(
&'a mut self,
stream: &'a CudaStream,
) -> (u64, SyncOnDrop<'a>)
fn device_ptr_mut<'a>( &'a mut self, stream: &'a CudaStream, ) -> (u64, SyncOnDrop<'a>)
Retrieve the device pointer with the intent to modify the device memory associated with it.
Implementations of this method should ensure stream waits for any previous
reads/writes of this memory before continuing.
The [SyncOnDrop] item of the return tuple should be dropped after the write of the sys::CUdeviceptr is scheduled.
In most cases you can use like:
ⓘ
let (src, _record_src) = src.device_ptr_mut(&stream);Which will drop the [SyncOnDrop] at the end of the scope.