Enum fil_ocl::enums::DeviceSpecifier [−][src]
Specifies [what boils down to] a list of devices.
The Indices
variant is context-specific, not robust, and may lead to a
panic if the context changes. It is useful for convenience only and not
recommended for general use. The WrappingIndices
variant is somewhat
less dangerous but can still be somewhat machine-specific.
The TypeFlags
variant is used for specifying a list of devices using a
bitfield (DeviceType
) and is the most robust / portable.
[FIXME: Add some links to the SDK]
Variants
Single(Device)
TypeFlags(DeviceType)
Implementations
impl DeviceSpecifier
[src]
pub fn all(self) -> DeviceSpecifier
[src]
Returns a DeviceSpecifier::All
variant which specifies all
devices on a platform.
pub fn first(self) -> DeviceSpecifier
[src]
Returns a DeviceSpecifier::First
variant which specifies only
the first device on a platform.
pub fn single(self, device: Device) -> DeviceSpecifier
[src]
Returns a DeviceSpecifier::Single
variant which specifies a single
device.
pub fn list(self, list: Vec<Device>) -> DeviceSpecifier
[src]
Returns a DeviceSpecifier::List
variant which specifies a list of
devices.
pub unsafe fn indices(self, indices: Vec<usize>) -> DeviceSpecifier
[src]
Returns a DeviceSpecifier::Indices
variant which specifies a list of
devices by index.
Safety
This variant is context-specific, not robust, and may lead to a panic if the context changes. It is useful for convenience only and not recommended for general use.
Though using the Indices
variant is not strictly unsafe in the usual
way (will not lead to memory bugs, etc.), it is marked unsafe as a
warning. Recommendations for a more idiomatic way to express this
potential footgun are welcome.
Using ::wrapping_indices
is a more robust (but still potentially
non-portable) solution.
pub fn wrapping_indices(self, windices: Vec<usize>) -> DeviceSpecifier
[src]
Returns a DeviceSpecifier::WrappingIndices
variant, specifying a
list of devices by indices which are wrapped around (simply using the
modulo operator) so that every index is always valid.
pub fn type_flags(self, flags: DeviceType) -> DeviceSpecifier
[src]
Returns a DeviceSpecifier::TypeFlags
variant which specifies a list
of devices using a conventional bitfield.
pub fn to_device_list<P: Borrow<Platform>>(
&self,
platform: Option<P>
) -> OclResult<Vec<Device>>
[src]
&self,
platform: Option<P>
) -> OclResult<Vec<Device>>
Returns the list of devices matching the parameters specified by this
DeviceSpecifier
Panics
Any device indices listed within the Indices
variant must be within
the range of the number of devices for the platform specified by
Platform
. If no platform
has been specified, this behaviour is
undefined and could end up using any platform at all.
Trait Implementations
impl Clone for DeviceSpecifier
[src]
fn clone(&self) -> DeviceSpecifier
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for DeviceSpecifier
[src]
impl Default for DeviceSpecifier
[src]
fn default() -> DeviceSpecifier
[src]
impl<'a> From<&'a [Device]> for DeviceSpecifier
[src]
impl<'a> From<&'a [usize]> for DeviceSpecifier
[src]
impl<'a> From<&'a Device> for DeviceSpecifier
[src]
fn from(device: &'a Device) -> DeviceSpecifier
[src]
impl<'a> From<&'a DeviceId> for DeviceSpecifier
[src]
fn from(device: &'a DeviceIdCore) -> DeviceSpecifier
[src]
impl<'a> From<&'a Vec<Device, Global>> for DeviceSpecifier
[src]
fn from(devices: &'a Vec<Device>) -> DeviceSpecifier
[src]
impl<'a> From<&'a Vec<usize, Global>> for DeviceSpecifier
[src]
fn from(indices: &'a Vec<usize>) -> DeviceSpecifier
[src]
impl From<Device> for DeviceSpecifier
[src]
fn from(device: Device) -> DeviceSpecifier
[src]
impl From<DeviceId> for DeviceSpecifier
[src]
fn from(device: DeviceIdCore) -> DeviceSpecifier
[src]
impl From<DeviceType> for DeviceSpecifier
[src]
fn from(flags: DeviceType) -> DeviceSpecifier
[src]
impl From<usize> for DeviceSpecifier
[src]
fn from(index: usize) -> DeviceSpecifier
[src]
Auto Trait Implementations
impl RefUnwindSafe for DeviceSpecifier
impl Send for DeviceSpecifier
impl Sync for DeviceSpecifier
impl Unpin for DeviceSpecifier
impl UnwindSafe for DeviceSpecifier
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>,