# Struct ocl::Device [−] [src]

    #[repr(C)]
    pub struct Device(_);

An individual device identifier (an OpenCL device_id).

## Methods

### `impl Device`
[src]

#### `pub fn first<P: Borrow<Platform>>(platform: P) -> OclResult<Device>`
[src]

Returns the first available device on a platform.

#### `pub fn by_idx_wrap<P: Borrow<Platform>>(
platform: P,
device_idx_wrap: usize
) -> OclResult<Device>`
[src]

Returns a single device specified by a wrapped index.

#### `pub fn specifier() -> DeviceSpecifier`
[src]

Returns a `DeviceSpecifier` useful for precisely specifying a set of devices.

#### `pub fn resolve_idxs(
idxs: &[usize],
devices: &[Device]
) -> OclResult<Vec<Device>>`
[src]

Resolves a list of indices into a list of valid devices.

`devices` is the set of all indexable devices.

### Errors

All indices in `idxs` must be valid. Use `resolve_idxs_wrap` for index lists which may contain out of bounds indices.

####
ⓘImportant traits for Vec<u8>

### Important traits for Vec<u8>

`impl Write for Vec<u8>`
`pub fn resolve_idxs_wrap(idxs: &[usize], devices: &[Device]) -> Vec<Device>`
[src]

Resolves a list of indices into a list of valid devices.

`devices` is the set of all indexable devices.

Wraps indices around using modulo (`%`) so that every index is valid.

#### `pub fn list<P: Borrow<Platform>>(
platform: P,
device_types: Option<DeviceType>
) -> OclCoreResult<Vec<Device>>`
[src]

Returns a list of all devices avaliable for a given platform which optionally match the flags set in the bitfield, `device_types`.

Setting `device_types` to `None` will return a list of all avaliable devices for `platform` regardless of type.

### Errors

Returns an `Err(ocl::core::Error::Status {...})` enum variant upon any OpenCL error. Calling `.status()` on the returned error will return an `Option(``[ocl::core::Status]``)` which can be unwrapped then matched to determine the precise reason for failure.

#### `pub fn list_all<P: Borrow<Platform>>(platform: P) -> OclCoreResult<Vec<Device>>`
[src]

Returns a list of all devices avaliable for a given `platform`.

Equivalent to `::list(platform, None)`.

See `::list` for other error information.

#### `pub fn list_select<P: Borrow<Platform>>(
platform: P,
device_types: Option<DeviceType>,
idxs: &[usize]
) -> OclResult<Vec<Device>>`
[src]

Returns a list of devices filtered by type then selected using a list of indices.

### Errors

All indices in `idxs` must be valid.

See `::list` for other error information.

#### `pub fn list_select_wrap<P: Borrow<Platform>>(
platform: P,
device_types: Option<DeviceType>,
idxs: &[usize]
) -> OclCoreResult<Vec<Device>>`
[src]

Returns a list of devices filtered by type then selected using a wrapping list of indices.

Wraps indices around (`%`) so that every index is valid.

### Errors

See `::list`

####
ⓘImportant traits for Vec<u8>

### Important traits for Vec<u8>

`impl Write for Vec<u8>`
`pub fn list_from_core(devices: Vec<DeviceIdCore>) -> Vec<Device>`
[src]

Returns a list of `Device`s from a list of `DeviceIdCore`s

#### `pub fn name(&self) -> OclCoreResult<String>`
[src]

Returns the device name.

#### `pub fn vendor(&self) -> OclCoreResult<String>`
[src]

Returns the device vendor as a string.

#### `pub fn max_wg_size(&self) -> OclCoreResult<usize>`
[src]

Returns the maximum workgroup size or an error.

#### `pub fn mem_base_addr_align(&self) -> OclCoreResult<u32>`
[src]

Returns the memory base address alignment offset or an error.

#### `pub fn is_available(&self) -> OclCoreResult<bool>`
[src]

Returns whether or not the device is available for use.

#### `pub fn info(&self, info_kind: DeviceInfo) -> OclCoreResult<DeviceInfoResult>`
[src]

Returns info about the device.

#### `pub fn to_string(&self) -> String`
[src]

Returns a string containing a formatted list of device properties.

#### `pub fn as_core(&self) -> &DeviceIdCore`
[src]

Returns the underlying `DeviceIdCore`.

## Methods from Deref<Target = DeviceIdCore>

#### `pub fn as_raw(&self) -> *mut c_void`
[src]

Returns a pointer.

#### `pub fn version(&self) -> Result<OpenclVersion, Error>`
[src]

Returns the queried and parsed OpenCL version for this device.

## Trait Implementations

### `impl From<Device> for DeviceSpecifier`
[src]

#### `fn from(device: Device) -> DeviceSpecifier`
[src]

Performs the conversion.

### `impl<'a> From<&'a Device> for DeviceSpecifier`
[src]

#### `fn from(device: &'a Device) -> DeviceSpecifier`
[src]

Performs the conversion.

### `impl Clone for Device`
[src]

#### `fn clone(&self) -> Device`
[src]

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`
1.0.0
[src]

Performs copy-assignment from `source`. Read more

### `impl Copy for Device`
[src]

### `impl Debug for Device`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`
[src]

Formats the value using the given formatter. Read more

### `impl PartialEq for Device`
[src]

#### `fn eq(&self, __arg_0: &Device) -> bool`
[src]

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, __arg_0: &Device) -> bool`
[src]

This method tests for `!=`.

### `impl Eq for Device`
[src]

### `impl ClDeviceIdPtr for Device`
[src]

#### `fn as_ptr(&self) -> cl_device_id`
[src]

### `impl<'a> ClDeviceIdPtr for &'a Device`
[src]

#### `fn as_ptr(&self) -> cl_device_id`
[src]

### `impl From<DeviceIdCore> for Device`
[src]

#### `fn from(core: DeviceIdCore) -> Device`
[src]

Performs the conversion.

### `impl From<Device> for String`
[src]

#### `fn from(d: Device) -> String`
[src]

Performs the conversion.

### `impl From<Device> for DeviceIdCore`
[src]

#### `fn from(d: Device) -> DeviceIdCore`
[src]

Performs the conversion.

### `impl Display for Device`
[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`
[src]

Formats the value using the given formatter. Read more

### `impl AsRef<Device> for Device`
[src]

#### `fn as_ref(&self) -> &Device`
[src]

Performs the conversion.

### `impl Deref for Device`
[src]

#### `type Target = DeviceIdCore`

The resulting type after dereferencing.

#### `fn deref(&self) -> &DeviceIdCore`
[src]

Dereferences the value.

### `impl DerefMut for Device`
[src]

#### `fn deref_mut(&mut self) -> &mut DeviceIdCore`
[src]

Mutably dereferences the value.

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)