Skip to content

Commit

Permalink
Cleanup error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielsimard committed Nov 27, 2024
1 parent 341963a commit 0903201
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions crates/cubecl-linalg/src/matmul/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,19 @@ pub fn launch_ref<R: Runtime, EG: Float>(
}
Strategy::Simple => simple::launch_ref::<R, EG>(client, lhs, rhs, out),
Strategy::Auto => {
if matmul::launch_ref::<R, EG>(client, lhs, rhs, out, false).is_err() {
tiling2d::launch_ref::<R, EG>(client, lhs, rhs, out, Tiling2dConfig::default())
if let Err(err) = matmul::launch_ref::<R, EG>(client, lhs, rhs, out, false) {
match err {
super::kernels::MatmulLaunchError::Unavailable(_) => {
tiling2d::launch_ref::<R, EG>(
client,
lhs,
rhs,
out,
Tiling2dConfig::default(),
)
}
_ => panic!("{err:?}"),
}
}
}
};
Expand Down

0 comments on commit 0903201

Please sign in to comment.