pub trait DevicePtr<T>: DeviceSlice<T> {
// Required method
fn device_ptr<'a>(
&'a self,
stream: &'a CudaStream,
) -> (CUdeviceptr, SyncOnDrop<'a>);
}Required Methods§
Sourcefn device_ptr<'a>(
&'a self,
stream: &'a CudaStream,
) -> (CUdeviceptr, SyncOnDrop<'a>)
fn device_ptr<'a>( &'a self, stream: &'a CudaStream, ) -> (CUdeviceptr, SyncOnDrop<'a>)
Retrieve the device pointer with the intent to read the device memory associated with it.
Implementations of this method should ensure stream waits for any previous
writes of this memory before continuing (do not need to wait for any previous reads).
The SyncOnDrop item of the return tuple should be dropped after the read of the sys::CUdeviceptr is scheduled.
In most cases you can use like:
ⓘ
let (src, _record_src) = src.device_ptr(&stream);Which will drop the SyncOnDrop at the end of the scope.