pub struct RudaDim {
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 ruda.
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 RudaDim
impl RudaDim
Sourcepub fn new(properties: &DeviceProperties, working_units: usize) -> RudaDim
pub fn new(properties: &DeviceProperties, working_units: usize) -> RudaDim
Creates a new RudaDim 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
RudaDim, but for simpler problems such as elemwise-operation, this is a great default.
Sourcepub const fn new_single() -> RudaDim
pub const fn new_single() -> RudaDim
Create a new ruda dim with x = y = z = 1.
Sourcepub const fn new_2d(x: u32, y: u32) -> RudaDim
pub const fn new_2d(x: u32, y: u32) -> RudaDim
Create a new ruda dim with the given x and y, and z = 1.
Sourcepub const fn new_3d(x: u32, y: u32, z: u32) -> RudaDim
pub const fn new_3d(x: u32, y: u32, z: u32) -> RudaDim
Create a new ruda dim with the given x, y and z. This is equivalent to the new function.
Sourcepub const fn can_contain(&self, other: RudaDim) -> bool
pub const fn can_contain(&self, other: RudaDim) -> bool
Whether this RudaDim can fully contain other
Trait Implementations§
impl Copy for RudaDim
Source§impl<'de> Deserialize<'de> for RudaDim
impl<'de> Deserialize<'de> for RudaDim
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RudaDim, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RudaDim, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RudaDim
Source§impl Serialize for RudaDim
impl Serialize for RudaDim
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for RudaDim
Auto Trait Implementations§
impl Freeze for RudaDim
impl RefUnwindSafe for RudaDim
impl Send for RudaDim
impl Sync for RudaDim
impl Unpin for RudaDim
impl UnsafeUnpin for RudaDim
impl UnwindSafe for RudaDim
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<T> CacheKey for T
impl<T> CacheValue for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CompilationArg for T
impl<T> CompilationArg for T
Source§fn dynamic_cast<Arg: CompilationArg>(&self) -> Arg
fn dynamic_cast<Arg: CompilationArg>(&self) -> Arg
Compilation args should be the same even with different element types. However, it isn’t
possible to enforce it with the type system. So, we make the compilation args serializable
and dynamically cast them. Read more
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.