Struct ocl::RwVec
[−]
[src]
pub struct RwVec<T> { /* fields omitted */ }
A locking Vec
which interoperates with OpenCL events and Rust futures to
provide exclusive access to data.
Calling ::lock
or ::request_lock
returns a future which will
resolve into a RwGuard
.
Platform Compatibility
Some CPU device/platform combinations have synchronization problems when
accessing an RwVec
from multiple threads. Known platforms with problems
are 2nd and 4th gen Intel Core processors (Sandy Bridge and Haswell) with
Intel OpenCL CPU drivers. Others may be likewise affected. Run the
device_check.rs
example to determine if your device/platform is
affected. AMD platform drivers are known to work properly on the
aforementioned CPUs so use those instead if possible.
Methods
impl<T> RwVec<T>
[src]
fn new() -> RwVec<T>
Creates and returns a new RwVec
.
fn read(self) -> FutureReader<T>
Returns a new FutureRwGuard
which will resolve into a a RwGuard
.
fn write(self) -> FutureWriter<T>
Returns a new FutureRwGuard
which will resolve into a a RwGuard
.
unsafe fn as_mut_slice(&self) -> &mut [T]
Returns a mutable slice into the contained Vec
.
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).
fn len(&self) -> usize
Returns the length of the internal Vec
.
Trait Implementations
impl<T: Debug> Debug for RwVec<T>
[src]
impl<T> From<QrwLock<Vec<T>>> for RwVec<T>
[src]
impl<T> From<Vec<T>> for RwVec<T>
[src]
impl<T> Clone for RwVec<T>
[src]
fn clone(&self) -> RwVec<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