Struct cubecl_core::frontend::cmma::Matrix

source ·
pub struct Matrix<C: CubeType> { /* private fields */ }
Expand description

A matrix represent a 2D grid of numbers.

They can either be in a row major or a column major format.

Implementations§

source§

impl<C: CubePrimitive> Matrix<C>

source

pub fn new( ident: MatrixIdent, m: u32, n: u32, k: u32, layout: MatrixLayout, ) -> Self

Create a new matrix that is going to be used in the matrix-multiply and accumulate function.

You have to declare the shape used for the execution. The shape of the current matrix is determined using the MatrixIdent.

Not all shapes are supported, and the permitted shapes depend on the element type.

Refer to nvidia documentation.

source

pub fn __expand_new( context: &mut CubeContext, ident: MatrixIdent, m: ExpandElementTyped<UInt>, n: ExpandElementTyped<UInt>, k: ExpandElementTyped<UInt>, layout: MatrixLayout, ) -> MatrixExpand

Trait Implementations§

source§

impl<C: Clone + CubeType> Clone for Matrix<C>

source§

fn clone(&self) -> Matrix<C>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<C: CubeType> CubeType for Matrix<C>

§

type ExpandType = MatrixExpand

source§

fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType

Wrapper around the init method, necesary to type inference.
source§

impl<C: Copy + CubeType> Copy for Matrix<C>

Auto Trait Implementations§

§

impl<C> Freeze for Matrix<C>

§

impl<C> RefUnwindSafe for Matrix<C>
where C: RefUnwindSafe,

§

impl<C> Send for Matrix<C>
where C: Send,

§

impl<C> Sync for Matrix<C>
where C: Sync,

§

impl<C> Unpin for Matrix<C>
where C: Unpin,

§

impl<C> UnwindSafe for Matrix<C>
where C: UnwindSafe,

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> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

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

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

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
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> ToOwned for T
where T: Clone,

§

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V