Skip to content

Commit 4018110

Browse files
committed
Fix some comments
1 parent 337f76a commit 4018110

File tree

2 files changed

+3
-2
lines changed
  • blog/2024-11-21-optimizing-matrix-mul/code/crates/cpu/matmul/src

2 files changed

+3
-2
lines changed

blog/2024-11-21-optimizing-matrix-mul/code/crates/cpu/matmul/src/backends/wgpu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::fmt::Formatter;
99
use tracing::trace;
1010
use wgpu::{self, util::DeviceExt};
1111

12-
/// Struct responsible for performing matrix multiplication on the GPU.
12+
/// Matrix multiplication on the GPU using `wgpu`.
1313
pub struct MatrixMultiplier<T> {
1414
device: wgpu::Device,
1515
queue: wgpu::Queue,

blog/2024-11-21-optimizing-matrix-mul/code/crates/cpu/matmul/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use std::future::Future;
88
mod backends;
99
pub mod variants;
1010

11+
/// The trait that defines how to multiply two matrices.
1112
pub trait MatrixMultiply<T>: Display {
1213
fn new(variant: T) -> impl Future<Output = Self> + Send;
1314
fn multiply(&self, a: &[f32], b: &[f32], m: u32, k: u32, n: u32) -> Vec<f32>;
@@ -25,7 +26,7 @@ pub trait Cpu {
2526
);
2627
}
2728

28-
/// Matrix multiplication logic that can be run on the CPU.
29+
/// Matrix multiplication logic that can be run on the GPU.
2930
pub trait Gpu {
3031
fn compiled_shader(&self) -> &[u8];
3132
fn entry_point(&self) -> &'static str {

0 commit comments

Comments
 (0)