File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
blog/2024-11-21-optimizing-matrix-mul
code/crates/cpu/matmul/src Expand file tree Collapse file tree 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 {
9191 use super :: * ;
9292 use crate :: backends:: wgpu:: MatrixMultiplier ;
9393
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 ) )
9696 }
9797}
9898
Original file line number Diff line number Diff line change @@ -154,21 +154,21 @@ impl GridComputation for Tiling1dLoop {
154154}
155155
156156/// GPU implementation of matrix multiplication with two-dimensional tiling.
157- pub struct Tiling2dSimd ;
157+ pub struct Tiling2d ;
158158
159- impl Display for Tiling2dSimd {
159+ impl Display for Tiling2d {
160160 fn fmt ( & self , f : & mut Formatter < ' _ > ) -> fmt:: Result {
161161 write ! ( f, "tiling_2d" )
162162 }
163163}
164164
165- impl Gpu for Tiling2dSimd {
165+ impl Gpu for Tiling2d {
166166 fn compiled_shader ( & self ) -> & [ u8 ] {
167167 compiled_tiling_2d:: SHADER_BINARY
168168 }
169169}
170170
171- impl GridComputation for Tiling2dSimd {
171+ impl GridComputation for Tiling2d {
172172 fn workgroup ( & self ) -> UVec3 {
173173 UVec3 :: new ( 16 , 16 , 1 )
174174 }
Original file line number Diff line number Diff line change @@ -293,7 +293,7 @@ tile).
293293
294294import { RustTiling2d } from './snippets/tiling_2d.tsx';
295295
296- <RustTiling2dSimd />
296+ <RustTiling2d />
297297
298298Each thread now calculates a 4x4 grid of the output matrix and we see a slight
299299improvement over the last kernel.
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import React from "react";
22import Snippet from "@site/src/components/Snippet" ;
33import RustKernelSource from "!!raw-loader!../code/crates/gpu/tiling_2d/src/lib.rs" ;
44
5- export const RustTiling2dSimd : React . FC = ( ) => (
5+ export const RustTiling2d : React . FC = ( ) => (
66 < Snippet language = "rust" className = "text-xs" title = "2D tiling kernel with Rust GPU" >
77 { RustKernelSource }
88 </ Snippet >
You can’t perform that action at this time.
0 commit comments