Skip to content
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

Fix Clippy + CI #321

Merged
merged 3 commits into from
Nov 28, 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
2 changes: 1 addition & 1 deletion crates/cubecl-core/src/codegen/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ where
}
}

impl<'h, 'a, 'b, 'c, K, R, E1, E2, E3> Execution<'h, K, R, (&'a [E1], &'b [E2], &'c [E3])>
impl<K, R, E1, E2, E3> Execution<'_, K, R, (&[E1], &[E2], &[E3])>
where
K: Kernel + 'static,
R: Runtime,
Expand Down
1 change: 0 additions & 1 deletion crates/cubecl-core/src/compute/kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use cubecl_runtime::ExecutionMode;
/// A kernel, compiled in the target language
pub struct CompiledKernel<C: Compiler> {
/// The name of the kernel entrypoint.

/// For example
///
/// ```text
Expand Down
2 changes: 1 addition & 1 deletion crates/cubecl-core/src/frontend/container/array/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub enum ArrayArg<'a, R: Runtime> {
},
}

impl<'a, R: Runtime> ArgSettings<R> for ArrayArg<'a, R> {
impl<R: Runtime> ArgSettings<R> for ArrayArg<'_, R> {
fn register(&self, launcher: &mut KernelLauncher<R>) {
launcher.register_array(self)
}
Expand Down
4 changes: 2 additions & 2 deletions crates/cubecl-core/src/frontend/container/sequence/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct SequenceArg<'a, R: Runtime, T: LaunchArg> {
pub values: Vec<T::RuntimeArg<'a, R>>,
}

impl<'a, R: Runtime, T: LaunchArg> Default for SequenceArg<'a, R, T> {
impl<R: Runtime, T: LaunchArg> Default for SequenceArg<'_, R, T> {
fn default() -> Self {
Self::new()
}
Expand Down Expand Up @@ -72,7 +72,7 @@ impl<C: LaunchArg> LaunchArg for Sequence<C> {
}
}

impl<'a, R: Runtime, T: LaunchArg> ArgSettings<R> for SequenceArg<'a, R, T> {
impl<R: Runtime, T: LaunchArg> ArgSettings<R> for SequenceArg<'_, R, T> {
fn register(&self, launcher: &mut crate::prelude::KernelLauncher<R>) {
self.values.iter().for_each(|arg| arg.register(launcher));
}
Expand Down
4 changes: 2 additions & 2 deletions crates/cubecl-core/src/frontend/container/tensor/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct TensorHandleRef<'a, R: Runtime> {
pub runtime: PhantomData<R>,
}

impl<'a, R: Runtime> core::fmt::Debug for TensorHandleRef<'a, R> {
impl<R: Runtime> core::fmt::Debug for TensorHandleRef<'_, R> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
writeln!(
f,
Expand Down Expand Up @@ -153,7 +153,7 @@ impl<'a, R: Runtime> TensorArg<'a, R> {
}
}

impl<'a, R: Runtime> ArgSettings<R> for TensorArg<'a, R> {
impl<R: Runtime> ArgSettings<R> for TensorArg<'_, R> {
fn register(&self, launcher: &mut KernelLauncher<R>) {
launcher.register_tensor(self)
}
Expand Down
3 changes: 3 additions & 0 deletions crates/cubecl-core/src/frontend/element/float/tensor_float.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#![allow(clippy::transmute_int_to_float)] // Not yet stable in previous version. To be removed when
#![allow(clippy::transmute_float_to_int)] // prev=1.83.

use bytemuck::{Pod, Zeroable};
use core::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign};
use half::f16;
Expand Down
2 changes: 1 addition & 1 deletion crates/cubecl-cpp/src/shared/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ struct EnsureBoolArg<'a, V: Display, D: Dialect> {
elem: &'a Elem<D>,
}

impl<'a, V: Display, D: Dialect> Display for EnsureBoolArg<'a, V, D> {
impl<V: Display, D: Dialect> Display for EnsureBoolArg<'_, V, D> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if self.elem != &Elem::Bool {
write!(f, "bool({})", self.var)
Expand Down
2 changes: 2 additions & 0 deletions crates/cubecl-linalg/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::manual_div_ceil)]

/// Contains matmul kernels and Cube components
pub mod matmul;

Expand Down