15
15
//! 16,
16
16
//! 16,
17
17
//! 16,
18
- //! cmma::MatrixLayout::ColMajor ,
18
+ //! cmma::MatrixLayout::RowMajor ,
19
19
//! );
20
20
//! let b = cmma::Matrix::<F16>::new(
21
21
//! cmma::MatrixIdent::B,
22
22
//! 16,
23
23
//! 16,
24
24
//! 16,
25
- //! cmma::MatrixLayout::RowMajor ,
25
+ //! cmma::MatrixLayout::ColMajor ,
26
26
//! );
27
27
//! let c = cmma::Matrix::<F32>::new(
28
28
//! cmma::MatrixIdent::Accumulator,
32
32
//! cmma::MatrixLayout::Undefined,
33
33
//! );
34
34
//! cmma::fill::<F32>(&c, F32::new(0.0));
35
- //! cmma::load::<F16>(&a, lhs, UInt::new(16));
36
- //! cmma::load::<F16>(&b, rhs, UInt::new(16));
35
+ //! cmma::load::<F16>(&a, lhs.as_slice() , UInt::new(16));
36
+ //! cmma::load::<F16>(&b, rhs.as_slice() , UInt::new(16));
37
37
//!
38
38
//! cmma::execute::<F16, F16, F32, F32>(&a, &b, &c, &c);
39
39
//!
40
- //! cmma::store::<F32>(out, &c, UInt::new(16), cmma::MatrixLayout::RowMajor);
40
+ //! cmma::store::<F32>(
41
+ //! out.as_slice_mut(),
42
+ //! &c,
43
+ //! UInt::new(16),
44
+ //! cmma::MatrixLayout::RowMajor,
45
+ //! );
41
46
//! }
42
47
//! ```
43
48
@@ -49,7 +54,8 @@ use crate::{
49
54
} ;
50
55
51
56
use super :: {
52
- Array , CubeContext , CubePrimitive , CubeType , ExpandElement , ExpandElementTyped , Init , UInt ,
57
+ CubeContext , CubePrimitive , CubeType , ExpandElement , ExpandElementTyped , Init , Slice , SliceMut ,
58
+ UInt ,
53
59
} ;
54
60
55
61
pub use ir:: { MatrixIdent , MatrixLayout } ;
@@ -137,7 +143,7 @@ pub fn fill_expand<C: CubeType>(
137
143
138
144
/// Load the matrix with the provided array using the stride.
139
145
#[ allow( unused_variables) ]
140
- pub fn load < C : CubeType > ( mat : & Matrix < C > , value : & Array < C > , stride : UInt ) {
146
+ pub fn load < C : CubeType > ( mat : & Matrix < C > , value : & Slice < ' _ , C > , stride : UInt ) {
141
147
unexpanded ! ( )
142
148
}
143
149
@@ -146,7 +152,7 @@ pub fn load<C: CubeType>(mat: &Matrix<C>, value: &Array<C>, stride: UInt) {
146
152
pub fn load_expand < C : CubeType > (
147
153
context : & mut CubeContext ,
148
154
mat : MatrixExpand ,
149
- value : ExpandElementTyped < Array < C > > ,
155
+ value : ExpandElementTyped < Slice < ' static , C > > ,
150
156
stride : ExpandElement ,
151
157
) {
152
158
context. register ( Operation :: CoopMma ( ir:: CoopMma :: Load {
@@ -159,7 +165,7 @@ pub fn load_expand<C: CubeType>(
159
165
/// Store the matrix in the given array following the given stride and layout.
160
166
#[ allow( unused_variables) ]
161
167
pub fn store < C : CubePrimitive > (
162
- output : & Array < C > ,
168
+ output : & mut SliceMut < ' _ , C > ,
163
169
mat : & Matrix < C > ,
164
170
stride : UInt ,
165
171
layout : MatrixLayout ,
@@ -171,7 +177,7 @@ pub fn store<C: CubePrimitive>(
171
177
#[ allow( unused_variables) ]
172
178
pub fn store_expand < C : CubePrimitive > (
173
179
context : & mut CubeContext ,
174
- output : ExpandElementTyped < Array < C > > ,
180
+ output : ExpandElementTyped < SliceMut < ' static , C > > ,
175
181
mat : MatrixExpand ,
176
182
stride : ExpandElement ,
177
183
layout : MatrixLayout ,
0 commit comments