pub struct DeviceBuffer<T> { /* private fields */ }
Implementations§
Source§impl<T> DeviceBuffer<T>
impl<T> DeviceBuffer<T>
Sourcepub fn with_capacity(len: usize) -> Self
pub fn with_capacity(len: usize) -> Self
Allocate device memory for len
elements of type T
.
Sourcepub fn fill_zero_suffix(&self, start_idx: usize) -> Result<(), CudaError>
pub fn fill_zero_suffix(&self, start_idx: usize) -> Result<(), CudaError>
Fills a suffix of the buffer with zeros.
The start_idx
is the index in the buffer, in T
elements.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns whether the buffer is empty (null pointer or zero length).
Sourcepub fn as_mut_ptr(&self) -> *mut T
pub fn as_mut_ptr(&self) -> *mut T
Returns a raw mutable pointer to the device data (typed).
Sourcepub fn as_mut_raw_ptr(&self) -> *mut c_void
pub fn as_mut_raw_ptr(&self) -> *mut c_void
Returns a *mut c_void
(untyped) pointer.
Sourcepub fn as_raw_ptr(&self) -> *const c_void
pub fn as_raw_ptr(&self) -> *const c_void
Returns a *const c_void
(untyped) pointer.
Sourcepub fn as_buffer<U>(self) -> DeviceBuffer<U>
pub fn as_buffer<U>(self) -> DeviceBuffer<U>
Converts the buffer to a buffer of different type.
T
must be composable of U
s.
pub fn view(&self) -> DeviceBufferView
Trait Implementations§
Source§impl<T: Debug> Debug for DeviceBuffer<T>
impl<T: Debug> Debug for DeviceBuffer<T>
Source§impl<T> Drop for DeviceBuffer<T>
impl<T> Drop for DeviceBuffer<T>
Source§impl<T> MemCopyD2D<T> for DeviceBuffer<T>
impl<T> MemCopyD2D<T> for DeviceBuffer<T>
fn device_copy(&self) -> Result<DeviceBuffer<T>, MemCopyError>
fn device_copy_to(&self, dst: &mut DeviceBuffer<T>) -> Result<(), MemCopyError>
Source§impl<T> MemCopyD2H<T> for DeviceBuffer<T>
impl<T> MemCopyD2H<T> for DeviceBuffer<T>
impl<T> Send for DeviceBuffer<T>
impl<T> Sync for DeviceBuffer<T>
Auto Trait Implementations§
impl<T> Freeze for DeviceBuffer<T>
impl<T> RefUnwindSafe for DeviceBuffer<T>where
T: RefUnwindSafe,
impl<T> Unpin for DeviceBuffer<T>
impl<T> UnwindSafe for DeviceBuffer<T>where
T: RefUnwindSafe,
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