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>
impl<C: CubePrimitive> Matrix<C>
sourcepub fn new(
ident: MatrixIdent,
m: u32,
n: u32,
k: u32,
layout: MatrixLayout,
) -> Self
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.
- MatrixIdent::A Shape => (M, K)
- MatrixIdent::B Shape => (K, N)
- MatrixIdent::Accumulator Shape => (M, N)
Not all shapes are supported, and the permitted shapes depend on the element type.
Refer to nvidia documentation.
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: CubeType> CubeType for Matrix<C>
impl<C: CubeType> CubeType for Matrix<C>
type ExpandType = MatrixExpand
source§fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType
fn init(context: &mut CubeContext, expand: Self::ExpandType) -> Self::ExpandType
Wrapper around the init method, necesary to type inference.
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> 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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)