File tree 4 files changed +8
-8
lines changed
blog/2024-11-21-optimizing-matrix-mul
code/crates/cpu/matmul/src
4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -91,8 +91,8 @@ pub mod tiling_2d {
91
91
use super :: * ;
92
92
use crate :: backends:: wgpu:: MatrixMultiplier ;
93
93
94
- pub fn wgpu ( ) -> MatrixMultiplier < variants:: Tiling2dSimd > {
95
- futures:: executor:: block_on ( MatrixMultiplier :: new ( variants:: Tiling2dSimd ) )
94
+ pub fn wgpu ( ) -> MatrixMultiplier < variants:: Tiling2d > {
95
+ futures:: executor:: block_on ( MatrixMultiplier :: new ( variants:: Tiling2d ) )
96
96
}
97
97
}
98
98
Original file line number Diff line number Diff line change @@ -154,21 +154,21 @@ impl GridComputation for Tiling1dLoop {
154
154
}
155
155
156
156
/// GPU implementation of matrix multiplication with two-dimensional tiling.
157
- pub struct Tiling2dSimd ;
157
+ pub struct Tiling2d ;
158
158
159
- impl Display for Tiling2dSimd {
159
+ impl Display for Tiling2d {
160
160
fn fmt ( & self , f : & mut Formatter < ' _ > ) -> fmt:: Result {
161
161
write ! ( f, "tiling_2d" )
162
162
}
163
163
}
164
164
165
- impl Gpu for Tiling2dSimd {
165
+ impl Gpu for Tiling2d {
166
166
fn compiled_shader ( & self ) -> & [ u8 ] {
167
167
compiled_tiling_2d:: SHADER_BINARY
168
168
}
169
169
}
170
170
171
- impl GridComputation for Tiling2dSimd {
171
+ impl GridComputation for Tiling2d {
172
172
fn workgroup ( & self ) -> UVec3 {
173
173
UVec3 :: new ( 16 , 16 , 1 )
174
174
}
Original file line number Diff line number Diff line change @@ -293,7 +293,7 @@ tile).
293
293
294
294
import { RustTiling2d } from './snippets/tiling_2d.tsx';
295
295
296
- <RustTiling2dSimd />
296
+ <RustTiling2d />
297
297
298
298
Each thread now calculates a 4x4 grid of the output matrix and we see a slight
299
299
improvement over the last kernel.
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import React from "react";
2
2
import Snippet from "@site/src/components/Snippet" ;
3
3
import RustKernelSource from "!!raw-loader!../code/crates/gpu/tiling_2d/src/lib.rs" ;
4
4
5
- export const RustTiling2dSimd : React . FC = ( ) => (
5
+ export const RustTiling2d : React . FC = ( ) => (
6
6
< Snippet language = "rust" className = "text-xs" title = "2D tiling kernel with Rust GPU" >
7
7
{ RustKernelSource }
8
8
</ Snippet >
You can’t perform that action at this time.
0 commit comments