Skip to content

Fix some comments #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::fmt::Formatter;
use tracing::trace;
use wgpu::{self, util::DeviceExt};

/// Struct responsible for performing matrix multiplication on the GPU.
/// Matrix multiplication on the GPU using `wgpu`.
pub struct MatrixMultiplier<T> {
device: wgpu::Device,
queue: wgpu::Queue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::future::Future;
mod backends;
pub mod variants;

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

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