Struct ocl::flags::DeviceType [−]
pub struct DeviceType { /* fields omitted */ }
cl_device_type - bitfield
CL_DEVICE_TYPE_DEFAULT
: The defaultOpenCL
device in the system.CL_DEVICE_TYPE_CPU
: AnOpenCL
device that is the host processor. The host processor runs theOpenCL
implementations and is a single or multi-core CPU.CL_DEVICE_TYPE_GPU
: AnOpenCL
device that is a GPU. By this we mean that the device can also be used to accelerate a 3D API such as OpenGL or DirectX.CL_DEVICE_TYPE_ACCELERATOR
: DedicatedOpenCL
accelerators (for example the IBM CELL Blade). These devices communicate with the host processor using a peripheral interconnect such as PCIe.CL_DEVICE_TYPE_ALL
: A union of all flags.
Methods
impl DeviceType
[src]
impl DeviceType
pub fn new() -> DeviceType
[src]
pub fn new() -> DeviceType
pub fn system_default(self) -> DeviceType
[src]
pub fn system_default(self) -> DeviceType
pub fn cpu(self) -> DeviceType
[src]
pub fn cpu(self) -> DeviceType
pub fn gpu(self) -> DeviceType
[src]
pub fn gpu(self) -> DeviceType
pub fn accelerator(self) -> DeviceType
[src]
pub fn accelerator(self) -> DeviceType
pub fn custom(self) -> DeviceType
[src]
pub fn custom(self) -> DeviceType
impl DeviceType
impl DeviceType
pub const DEFAULT: DeviceType
DEFAULT: DeviceType = DeviceType{bits: 1 << 0,}
pub const CPU: DeviceType
CPU: DeviceType = DeviceType{bits: 1 << 1,}
pub const GPU: DeviceType
GPU: DeviceType = DeviceType{bits: 1 << 2,}
pub const ACCELERATOR: DeviceType
ACCELERATOR: DeviceType = DeviceType{bits: 1 << 3,}
pub const CUSTOM: DeviceType
CUSTOM: DeviceType = DeviceType{bits: 1 << 4,}
pub const ALL: DeviceType
ALL: DeviceType = DeviceType{bits: 4294967295,}
pub fn empty() -> DeviceType
pub fn empty() -> DeviceType
Returns an empty set of flags.
pub fn all() -> DeviceType
pub fn all() -> DeviceType
Returns the set containing all flags.
pub fn bits(&self) -> u64
pub fn bits(&self) -> u64
Returns the raw value of the flags currently stored.
pub fn from_bits(bits: u64) -> Option<DeviceType>
pub fn from_bits(bits: u64) -> Option<DeviceType>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub fn from_bits_truncate(bits: u64) -> DeviceType
pub fn from_bits_truncate(bits: u64) -> DeviceType
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if no flags are currently stored.
pub fn is_all(&self) -> bool
pub fn is_all(&self) -> bool
Returns true
if all flags are currently set.
pub fn intersects(&self, other: DeviceType) -> bool
pub fn intersects(&self, other: DeviceType) -> bool
Returns true
if there are flags common to both self
and other
.
pub fn contains(&self, other: DeviceType) -> bool
pub fn contains(&self, other: DeviceType) -> bool
Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: DeviceType)
pub fn insert(&mut self, other: DeviceType)
Inserts the specified flags in-place.
pub fn remove(&mut self, other: DeviceType)
pub fn remove(&mut self, other: DeviceType)
Removes the specified flags in-place.
pub fn toggle(&mut self, other: DeviceType)
pub fn toggle(&mut self, other: DeviceType)
Toggles the specified flags in-place.
pub fn set(&mut self, other: DeviceType, value: bool)
pub fn set(&mut self, other: DeviceType, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations
impl LowerHex for DeviceType
impl LowerHex for DeviceType
impl Sub<DeviceType> for DeviceType
impl Sub<DeviceType> for DeviceType
type Output = DeviceType
The resulting type after applying the -
operator.
fn sub(self, other: DeviceType) -> DeviceType
fn sub(self, other: DeviceType) -> DeviceType
Returns the set difference of the two sets of flags.
impl Clone for DeviceType
impl Clone for DeviceType
fn clone(&self) -> DeviceType
fn clone(&self) -> DeviceType
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for DeviceType
impl Debug for DeviceType
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Ord for DeviceType
impl Ord for DeviceType
fn cmp(&self, other: &DeviceType) -> Ordering
fn cmp(&self, other: &DeviceType) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Default for DeviceType
[src]
impl Default for DeviceType
fn default() -> DeviceType
[src]
fn default() -> DeviceType
Returns the "default value" for a type. Read more
impl SubAssign<DeviceType> for DeviceType
impl SubAssign<DeviceType> for DeviceType
fn sub_assign(&mut self, other: DeviceType)
fn sub_assign(&mut self, other: DeviceType)
Disables all flags enabled in the set.
impl BitAndAssign<DeviceType> for DeviceType
impl BitAndAssign<DeviceType> for DeviceType
fn bitand_assign(&mut self, other: DeviceType)
fn bitand_assign(&mut self, other: DeviceType)
Disables all flags disabled in the set.
impl BitXorAssign<DeviceType> for DeviceType
impl BitXorAssign<DeviceType> for DeviceType
fn bitxor_assign(&mut self, other: DeviceType)
fn bitxor_assign(&mut self, other: DeviceType)
Toggles the set of flags.
impl BitOrAssign<DeviceType> for DeviceType
impl BitOrAssign<DeviceType> for DeviceType
fn bitor_assign(&mut self, other: DeviceType)
fn bitor_assign(&mut self, other: DeviceType)
Adds the set of flags.
impl BitAnd<DeviceType> for DeviceType
impl BitAnd<DeviceType> for DeviceType
type Output = DeviceType
The resulting type after applying the &
operator.
fn bitand(self, other: DeviceType) -> DeviceType
fn bitand(self, other: DeviceType) -> DeviceType
Returns the intersection between the two sets of flags.
impl PartialOrd<DeviceType> for DeviceType
impl PartialOrd<DeviceType> for DeviceType
fn partial_cmp(&self, other: &DeviceType) -> Option<Ordering>
fn partial_cmp(&self, other: &DeviceType) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &DeviceType) -> bool
fn lt(&self, other: &DeviceType) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &DeviceType) -> bool
fn le(&self, other: &DeviceType) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &DeviceType) -> bool
fn gt(&self, other: &DeviceType) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &DeviceType) -> bool
fn ge(&self, other: &DeviceType) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Extend<DeviceType> for DeviceType
impl Extend<DeviceType> for DeviceType
fn extend<T>(&mut self, iterator: T) where
T: IntoIterator<Item = DeviceType>,
fn extend<T>(&mut self, iterator: T) where
T: IntoIterator<Item = DeviceType>,
Extends a collection with the contents of an iterator. Read more
impl Hash for DeviceType
impl Hash for DeviceType
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Binary for DeviceType
impl Binary for DeviceType
impl Octal for DeviceType
impl Octal for DeviceType
impl UpperHex for DeviceType
impl UpperHex for DeviceType
impl BitOr<DeviceType> for DeviceType
impl BitOr<DeviceType> for DeviceType
type Output = DeviceType
The resulting type after applying the |
operator.
fn bitor(self, other: DeviceType) -> DeviceType
fn bitor(self, other: DeviceType) -> DeviceType
Returns the union of the two sets of flags.
impl FromIterator<DeviceType> for DeviceType
impl FromIterator<DeviceType> for DeviceType
fn from_iter<T>(iterator: T) -> DeviceType where
T: IntoIterator<Item = DeviceType>,
fn from_iter<T>(iterator: T) -> DeviceType where
T: IntoIterator<Item = DeviceType>,
Creates a value from an iterator. Read more
impl BitXor<DeviceType> for DeviceType
impl BitXor<DeviceType> for DeviceType
type Output = DeviceType
The resulting type after applying the ^
operator.
fn bitxor(self, other: DeviceType) -> DeviceType
fn bitxor(self, other: DeviceType) -> DeviceType
Returns the left flags, but with all the right flags toggled.
impl Copy for DeviceType
impl Copy for DeviceType
impl Eq for DeviceType
impl Eq for DeviceType
impl PartialEq<DeviceType> for DeviceType
impl PartialEq<DeviceType> for DeviceType
fn eq(&self, other: &DeviceType) -> bool
fn eq(&self, other: &DeviceType) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &DeviceType) -> bool
fn ne(&self, other: &DeviceType) -> bool
This method tests for !=
.
impl Not for DeviceType
impl Not for DeviceType
type Output = DeviceType
The resulting type after applying the !
operator.
fn not(self) -> DeviceType
fn not(self) -> DeviceType
Returns the complement of this set of flags.
impl From<DeviceType> for DeviceSpecifier
[src]
impl From<DeviceType> for DeviceSpecifier
fn from(flags: DeviceType) -> DeviceSpecifier
[src]
fn from(flags: DeviceType) -> DeviceSpecifier
Performs the conversion.
Auto Trait Implementations
impl Send for DeviceType
impl Send for DeviceType
impl Sync for DeviceType
impl Sync for DeviceType