Enum ocl::DeviceSpecifier [] [src]

pub enum DeviceSpecifier {
    All,
    Index(usize),
    Indices(Vec<usize>),
    Single(Device),
    List(Vec<Device>),
    TypeFlags(DeviceType),
}

Specifies [what boils down to] a list of devices.

The variants: All, Index, and Indices are context-specific, not robust, and may lead to a stack unwind if the context changes. They are useful for convenience only [NOTE: This may change and they may soon round-robin by default, making them robust and sexy... well robust anyway][UPDATE: this will probably remain as is].

The TypeFlags variant is useful for specifying a list of devices using a bitfield (DeviceType) and is the most robust / portable.

[FIXME: Add some links to the SDK] [FIXME: Figure out what we're doing as far as round-robin/moduloing by default] - UPDATE: Leave this to the builder or whatever else to determine and leave this enum an exact index which panics.

Variants

AllIndex(usize)Indices(Vec<usize>)Single(Device)List(Vec<Device>)TypeFlags(DeviceType)

Methods

impl DeviceSpecifier
[src]

fn to_device_list(&self, platform: Option<Platform>) -> OclResult<Vec<Device>>

Returns the list of devices matching the parameters specified by this DeviceSpecifier

Panics

Any device indices within the Index and Indices variants 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.

TODO: Swap some of the try!s for .maps.

Trait Implementations

impl Clone for DeviceSpecifier
[src]

fn clone(&self) -> DeviceSpecifier

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 Debug for DeviceSpecifier
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.