Skip to content

Commit 30a518f

Browse files
committed
style: format for 2024 edition
Signed-off-by: YdrMaster <[email protected]>
1 parent 31d53ff commit 30a518f

File tree

70 files changed

+222
-210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+222
-210
lines changed

operators/src/add/args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{
2-
rank_mismatch, shape_mismatch, shape_not_support, utils::type_distinct, ConstPtr, Hardware,
3-
LaunchError, MutPtr, TensorLayout,
2+
ConstPtr, Hardware, LaunchError, MutPtr, TensorLayout, rank_mismatch, shape_mismatch,
3+
shape_not_support, utils::type_distinct,
44
};
55
use digit_layout::DigitLayout;
66
use itertools::izip;

operators/src/add/common_cpu/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use super::{args::Scheme, Add, Args};
2-
use crate::{common_cpu::Cpu, ByteOf, LaunchError, QueueAlloc};
1+
use super::{Add, Args, args::Scheme};
2+
use crate::{ByteOf, LaunchError, QueueAlloc, common_cpu::Cpu};
33
use digit_layout::types as ty;
44
use half::f16;
55
use rayon::iter::{IntoParallelIterator, ParallelIterator};

operators/src/add/cuda/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use super::{args::Scheme, Add, Args};
1+
use super::{Add, Args, args::Scheme};
22
use crate::{
3-
cuda::{dt_name, Gpu, Handle, ModuleBox},
3+
ByteOf, LaunchError, QueueAlloc, SchemeDiversity,
4+
cuda::{Gpu, Handle, ModuleBox, dt_name},
45
shape_not_support, strides_not_support,
56
utils::gcd,
6-
ByteOf, LaunchError, QueueAlloc, SchemeDiversity,
77
};
88
use cuda::params;
99
use digit_layout::DigitLayout;
@@ -110,8 +110,8 @@ mod test {
110110
use super::{Args, Gpu, Operator};
111111
use crate::{Hardware, Operator as _, TensorLayout};
112112
use digit_layout::{
113-
types::{F16, F64},
114113
DigitLayout,
114+
types::{F16, F64},
115115
};
116116

117117
fn args<H: Hardware>(

operators/src/add_rows/args.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::{
2-
type_not_support,
2+
ConstPtr, Hardware, LaunchError, MutPtr, TensorLayout, type_not_support,
33
utils::{dim_distinct, rank_error, type_distinct},
4-
ConstPtr, Hardware, LaunchError, MutPtr, TensorLayout,
54
};
65
use digit_layout::{DigitLayout, LayoutContent::Unsigned};
76
use std::ptr::{null, null_mut};

operators/src/add_rows/common_cpu/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use super::{args::Meta, AddRows, Args};
2-
use crate::{common_cpu::Cpu, ByteOf, LaunchError, QueueAlloc, Unsigned};
1+
use super::{AddRows, Args, args::Meta};
2+
use crate::{ByteOf, LaunchError, QueueAlloc, Unsigned, common_cpu::Cpu};
33
use digit_layout::types as ty;
44
use half::f16;
55
use rayon::iter::{IntoParallelIterator, ParallelIterator};

operators/src/add_rows/cuda/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use super::{AddRows, Args};
22
use crate::{
3+
ByteOf, LaunchError, QueueAlloc, SchemeDiversity,
34
add_rows::args::Meta,
4-
cuda::{dt_name, Gpu, Handle, ModuleBox},
5+
cuda::{Gpu, Handle, ModuleBox, dt_name},
56
strides_not_support,
67
utils::gcd,
7-
ByteOf, LaunchError, QueueAlloc, SchemeDiversity,
88
};
99
use cuda::params;
1010
use digit_layout::DigitLayout;
@@ -144,11 +144,11 @@ extern "C" __global__ void {name}(
144144
#[cfg(test)]
145145
mod test {
146146
use super::{Args, Gpu, Operator};
147-
use crate::{cuda::cast_load, Hardware, Operator as _, TensorLayout};
147+
use crate::{Hardware, Operator as _, TensorLayout, cuda::cast_load};
148148
use cuda::memcpy_d2h;
149149
use digit_layout::{
150-
types::{F16, F64, U32},
151150
DigitLayout,
151+
types::{F16, F64, U32},
152152
};
153153
use half::f16;
154154

operators/src/all_reduce/args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use super::ReduceOp;
1+
use super::ReduceOp;
22
use crate::{
3-
rearrange, shape_mismatch, strides_not_support, utils::type_distinct, Hardware, LaunchError,
3+
Hardware, LaunchError, rearrange, shape_mismatch, strides_not_support, utils::type_distinct,
44
};
55
use digit_layout::DigitLayout;
66

operators/src/all_reduce/common_cpu.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
use super::{args::Meta, AllReduce, Args, ReduceOp};
1+
use super::{AllReduce, Args, ReduceOp, args::Meta};
22
use crate::{
3+
ByteOf, LaunchError, QueueAlloc, TopoNode,
34
broadcast::{self, common_cpu::Operator as Broadcast},
45
common_cpu::{Cpu, InprocNode},
5-
rearrange, ByteOf, LaunchError, QueueAlloc, TopoNode,
6+
rearrange,
67
};
78
use digit_layout::DigitLayout;
89
use half::{bf16, f16};
@@ -138,7 +139,7 @@ fn sum<T: AddAssign + Clone>(len: usize, buf: *mut u8, src: *const u8) {
138139

139140
#[test]
140141
fn test_comm() {
141-
use crate::{common_cpu::ThisThread, Operator as _, TensorLayout};
142+
use crate::{Operator as _, TensorLayout, common_cpu::ThisThread};
142143
use digit_layout::types::U32;
143144

144145
InprocNode::new(4)

operators/src/all_reduce/infini.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use super::{args::Meta, AllReduce, Args, ReduceOp};
1+
use super::{AllReduce, Args, ReduceOp, args::Meta};
22
use crate::{
3+
ByteOf, LaunchError, QueueAlloc,
34
infini::{Device, InfiniNode},
45
rearrange::{self, infini::Operator as Rearrange},
5-
ByteOf, LaunchError, QueueAlloc,
66
};
77
use digit_layout::types as ty;
88
use infini_ccl::bindings::InfiniDataType_t;

operators/src/all_reduce/nccl.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
use super::{args::Meta, AllReduce, Args, ReduceOp};
1+
use super::{AllReduce, Args, ReduceOp, args::Meta};
22
use crate::{
3+
ByteOf, LaunchError, LaunchError, QueueAlloc,
34
cuda::{Gpu, NcclNode},
4-
rearrange, ByteOf, LaunchError, LaunchError, QueueAlloc,
5+
rearrange,
56
};
67
use std::{
78
slice::{from_raw_parts, from_raw_parts_mut},

0 commit comments

Comments
 (0)