pub enum ComputeResources {
Units(u32),
Planes(u32),
}
Expand description
Number of compute primitives required by some component, specified as either units or planes.
Variants§
Implementations§
Source§impl ComputeResources
impl ComputeResources
Sourcepub fn as_plane_resources(
self,
plane_dim: u32,
) -> Result<Self, InvalidConfigError>
pub fn as_plane_resources( self, plane_dim: u32, ) -> Result<Self, InvalidConfigError>
Ensures ComputeResources is 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
Auto Trait Implementations§
impl Freeze for ComputeResources
impl RefUnwindSafe for ComputeResources
impl Send for ComputeResources
impl Sync for ComputeResources
impl Unpin for ComputeResources
impl UnwindSafe for ComputeResources
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