Struct fil_ocl::Device[][src]

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

An individual device identifier (an OpenCL device_id).

Implementations

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.

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>
) -> OclResult<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) -> OclResult<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]
) -> OclResult<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

pub fn list_from_core(devices: Vec<DeviceIdCore>) -> Vec<Device>[src]

Returns a list of Devices from a list of DeviceIdCores

pub fn name(&self) -> OclResult<String>[src]

Returns the device name.

pub fn vendor(&self) -> OclResult<String>[src]

Returns the device vendor as a string.

pub fn max_wg_size(&self) -> OclResult<usize>[src]

Returns the maximum workgroup size or an error.

pub fn mem_base_addr_align(&self) -> OclResult<u32>[src]

Returns the memory base address alignment offset or an error.

pub fn is_available(&self) -> OclResult<bool>[src]

Returns whether or not the device is available for use.

pub fn info_raw(&self, info_kind: u32) -> OclResult<Vec<u8>>[src]

Returns raw info about the device, as a vector of bytes. Intended for use with non-standard OpenCL extensions.

pub fn info(&self, info_kind: DeviceInfo) -> OclResult<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 AsRef<Device> for Device[src]

impl ClDeviceIdPtr for Device[src]

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

impl Clone for Device[src]

impl Copy for Device[src]

impl Debug for Device[src]

impl Deref for Device[src]

type Target = DeviceIdCore

The resulting type after dereferencing.

impl DerefMut for Device[src]

impl Display for Device[src]

impl Eq for Device[src]

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

impl From<Device> for DeviceSpecifier[src]

impl From<Device> for DeviceIdCore[src]

impl From<DeviceId> for Device[src]

impl Hash for Device[src]

impl PartialEq<Device> for Device[src]

impl StructuralEq for Device[src]

impl StructuralPartialEq for Device[src]

Auto Trait Implementations

impl RefUnwindSafe for Device

impl Send for Device

impl Sync for Device

impl Unpin for Device

impl UnwindSafe for Device

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.