Struct fil_ocl::RwVec [−][src]
A locking Vec
which interoperates with OpenCL events and Rust futures to
provide exclusive access to data.
Calling ::read
or ::write
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.
Implementations
impl<T> RwVec<T>
[src]
pub fn new() -> RwVec<T>
[src]
Creates and returns a new RwVec
.
pub fn read(self) -> FutureGuard<Vec<T>, ReadGuard<Vec<T>>>
[src]
Returns a new FutureRwGuard
which will resolve into a a RwGuard
.
pub fn write(self) -> FutureGuard<Vec<T>, WriteGuard<Vec<T>>>
[src]
Returns a new FutureRwGuard
which will resolve into a a RwGuard
.
pub unsafe fn as_mut_slice(&mut self) -> &mut [T]ⓘ
[src]
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).
pub fn len_stale(&self) -> usize
[src]
Returns the length of the internal Vec
.
Concurrency Considerations
The returned length is to be considered immediately stale (out of
date) due to the fact that other threads may be modifying it. To
obtain an accurate state of the internal Vec
, the containing RwVec
must first be locked with ::read
or ::write
.
pub fn id(&self) -> usize
[src]
Returns a pointer address to the internal array, usable as a unique identifier.
Note that resizing the Vec
will likely change the address. Also, the
same ‘id’ could be reused by another RwVec
created after this one is
dropped.
Methods from Deref<Target = OrderLock<Vec<T>>>
pub fn as_ptr(&self) -> *const V
[src]
Returns a reference to the inner value.
pub fn as_mut_ptr(&self) -> *mut V
[src]
Returns a mutable reference to the inner value.
Trait Implementations
impl<T: Clone> Clone for RwVec<T>
[src]
impl<T: Debug> Debug for RwVec<T>
[src]
impl<T> Deref for RwVec<T>
[src]
type Target = OrderLock<Vec<T>>
The resulting type after dereferencing.
fn deref(&self) -> &OrderLock<Vec<T>>
[src]
impl<T> DerefMut for RwVec<T>
[src]
impl<'a, 'd, T> From<&'a RwVec<T>> for WriteSrc<'d, T> where
T: OclPrm,
[src]
T: OclPrm,
impl<T> From<QrwLock<Vec<T, Global>>> for RwVec<T>
[src]
impl<'d, T> From<RwVec<T>> for WriteSrc<'d, T> where
T: OclPrm,
[src]
T: OclPrm,
impl<T> From<Vec<T, Global>> for RwVec<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for RwVec<T>
impl<T> Send for RwVec<T> where
T: Send,
T: Send,
impl<T> Sync for RwVec<T> where
T: Send,
T: Send,
impl<T> Unpin for RwVec<T>
impl<T> !UnwindSafe for RwVec<T>
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,
pub 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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,