diff --git a/blog/2024-11-21-optimizing-matrix-mul/code/crates/cpu/matmul/src/lib.rs b/blog/2024-11-21-optimizing-matrix-mul/code/crates/cpu/matmul/src/lib.rs index 7e3f0ad..7dde951 100644 --- a/blog/2024-11-21-optimizing-matrix-mul/code/crates/cpu/matmul/src/lib.rs +++ b/blog/2024-11-21-optimizing-matrix-mul/code/crates/cpu/matmul/src/lib.rs @@ -91,8 +91,8 @@ pub mod tiling_2d { use super::*; use crate::backends::wgpu::MatrixMultiplier; - pub fn wgpu() -> MatrixMultiplier { - futures::executor::block_on(MatrixMultiplier::new(variants::Tiling2dSimd)) + pub fn wgpu() -> MatrixMultiplier { + futures::executor::block_on(MatrixMultiplier::new(variants::Tiling2d)) } } diff --git a/blog/2024-11-21-optimizing-matrix-mul/code/crates/cpu/matmul/src/variants.rs b/blog/2024-11-21-optimizing-matrix-mul/code/crates/cpu/matmul/src/variants.rs index 9fd3159..727e880 100644 --- a/blog/2024-11-21-optimizing-matrix-mul/code/crates/cpu/matmul/src/variants.rs +++ b/blog/2024-11-21-optimizing-matrix-mul/code/crates/cpu/matmul/src/variants.rs @@ -154,21 +154,21 @@ impl GridComputation for Tiling1dLoop { } /// GPU implementation of matrix multiplication with two-dimensional tiling. -pub struct Tiling2dSimd; +pub struct Tiling2d; -impl Display for Tiling2dSimd { +impl Display for Tiling2d { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "tiling_2d") } } -impl Gpu for Tiling2dSimd { +impl Gpu for Tiling2d { fn compiled_shader(&self) -> &[u8] { compiled_tiling_2d::SHADER_BINARY } } -impl GridComputation for Tiling2dSimd { +impl GridComputation for Tiling2d { fn workgroup(&self) -> UVec3 { UVec3::new(16, 16, 1) } diff --git a/blog/2024-11-21-optimizing-matrix-mul/index.md b/blog/2024-11-21-optimizing-matrix-mul/index.md index 2a7d660..96235d4 100644 --- a/blog/2024-11-21-optimizing-matrix-mul/index.md +++ b/blog/2024-11-21-optimizing-matrix-mul/index.md @@ -293,7 +293,7 @@ tile). import { RustTiling2d } from './snippets/tiling_2d.tsx'; - + Each thread now calculates a 4x4 grid of the output matrix and we see a slight improvement over the last kernel. diff --git a/blog/2024-11-21-optimizing-matrix-mul/snippets/tiling_2d.tsx b/blog/2024-11-21-optimizing-matrix-mul/snippets/tiling_2d.tsx index 83732d8..bea0bc3 100644 --- a/blog/2024-11-21-optimizing-matrix-mul/snippets/tiling_2d.tsx +++ b/blog/2024-11-21-optimizing-matrix-mul/snippets/tiling_2d.tsx @@ -2,7 +2,7 @@ import React from "react"; import Snippet from "@site/src/components/Snippet"; import RustKernelSource from "!!raw-loader!../code/crates/gpu/tiling_2d/src/lib.rs"; -export const RustTiling2dSimd: React.FC = () => ( +export const RustTiling2d: React.FC = () => ( {RustKernelSource}