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 ::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.

Methods

impl<T> RwVec<T>
[src]

Creates and returns a new RwVec.

Returns a new FutureRwGuard which will resolve into a a RwGuard.

Returns a new FutureRwGuard which will resolve into a a RwGuard.

Important traits for &'a [u8]

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).

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.

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>>>

Returns a reference to the inner value.

Returns a mutable reference to the inner value.

Trait Implementations

impl<T: Clone> Clone for RwVec<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for RwVec<T>
[src]

Formats the value using the given formatter. Read more

impl<T> From<QrwLock<Vec<T>>> for RwVec<T>
[src]

Performs the conversion.

impl<T> From<Vec<T>> for RwVec<T>
[src]

Performs the conversion.

impl<T> Deref for RwVec<T>
[src]

The resulting type after dereferencing.

Dereferences the value.

impl<T> DerefMut for RwVec<T>
[src]

Mutably dereferences the value.

Auto Trait Implementations

impl<T> Send for RwVec<T> where
    T: Send

impl<T> Sync for RwVec<T> where
    T: Send