pub struct DeviceProperties {
pub features: Features,
pub memory: MemoryDeviceProperties,
pub hardware: HardwareProperties,
pub timing_method: TimingMethod,
pub identity: DeviceIdentity,
}Expand description
Properties of what the device can do, like what Feature are
supported by it and what its memory properties are.
Fields§
§features: FeaturesThe features supported by the runtime.
memory: MemoryDevicePropertiesThe memory properties of this client.
hardware: HardwarePropertiesThe topology properties of this client.
timing_method: TimingMethodThe method used for profiling on the device.
identity: DeviceIdentityWho the device is, and what its kernels are keyed to.
Implementations§
Source§impl DeviceProperties
impl DeviceProperties
Sourcepub fn new(
features: Features,
memory_props: MemoryDeviceProperties,
hardware: HardwareProperties,
timing_method: TimingMethod,
identity: DeviceIdentity,
) -> Self
pub fn new( features: Features, memory_props: MemoryDeviceProperties, hardware: HardwareProperties, timing_method: TimingMethod, identity: DeviceIdentity, ) -> Self
Create a new feature set with the given features and memory properties.
identity is a required argument rather than something a backend may
fill in afterwards, so a runtime cannot ship reporting an anonymous
device — the failure mode that leaves a bundle unable to say what it was
built for.
Sourcepub fn type_usage(&self, ty: StorageType) -> EnumSet<TypeUsage>
pub fn type_usage(&self, ty: StorageType) -> EnumSet<TypeUsage>
Get the usages for a type
Sourcepub fn atomic_type_usage(&self, ty: Type) -> EnumSet<AtomicUsage>
pub fn atomic_type_usage(&self, ty: Type) -> EnumSet<AtomicUsage>
Get the usages for an atomic type
Sourcepub fn supports_type(&self, ty: impl Into<Type>) -> bool
pub fn supports_type(&self, ty: impl Into<Type>) -> bool
Whether the type is supported in any way
Sourcepub fn supports_address(&self, ty: impl Into<AddressType>) -> bool
pub fn supports_address(&self, ty: impl Into<AddressType>) -> bool
Whether the address type is supported in any way
Sourcepub fn register_address_type(&mut self, ty: impl Into<AddressType>)
pub fn register_address_type(&mut self, ty: impl Into<AddressType>)
Register an address type to the features
Sourcepub fn register_atomic_type_usage(
&mut self,
ty: Type,
uses: impl Into<EnumSet<AtomicUsage>>,
)
pub fn register_atomic_type_usage( &mut self, ty: Type, uses: impl Into<EnumSet<AtomicUsage>>, )
Register an address type to the features
Sourcepub fn register_type_usage(
&mut self,
ty: impl Into<StorageType>,
uses: impl Into<EnumSet<TypeUsage>>,
)
pub fn register_type_usage( &mut self, ty: impl Into<StorageType>, uses: impl Into<EnumSet<TypeUsage>>, )
Register a storage type to the features
Sourcepub fn register_semantic_type(&mut self, ty: SemanticType)
pub fn register_semantic_type(&mut self, ty: SemanticType)
Register a semantic type to the features
Sourcepub fn register_opaque_type(&mut self, ty: OpaqueType)
pub fn register_opaque_type(&mut self, ty: OpaqueType)
Register an opaque type to the features
Trait Implementations§
Source§impl Clone for DeviceProperties
impl Clone for DeviceProperties
Source§fn clone(&self) -> DeviceProperties
fn clone(&self) -> DeviceProperties
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeviceProperties
impl Debug for DeviceProperties
impl Eq for DeviceProperties
Source§impl PartialEq for DeviceProperties
impl PartialEq for DeviceProperties
impl StructuralPartialEq for DeviceProperties
Auto Trait Implementations§
impl Freeze for DeviceProperties
impl RefUnwindSafe for DeviceProperties
impl Send for DeviceProperties
impl Sync for DeviceProperties
impl Unpin for DeviceProperties
impl UnsafeUnpin for DeviceProperties
impl UnwindSafe for DeviceProperties
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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