Struct ocl::Buffer
[−]
[src]
pub struct Buffer<T: OclPrm> { // some fields omitted }
A chunk of memory physically located on a device, such as a GPU.
Data is stored remotely in a memory buffer on the device associated with
queue
.
Methods
impl<T: OclPrm> Buffer<T>
[src]
fn new<D: MemLen>(queue: &Queue, flags: Option<MemFlags>, dims: D, data: Option<&[T]>) -> OclResult<Buffer<T>>
Creates a new buffer
[UNSTABLE]: New method, arguments still in a state of flux.
fn cmd<'b>(&'b self) -> BufferCmd<'b, T>
Returns a buffer command builder used to read, write, copy, etc.
Call .enq()
to enqueue the command.
See the BufferCmd
docs
for more info.
fn read<'b>(&'b self, data: &'b mut [T]) -> BufferCmd<'b, T>
Returns a buffer command builder used to read.
Call .enq()
to enqueue the command.
See the BufferCmd
docs
for more info.
fn write<'b>(&'b self, data: &'b [T]) -> BufferCmd<'b, T>
Returns a buffer command builder used to write.
Call .enq()
to enqueue the command.
See the BufferCmd
docs
for more info.
fn len(&self) -> usize
Returns the length of the Buffer.
fn mem_info(&self, info_kind: MemInfo) -> MemInfoResult
Returns info about the underlying memory object.
fn set_default_queue<'a>(&'a mut self, queue: &Queue) -> &'a mut Buffer<T>
Changes the default queue used by this Buffer for reads and writes, etc.
Returns a ref for chaining i.e.:
Example
buffer.set_default_queue(queue).read(....);
fn default_queue(&self) -> &Queue
Returns a reference to the default queue.
fn core_as_ref(&self) -> &MemCore
Returns a reference to the core pointer wrapper, usable by functions in
the core
module.
Methods from Deref<Target=MemCore>
Trait Implementations
impl<T: Clone + OclPrm> Clone for Buffer<T>
[src]
fn clone(&self) -> Buffer<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Debug + OclPrm> Debug for Buffer<T>
[src]
impl<T: OclPrm> Deref for Buffer<T>
[src]
type Target = MemCore
The resulting type after dereferencing
fn deref(&self) -> &MemCore
The method called to dereference a value