Skip to main content

RudaDim

Struct RudaDim 

Source
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: u32

The number of units in the x axis.

§y: u32

The number of units in the y axis.

§z: u32

The number of units in the z axis.

Implementations§

Source§

impl RudaDim

Source

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.

Source

pub const fn new_single() -> RudaDim

Create a new ruda dim with x = y = z = 1.

Source

pub const fn new_1d(x: u32) -> RudaDim

Create a new ruda dim with the given x, and y = z = 1.

Source

pub const fn new_2d(x: u32, y: u32) -> RudaDim

Create a new ruda dim with the given x and y, and z = 1.

Source

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.

Source

pub const fn num_elems(&self) -> u32

Total numbers of units per ruda

Source

pub const fn can_contain(&self, other: RudaDim) -> bool

Whether this RudaDim can fully contain other

Trait Implementations§

Source§

impl Clone for RudaDim

Source§

fn clone(&self) -> RudaDim

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for RudaDim

Source§

impl Debug for RudaDim

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RudaDim

Source§

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
Source§

impl Eq for RudaDim

Source§

impl From<(u32, u32, u32)> for RudaDim

Source§

fn from(value: (u32, u32, u32)) -> RudaDim

Converts to this type from the input type.
Source§

impl Hash for RudaDim

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for RudaDim

Source§

fn eq(&self, other: &RudaDim) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for RudaDim

Source§

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
Source§

impl StructuralPartialEq for RudaDim

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CacheKey for T

Source§

impl<T> CacheValue for T

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<C> CloneExpand for C
where C: Clone,

Source§

fn __expand_clone_method(&self, _scope: &mut Scope) -> C

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CompilationArg for T
where T: Clone + PartialEq + Eq + Hash + Debug + Send + Sync + 'static,

Source§

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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoComptime for T

Source§

fn comptime(self) -> Self

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> RudaComptime for T
where T: Debug + Hash + Eq + Clone + Copy,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TuneInputs for T
where T: Clone + Send + Sync + 'static,

Source§

type At<'a> = T

The concrete input type at lifetime 'a.