pub enum CubeDimResource {
Units(u32),
Planes(u32),
Specialized(SpecializedCubeDim),
}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<SpecializedCubeDim, InvalidConfigError>
pub fn as_specialized( self, plane_dim: u32, ) -> Result<SpecializedCubeDim, InvalidConfigError>
Recover the SpecializedCubeDim 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