[−][src]Enum tension::Buffer
Generic buffer that can be either host-side and device-side.
Variants
Host(HostBuffer<T>)
Device(DeviceBuffer<T>)
Implementations
impl<T: Prm> Buffer<T>
[src]
pub unsafe fn new_uninit(location: &Location, len: usize) -> Result<Self, Error>
[src]
Create uninitialzed buffer. This is unsafe method, but it is helpful for allocation of storage for some subsequent operation.
pub fn new_filled(
location: &Location,
len: usize,
value: T
) -> Result<Self, Error>
[src]
location: &Location,
len: usize,
value: T
) -> Result<Self, Error>
Create buffer filled with a single value.
pub fn location(&self) -> Location
[src]
Returns location of the buffer.
pub fn len(&self) -> usize
[src]
Returns the length of the buffer.
pub fn load(&self, dst: &mut [T]) -> Result<(), Error>
[src]
Loads data from buffer to slice.
pub fn store(&mut self, src: &[T]) -> Result<(), Error>
[src]
Stores data from slice to buffer.
Auto Trait Implementations
impl<T> RefUnwindSafe for Buffer<T> where
T: RefUnwindSafe,
<T as Interop>::Dev: RefUnwindSafe,
T: RefUnwindSafe,
<T as Interop>::Dev: RefUnwindSafe,
impl<T> Send for Buffer<T> where
T: Send,
<T as Interop>::Dev: Send,
T: Send,
<T as Interop>::Dev: Send,
impl<T> Sync for Buffer<T> where
T: Sync,
<T as Interop>::Dev: Sync,
T: Sync,
<T as Interop>::Dev: Sync,
impl<T> Unpin for Buffer<T> where
T: Unpin,
<T as Interop>::Dev: Unpin,
T: Unpin,
<T as Interop>::Dev: Unpin,
impl<T> UnwindSafe for Buffer<T> where
T: UnwindSafe,
<T as Interop>::Dev: UnwindSafe,
T: UnwindSafe,
<T as Interop>::Dev: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,