Struct ocl::Device
[−]
[src]
#[repr(C)]pub struct Device(_);
An individual device identifier (an OpenCL device_id).
Methods
impl Device[src]
fn first<P: Borrow<Platform>>(platform: P) -> Device
Returns the first available device on a platform.
Panics upon OpenCL error.
fn by_idx_wrap<P: Borrow<Platform>>(
platform: P,
device_idx_wrap: usize
) -> Device
platform: P,
device_idx_wrap: usize
) -> Device
Returns a single device specified by a wrapped index.
Panics upon OpenCL error.
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<P: Borrow<Platform>>(
platform: P,
device_types: Option<DeviceType>
) -> OclResult<Vec<Device>>
platform: P,
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<P: Borrow<Platform>>(platform: P) -> 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<P: Borrow<Platform>>(
platform: P,
device_types: Option<DeviceType>,
idxs: &[usize]
) -> OclResult<Vec<Device>>
platform: P,
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<P: Borrow<Platform>>(
platform: P,
device_types: Option<DeviceType>,
idxs: &[usize]
) -> OclResult<Vec<Device>>
platform: P,
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>
Returns the maximum workgroup size or an error.
fn mem_base_addr_align(&self) -> OclResult<u32>
Returns the memory base address alignment offset or an error.
fn is_available(&self) -> OclResult<bool>
Returns whether or not the device is available for use.
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>
fn as_raw(&self) -> *mut c_void
Returns a pointer.
fn version(&self) -> Result<OpenclVersion, Error>
Returns the queried 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 PartialEq for Device[src]
fn eq(&self, __arg_0: &Device) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Device) -> bool
This method tests for !=.
impl Eq for Device[src]
impl ClDeviceIdPtr for Device[src]
fn as_ptr(&self) -> cl_device_id
impl<'a> ClDeviceIdPtr for &'a Device[src]
fn as_ptr(&self) -> cl_device_id
impl From<DeviceIdCore> for Device[src]
fn from(core: DeviceIdCore) -> Device
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