Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielsimard committed Nov 27, 2024
1 parent 6b12ca0 commit 341963a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/cubecl-linalg/src/matmul/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub fn launch_ref<R: Runtime, EG: Float>(
}
Strategy::Simple => simple::launch_ref::<R, EG>(client, lhs, rhs, out),
Strategy::Auto => {
if let Err(_) = matmul::launch_ref::<R, EG>(client, lhs, rhs, out, false) {
if matmul::launch_ref::<R, EG>(client, lhs, rhs, out, false).is_err() {
tiling2d::launch_ref::<R, EG>(client, lhs, rhs, out, Tiling2dConfig::default())
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/cubecl-linalg/src/matmul/kernels/cmma_old/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ pub fn matmul_cmma_ref<R: Runtime, F: Float>(
MatrixLayout::HighlyPermuted => false,
};

let lhs_correct_layout = check_layout(&lhs);
let rhs_correct_layout = check_layout(&rhs);
let lhs_correct_layout = check_layout(lhs);
let rhs_correct_layout = check_layout(rhs);

match (lhs_correct_layout, rhs_correct_layout) {
(true, true) => matmul_cmma_ref_no_check::<R, F>(client, lhs, rhs, out, cmma_config),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub trait Algorithm<EG: Numeric> {

fn cube_dim() -> CubeDim;
fn cube_count(problem: &MatmulProblem) -> CubeCount;

#[allow(clippy::type_complexity)]
fn make_config(
problem: &MatmulProblem,
cube_dim: &CubeDim,
Expand Down
4 changes: 2 additions & 2 deletions crates/cubecl-linalg/src/matmul/kernels/matmul/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ pub fn launch_ref<R: Runtime, EG: Numeric>(
MatrixLayout::HighlyPermuted => (true, false),
};

let (lhs_make_contiguous, lhs_transposed) = check_layout(&lhs);
let (rhs_make_contiguous, rhs_transposed) = check_layout(&rhs);
let (lhs_make_contiguous, lhs_transposed) = check_layout(lhs);
let (rhs_make_contiguous, rhs_transposed) = check_layout(rhs);

match (lhs_make_contiguous, rhs_make_contiguous) {
(false, false) => matmul_cmma_ref_no_check::<R, EG>(
Expand Down
4 changes: 2 additions & 2 deletions crates/cubecl-linalg/src/matmul/kernels/tiling2d/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ pub fn matmul_tiling_2d_ref<R: Runtime, F: Float>(
} => true,
MatrixLayout::HighlyPermuted => false,
};
let lhs_correct_layout = check_layout(&lhs);
let rhs_correct_layout = check_layout(&rhs);
let lhs_correct_layout = check_layout(lhs);
let rhs_correct_layout = check_layout(rhs);

match (lhs_correct_layout, rhs_correct_layout) {
(true, true) => matmul_tiling_2d_ref_no_check::<R, F>(client, lhs, rhs, out, config),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ where

let cube_dim = A::cube_dim();
let cube_count = A::cube_count(&problem);
let config = A::make_config(&problem, &cube_dim, &cube_count, &A::advanced_config());
let config = A::make_config(&problem, &cube_dim, &cube_count, &A::advanced_config()).unwrap();

unsafe {
A::BatchMatmul::launch_unchecked(
Expand Down

0 comments on commit 341963a

Please sign in to comment.