Struct ocl::Device
[−]
[src]
pub struct Device(_);
A device identifier.
Methods
impl Device
[src]
fn first(platform: Platform) -> Device
Returns the first available device on a platform
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>) -> 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.
fn list_all(platform: &Platform) -> Vec<Device>
Returns a list of all devices avaliable for a given platform
.
Equivalent to ::list(platform, None)
.
fn list_select(platform: &Platform, 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.
fn list_select_wrap(platform: &Platform, device_types: Option<DeviceType>, idxs: &[usize]) -> 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.
fn list_from_core(devices: Vec<DeviceIdCore>) -> Vec<Device>
Returns a list of Device
s from a list of DeviceIdCore
s
fn name(&self) -> String
Returns the device name.
fn vendor(&self) -> String
Returns the device vendor as a string.
fn max_wg_size(&self) -> usize
Returns the maximum workgroup size.
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) -> cl_device_id
Returns a pointer.
Trait Implementations
impl Debug for Device
[src]
impl Copy for Device
[src]
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 ClDeviceIdPtr for Device
[src]
unsafe fn as_ptr(&self) -> cl_device_id
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