Skip to main content

DevicePtr

Trait DevicePtr 

Source
pub trait DevicePtr<T>: DeviceSlice<T> {
    // Required method
    fn device_ptr<'a>(
        &'a self,
        stream: &'a CudaStream,
    ) -> (CUdeviceptr, SyncOnDrop<'a>);
}
Expand description

Abstraction over CudaSlice/CudaView

Required Methods§

Source

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.

Implementors§

Source§

impl DevicePtr<u8> for MappedBuffer

Source§

impl<T> DevicePtr<T> for CudaSlice<T>

Source§

impl<T> DevicePtr<T> for CudaView<'_, T>

Source§

impl<T> DevicePtr<T> for CudaViewMut<'_, T>

Source§

impl<T> DevicePtr<T> for UnifiedSlice<T>

Source§

impl<T> DevicePtr<T> for UnifiedView<'_, T>

Source§

impl<T> DevicePtr<T> for UnifiedViewMut<'_, T>