Skip to content

Commit

Permalink
Clippy fixes for the cuda feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentMazare committed Nov 29, 2024
1 parent 54e7fc3 commit bb9fdda
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions candle-core/src/cuda_backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ impl Map1 for Powf {
}

struct FastReduce<'a>(&'a [usize], ReduceOp);
impl<'a> Map1Any for FastReduce<'a> {
impl Map1Any for FastReduce<'_> {
fn f<T: DeviceRepr + WithDType + ValidAsZeroBits, W: Fn(CudaSlice<T>) -> S>(
&self,
src: &CudaSlice<T>,
Expand Down Expand Up @@ -350,7 +350,7 @@ impl<U: UnaryOpT> Map1 for U {
}

struct IndexSelect<'a>(&'a CudaStorage, &'a Layout, usize);
impl<'a> Map1 for IndexSelect<'a> {
impl Map1 for IndexSelect<'_> {
fn f<T: DeviceRepr + WithDType + ValidAsZeroBits>(
&self,
src: &CudaSlice<T>,
Expand Down Expand Up @@ -410,7 +410,7 @@ impl<'a> Map1 for IndexSelect<'a> {
}

struct Gather<'a>(&'a CudaStorage, &'a Layout, usize);
impl<'a> Map1 for Gather<'a> {
impl Map1 for Gather<'_> {
fn f<T: DeviceRepr + WithDType + ValidAsZeroBits>(
&self,
src: &CudaSlice<T>,
Expand Down Expand Up @@ -461,7 +461,7 @@ impl<'a> Map1 for Gather<'a> {
}

struct IndexAdd<'a>(&'a CudaStorage, &'a Layout, usize);
impl<'a> Map2InPlace for IndexAdd<'a> {
impl Map2InPlace for IndexAdd<'_> {
fn f<T: DeviceRepr + WithDType + ValidAsZeroBits>(
&self,
dst: &mut CudaSlice<T>,
Expand Down Expand Up @@ -509,7 +509,7 @@ impl<'a> Map2InPlace for IndexAdd<'a> {
}

struct ScatterAdd<'a>(&'a CudaStorage, &'a Layout, usize);
impl<'a> Map2InPlace for ScatterAdd<'a> {
impl Map2InPlace for ScatterAdd<'_> {
fn f<T: DeviceRepr + WithDType + ValidAsZeroBits>(
&self,
dst: &mut CudaSlice<T>,
Expand Down Expand Up @@ -554,7 +554,7 @@ impl<'a> Map2InPlace for ScatterAdd<'a> {
}

struct Conv1D<'a>(&'a crate::conv::ParamsConv1D);
impl<'a> Map2 for Conv1D<'a> {
impl Map2 for Conv1D<'_> {
fn f<T: DeviceRepr + WithDType + ValidAsZeroBits>(
&self,
inp: &CudaSlice<T>,
Expand Down Expand Up @@ -595,7 +595,7 @@ impl<'a> Map2 for Conv1D<'a> {
}

struct Conv2D<'a>(&'a crate::conv::ParamsConv2D);
impl<'a> Map2 for Conv2D<'a> {
impl Map2 for Conv2D<'_> {
fn f<T: DeviceRepr + WithDType + ValidAsZeroBits>(
&self,
inp: &CudaSlice<T>,
Expand Down Expand Up @@ -660,7 +660,7 @@ impl Map1 for Col2Im1D {
}

struct ConvTranspose1D<'a>(&'a crate::conv::ParamsConvTranspose1D);
impl<'a> Map2 for ConvTranspose1D<'a> {
impl Map2 for ConvTranspose1D<'_> {
fn f<T: DeviceRepr + WithDType + ValidAsZeroBits>(
&self,
inp: &CudaSlice<T>,
Expand Down Expand Up @@ -709,7 +709,7 @@ impl<'a> Map2 for ConvTranspose1D<'a> {
}

struct ConvTranspose2D<'a>(&'a crate::conv::ParamsConvTranspose2D);
impl<'a> Map2 for ConvTranspose2D<'a> {
impl Map2 for ConvTranspose2D<'_> {
fn f<T: DeviceRepr + WithDType + ValidAsZeroBits>(
&self,
inp: &CudaSlice<T>,
Expand Down Expand Up @@ -850,7 +850,7 @@ impl Map1 for UpsampleNearest2D {
}

struct WhereCond<'a>(&'a CudaStorage, &'a Layout);
impl<'a> Map2 for WhereCond<'a> {
impl Map2 for WhereCond<'_> {
fn f<T: DeviceRepr + WithDType + ValidAsZeroBits>(
&self,
t: &CudaSlice<T>,
Expand Down
2 changes: 1 addition & 1 deletion candle-core/src/quantized/cuda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub const CUDA_DEQUANTIZE_BLOCK_SIZE: usize = 256;
pub const MATRIX_ROW_PADDING: usize = 512;

fn ceil_div(p: usize, q: usize) -> usize {
(p + q - 1) / q
p.div_ceil(q)
}

fn pad(p: usize, q: usize) -> usize {
Expand Down

0 comments on commit bb9fdda

Please sign in to comment.