Struct krnl::device::Features

source ·
pub struct Features { /* private fields */ }
Expand description

Features supported by a device.

See DeviceInfo::features().

Kernels can not be compiled unless the device supports all features used.

Use features to specialize or provide a more helpful error message:

if features.contains(Features::INT8 | Features::BUFFER8) {
    /* u8 impl */
} else {
    /* fallback */
}

Implementations§

source§

impl Features

source

pub const INT8: Self = _

8 bit integers.

Int8 capability.

source

pub const INT16: Self = _

16 bit integers.

Int16 capability.

source

pub const INT64: Self = _

64 bit integers.

Int64 capability.

source

pub const FLOAT16: Self = _

16 bit floats.

Float16 capability.

source

pub const FLOAT64: Self = _

64 bit floats.

Float64 capability.

source

pub const BUFFER8: Self = _

8 bit buffers.

StorageBuffer8BitAccess capability.

source

pub const BUFFER16: Self = _

16 bit buffers.

StorageBuffer16BitAccess capability.

source

pub const PUSH_CONSTANT8: Self = _

8 bit push constants.

StoragePushConstant8 capability.

source

pub const PUSH_CONSTANT16: Self = _

16 bit push constants.

StoragePushConstant16 capability.

source

pub const SUBGROUP_BASIC: Self = _

Subgroup operations.

GroupNonUniform capability.

Enables Kernel subgroup methods:

source

pub const SUBGROUP_VOTE: Self = _

Subgroup vote.

GroupNonUniformVote capability.

source

pub const SUBGROUP_ARITHMETIC: Self = _

Subgroup arithmetic operations.

GroupNonUniformArithmetic capability.

source

pub const SUBGROUP_BALLOT: Self = _

Subgroup ballot operations.

GroupNonUniformBallot capability.

source

pub const SUBGROUP_SHUFFLE: Self = _

Subgroup shuffle operations.

GroupNonUniformShuffle capability.

source

pub const SUBGROUP_SHUFFLE_RELATIVE: Self = _

Subgroup shuffle relative operations.

GroupNonUniformShuffleRelative capability.

source

pub const SUBGROUP_CLUSTERED: Self = _

Subgroup clustered operations.

GroupNonUniformClustered capability.

source

pub const SUBGROUP_QUAD: Self = _

Subgroup quad operations.

GroupNonUniformQuad capability.

source

pub const fn empty() -> Self

No features.

source

pub const fn all() -> Self

All features.

source

pub const fn contains(self, other: Self) -> bool

Contains all features of other.

source

pub const fn union(self, other: Self) -> Self

All features of self and other.

Trait Implementations§

source§

impl BitOr for Features

§

type Output = Features

The resulting type after applying the | operator.
source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
source§

impl BitOrAssign for Features

source§

fn bitor_assign(&mut self, rhs: Self)

Performs the |= operation. Read more
source§

impl Clone for Features

source§

fn clone(&self) -> Features

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Features

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Features

source§

fn eq(&self, other: &Features) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Features

source§

impl Eq for Features

source§

impl StructuralPartialEq for Features

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.