pub enum CubeDimResource {
Units(u32),
Planes(u32),
Specialized(PlaneFlowConfig),
}Expand description
Number of compute primitives required by some component, specified as either units, planes, or a specialized plane-flow split.
Variants§
Implementations§
Source§impl CubeDimResource
impl CubeDimResource
Sourcepub fn as_plane_resource(
self,
plane_dim: u32,
) -> Result<Self, InvalidConfigError>
pub fn as_plane_resource( self, plane_dim: u32, ) -> Result<Self, InvalidConfigError>
Ensures CubeDimResource is the Planes variant, converting units using plane_dim, the number of units in a plane.
Will fail if the number of units does not correspond to an exact number of planes
Sourcepub fn to_cube_dim(self, plane_dim: u32) -> Result<CubeDim, InvalidConfigError>
pub fn to_cube_dim(self, plane_dim: u32) -> Result<CubeDim, InvalidConfigError>
Make a CubeDim from specified resources.
Obtained CubeDim is always (plane_dim, number_of_planes, 1)
Will fail if the number of units does not correspond to an exact number of planes
Sourcepub fn num_planes(self, plane_dim: u32) -> Result<u32, InvalidConfigError>
pub fn num_planes(self, plane_dim: u32) -> Result<u32, InvalidConfigError>
Get the number of planes
Will fail if the number of units does not correspond to an exact number of planes
Sourcepub fn as_specialized(
self,
plane_dim: u32,
) -> Result<PlaneFlowConfig, InvalidConfigError>
pub fn as_specialized( self, plane_dim: u32, ) -> Result<PlaneFlowConfig, InvalidConfigError>
Recover the PlaneFlowConfig view of this resource. Units/Planes produce a
non-specialized config (all planes in the main flow).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CubeDimResource
impl RefUnwindSafe for CubeDimResource
impl Send for CubeDimResource
impl Sync for CubeDimResource
impl Unpin for CubeDimResource
impl UnsafeUnpin for CubeDimResource
impl UnwindSafe for CubeDimResource
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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 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> ⓘ
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