[][src]Struct dynamic_ocl::buffer::BufferBuilder

#[must_use]
pub struct BufferBuilder<'c, H: HostAccess = HostReadWrite, D: DeviceAccess = DeviceReadWrite, F: BufferFlags = NoFlags> { /* fields omitted */ }

A partially built buffer

Methods

impl<'c> BufferBuilder<'c>[src]

pub fn new(context: &'c Context) -> Self[src]

Start building a new OpenCL buffer for the given context.

impl<'c, H: HostAccess, D: DeviceAccess, F: BufferFlags> BufferBuilder<'c, H, D, F>[src]

pub fn host_access<H2: HostAccess>(self) -> BufferBuilder<'c, H2, D, F>[src]

Set the host accessibility for this buffer.

pub fn device_access<D2: DeviceAccess>(self) -> BufferBuilder<'c, H, D2, F>[src]

Set the device accessibility for this buffer.

pub fn alloc_host_ptr(self) -> BufferBuilder<'c, H, D, AllocHostPtr>[src]

Set the CL_MEM_ALLOC_HOST_PTR flag when creating this buffer.

pub fn build_copying_slice<T: MemSafe>(
    self,
    slice: &[T]
) -> Result<Buffer<'static, H, T>>
[src]

Build a buffer, copying initial data from the given slice, with the CL_MEM_COPY_HOST_PTR flag set.

pub fn build_with_size<T: MemSafe>(
    self,
    size: usize
) -> Result<Buffer<'static, H, T>>
[src]

Build a buffer with space for size elements of type T. The initial contents of the buffer are unspecified.

impl<'c, H: HostAccess, D: DeviceAccess> BufferBuilder<'c, H, D, NoFlags>[src]

pub fn build_using_slice<T: MemSafe>(
    self,
    slice: &mut [T]
) -> Result<Buffer<H, T>>
[src]

Build a buffer using the given slice for storage, with the CL_MEM_USE_HOST_PTR flag set.

This type of buffer is still safe thanks to the borrow checker and MemSafe trait, but this also makes the API slightly more difficult to use. In order to safely access the underlying slice while the buffer exists, you must map the buffer to "borrow back" a reference to the slice, which should be a no-op in sane OpenCL implementations.

Trait Implementations

impl<'c, H: Clone + HostAccess, D: Clone + DeviceAccess, F: Clone + BufferFlags> Clone for BufferBuilder<'c, H, D, F>[src]

impl<'c, H: Copy + HostAccess, D: Copy + DeviceAccess, F: Copy + BufferFlags> Copy for BufferBuilder<'c, H, D, F>[src]

Auto Trait Implementations

impl<'c, H, D, F> RefUnwindSafe for BufferBuilder<'c, H, D, F> where
    D: RefUnwindSafe,
    F: RefUnwindSafe,
    H: RefUnwindSafe

impl<'c, H = HostReadWrite, D = DeviceReadWrite, F = NoFlags> !Send for BufferBuilder<'c, H, D, F>

impl<'c, H = HostReadWrite, D = DeviceReadWrite, F = NoFlags> !Sync for BufferBuilder<'c, H, D, F>

impl<'c, H, D, F> Unpin for BufferBuilder<'c, H, D, F> where
    D: Unpin,
    F: Unpin,
    H: Unpin

impl<'c, H, D, F> UnwindSafe for BufferBuilder<'c, H, D, F> where
    D: UnwindSafe,
    F: UnwindSafe,
    H: 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> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.