Struct ocl::async::BufferStream
[−]
[src]
pub struct BufferStream<T: OclPrm> { /* fields omitted */ }
Represents mapped memory and allows frames of data to be 'flooded' (read)
from a device-visible Buffer
into its associated host-accessible mapped
memory region in a repeated fashion.
This represents the fastest possible method for reading data from an OpenCL device.
Methods
impl<T: OclPrm> BufferStream<T>
[src]
pub fn new(queue: Queue, len: usize) -> OclResult<BufferStream<T>>
[src]
Returns a new BufferStream
.
The current thread will be blocked while the buffer is initialized upon calling this function.
pub unsafe fn from_buffer(
buffer: Buffer<T>,
queue: Option<Queue>,
default_offset: usize,
default_len: usize
) -> OclResult<BufferStream<T>>
[src]
buffer: Buffer<T>,
queue: Option<Queue>,
default_offset: usize,
default_len: usize
) -> OclResult<BufferStream<T>>
Returns a new BufferStream
.
Safety
buffer
must not have the same region mapped more than once.
Note
The buffer will initially be mapped then unmapped, blocking the current thread until those operations complete upon calling this function.
pub fn read(self) -> FutureGuard<Inner<T>, ReadGuard<Inner<T>>>
[src]
Returns a new FutureGuard
which will resolve into a a ReadGuard
.
pub fn flood<'c>(self) -> FloodCmd<'c, T>
[src]
Returns a command builder which, when enqueued, floods the mapped memory region with fresh data from the device.
pub fn buffer(&self) -> &Buffer<T>
[src]
Returns a reference to the internal buffer.
pub fn memory(&self) -> &MemMapCore<T>
[src]
Returns a reference to the internal memory mapping.
pub fn default_offset(&self) -> usize
[src]
Returns a reference to the default offset.
pub fn default_len(&self) -> usize
[src]
Returns the length of the memory region.
pub unsafe fn as_mut_slice(&self) -> &mut [T]
[src]
Returns a mutable slice into the contained memory region.
Used by buffer command builders when preparing future read and write commands.
Do not use unless you are 100% certain that there will be no other reads or writes for the entire access duration (only possible if manually manipulating the lock status).
pub fn id(&self) -> usize
[src]
Returns a pointer address to the internal memory region, usable as a unique identifier.
Trait Implementations
impl<T: Clone + OclPrm> Clone for BufferStream<T>
[src]
fn clone(&self) -> BufferStream<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Debug + OclPrm> Debug for BufferStream<T>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T: OclPrm> From<OrderLock<Inner<T>>> for BufferStream<T>
[src]
fn from(order_lock: OrderLock<Inner<T>>) -> BufferStream<T>
[src]
Performs the conversion.