pub struct DeviceBuffer {
pub data: Vec<f32>,
pub size: usize,
pub device_id: usize,
}Expand description
Device memory buffer (opaque handle).
For CPU and stub backends this is simply a heap-allocated Vec<f32>.
A future hardware backend would replace data with a raw device pointer
and keep the Vec only as a host-side staging buffer.
Fields§
§data: Vec<f32>CPU backing store (used by all stub backends).
size: usizeNumber of f32 elements in the buffer.
device_id: usizeLogical device index this buffer is associated with.
Implementations§
Auto Trait Implementations§
impl Freeze for DeviceBuffer
impl RefUnwindSafe for DeviceBuffer
impl Send for DeviceBuffer
impl Sync for DeviceBuffer
impl Unpin for DeviceBuffer
impl UnsafeUnpin for DeviceBuffer
impl UnwindSafe for DeviceBuffer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more