Struct ocl::Device
[−]
[src]
pub struct Device(_);
An individual device identifier (an OpenCL device_id).
Methods
impl Device[src]
fn first(platform: Platform) -> Device
Returns the first available device on a platform.
Errors
fn specifier() -> DeviceSpecifier
Returns a DeviceSpecifier useful for precisely specifying a set
of devices.
fn resolve_idxs(idxs: &[usize], devices: &[Device]) -> OclResult<Vec<Device>>
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.
fn resolve_idxs_wrap(idxs: &[usize], devices: &[Device]) -> Vec<Device>
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.
fn list(platform: &Platform,
device_types: Option<DeviceType>)
-> OclResult<Vec<Device>>
device_types: Option<DeviceType>)
-> OclResult<Vec<Device>>
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.
fn list_all(platform: &Platform) -> OclResult<Vec<Device>>
Returns a list of all devices avaliable for a given platform.
Equivalent to ::list(platform, None).
See ::list for other
error information.
fn list_select(platform: &Platform,
device_types: Option<DeviceType>,
idxs: &[usize])
-> OclResult<Vec<Device>>
device_types: Option<DeviceType>,
idxs: &[usize])
-> OclResult<Vec<Device>>
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.
fn list_select_wrap(platform: &Platform,
device_types: Option<DeviceType>,
idxs: &[usize])
-> OclResult<Vec<Device>>
device_types: Option<DeviceType>,
idxs: &[usize])
-> OclResult<Vec<Device>>
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
fn list_from_core(devices: Vec<DeviceIdCore>) -> Vec<Device>
Returns a list of Devices from a list of DeviceIdCores
fn name(&self) -> String
Returns the device name.
fn vendor(&self) -> String
Returns the device vendor as a string.
fn max_wg_size(&self) -> OclResult<usize>
fn info(&self, info_kind: DeviceInfo) -> DeviceInfoResult
Returns info about the device.
fn to_string(&self) -> String
Returns a string containing a formatted list of device properties.
fn as_core(&self) -> &DeviceIdCore
Returns the underlying DeviceIdCore.
Methods from Deref<Target=DeviceIdCore>
unsafe fn as_ptr(&self) -> *mut c_void
Returns a pointer.
fn version(&self) -> Result<OpenclVersion, Error>
Returns the looked up and parsed OpenCL version for this device.
Trait Implementations
impl Clone for Device[src]
fn clone(&self) -> Device
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 Copy for Device[src]
impl Debug for Device[src]
impl ClDeviceIdPtr for Device[src]
impl<'a> ClDeviceIdPtr for &'a Device[src]
impl Into<String> for Device[src]
impl Into<DeviceIdCore> for Device[src]
fn into(self) -> DeviceIdCore
Performs the conversion.
impl Display for Device[src]
impl AsRef<Device> for Device[src]
impl Deref for Device[src]
type Target = DeviceIdCore
The resulting type after dereferencing
fn deref(&self) -> &DeviceIdCore
The method called to dereference a value
impl DerefMut for Device[src]
fn deref_mut(&mut self) -> &mut DeviceIdCore
The method called to mutably dereference a value