pub struct DeviceBuffer<T> { /* private fields */ }
Expand description
Device memory buffer
Implementations§
Source§impl<T: Copy> DeviceBuffer<T>
impl<T: Copy> DeviceBuffer<T>
Sourcepub unsafe fn as_ptr(&self) -> *const T
pub unsafe fn as_ptr(&self) -> *const T
Get raw device pointer
§Safety
The caller must ensure that the returned pointer is not used after the DeviceBuffer
is dropped.
The caller must also ensure that the memory is not accessed concurrently.
Sourcepub unsafe fn as_mut_ptr(&mut self) -> *mut T
pub unsafe fn as_mut_ptr(&mut self) -> *mut T
Get mutable raw device pointer
§Safety
The caller must ensure that the returned pointer is not used after the DeviceBuffer
is dropped.
The caller must also ensure that the memory is not accessed concurrently.
Sourcepub fn copy_from_host(&mut self, data: &[T]) -> Result<()>
pub fn copy_from_host(&mut self, data: &[T]) -> Result<()>
Copy from host memory
Sourcepub fn copy_to_host(&self, data: &mut [T]) -> Result<()>
pub fn copy_to_host(&self, data: &mut [T]) -> Result<()>
Copy to host memory
Auto Trait Implementations§
impl<T> Freeze for DeviceBuffer<T>
impl<T> RefUnwindSafe for DeviceBuffer<T>where
T: RefUnwindSafe,
impl<T> !Send for DeviceBuffer<T>
impl<T> !Sync for DeviceBuffer<T>
impl<T> Unpin for DeviceBuffer<T>where
T: Unpin,
impl<T> UnwindSafe for DeviceBuffer<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more