pub struct CubeDim {
pub x: u32,
pub y: u32,
pub z: u32,
}Expand description
The number of units across all 3 axis totalling to the number of working units in a cube.
Fields§
§x: u32The number of units in the x axis.
y: u32The number of units in the y axis.
z: u32The number of units in the z axis.
Implementations§
Source§impl CubeDim
impl CubeDim
Sourcepub fn new<R: Runtime>(client: &ComputeClient<R>, working_units: usize) -> Self
pub fn new<R: Runtime>(client: &ComputeClient<R>, working_units: usize) -> Self
Creates a new CubeDim based on the maximum number of tasks that can be parellalized by units, in other words, by the maximum number of working units.
§Notes
For complex problems, you probably want to have your own logic function to create the CubeDim, but for simpler problems such as elemwise-operation, this is a great default.
Sourcepub const fn new_single() -> Self
pub const fn new_single() -> Self
Create a new cube dim with x = y = z = 1.
Sourcepub const fn new_2d(x: u32, y: u32) -> Self
pub const fn new_2d(x: u32, y: u32) -> Self
Create a new cube dim with the given x and y, and z = 1.
Sourcepub const fn new_3d(x: u32, y: u32, z: u32) -> Self
pub const fn new_3d(x: u32, y: u32, z: u32) -> Self
Create a new cube dim with the given x, y and z. This is equivalent to the new function.
Sourcepub const fn can_contain(&self, other: CubeDim) -> bool
pub const fn can_contain(&self, other: CubeDim) -> bool
Whether this CubeDim can fully contain other
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CubeDim
impl<'de> Deserialize<'de> for CubeDim
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for CubeDim
impl Eq for CubeDim
impl StructuralPartialEq for CubeDim
Auto Trait Implementations§
impl Freeze for CubeDim
impl RefUnwindSafe for CubeDim
impl Send for CubeDim
impl Sync for CubeDim
impl Unpin for CubeDim
impl UnwindSafe for CubeDim
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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
Compare self to
key and return true if they are equal.