[][src]Enum tension::Buffer

pub enum Buffer<T: Prm> {
    Host(HostBuffer<T>),
    Device(DeviceBuffer<T>),
}

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]

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

impl<T> Send for Buffer<T> where
    T: Send,
    <T as Interop>::Dev: Send

impl<T> Sync for Buffer<T> where
    T: Sync,
    <T as Interop>::Dev: Sync

impl<T> Unpin for Buffer<T> where
    T: Unpin,
    <T as Interop>::Dev: Unpin

impl<T> UnwindSafe for Buffer<T> where
    T: UnwindSafe,
    <T as Interop>::Dev: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.