[−][src]Struct dynamic_ocl::buffer::BufferBuilder
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]
self,
slice: &[T]
) -> Result<Buffer<'static, H, T>>
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]
self,
size: usize
) -> Result<Buffer<'static, H, T>>
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]
self,
slice: &mut [T]
) -> Result<Buffer<H, T>>
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]
fn clone(&self) -> BufferBuilder<'c, H, D, F>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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,
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,
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,
D: UnwindSafe,
F: UnwindSafe,
H: 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> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,