-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
222 lines (194 loc) · 5.1 KB
/
Copy pathjustfile
File metadata and controls
222 lines (194 loc) · 5.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
TEST_FEATURES := "testing,cuda_13_3"
export RUSTFLAGS := "-Awarnings"
export CUDNN_LOGLEVEL_DBG := "0"
export CUDNN_LOGDEST_DBG := "stdout"
format:
just --fmt --unstable
cargo fmt
find ./ -iname *.proto | xargs clang-format -style=Google -i
prepare:
#!/usr/bin/env bash
set -euxo pipefail
crates=(
singe-cublas
singe-cublas-sys
singe-cuda
singe-cuda-sys
singe-curand
singe-curand-sys
singe-cufile
singe-cufile-sys
singe-cupti
singe-cupti-sys
singe-cudnn
singe-cudnn-sys
singe-cudss
singe-cudss-sys
singe-cufft
singe-cufft-sys
singe-cusolver
singe-cusolver-sys
singe-cusparse
singe-cusparse-sys
singe-cutensor
singe-cutensor-sys
singe-kernel
singe-nccl
singe-nccl-sys
singe-nvml
singe-nvml-sys
singe-npp
singe-npp-sys
)
for crate in "${crates[@]}"; do
mkdir -p "./${crate}/dist"
cp ./dist/katex_header.html "./${crate}/dist/"
done
generate:
#!/usr/bin/env bash
set -euxo pipefail
crates=(
singe-cublas-sys
singe-cuda-sys
singe-curand-sys
singe-cufile-sys
singe-cupti-sys
singe-cudnn-sys
singe-cudss-sys
singe-cufft-sys
singe-cusolver-sys
singe-cusparse-sys
singe-cutensor-sys
singe-nccl-sys
singe-nvml-sys
singe-npp-sys
)
for crate in "${crates[@]}"; do
(cd "./${crate}" && just generate)
done
cargo xtask gen-ptx-instructions
cargo xtask document
cargo xtask gen-cutile-dtype-kernels
cargo xtask gen-cutile-fused
cargo fmt
check:
#!/usr/bin/env bash
set -euxo pipefail
# cargo check --workspace --no-default-features
cargo check --workspace --features {{ TEST_FEATURES }}
cargo check --workspace --features {{ TEST_FEATURES }} --tests
cargo check --workspace --features {{ TEST_FEATURES }} --examples
[arg("fix", long="fix", value="true")]
lint fix="false":
#!/usr/bin/env bash
set -euxo pipefail
# cargo fmt --all -- --check
disallow=(
warnings
deprecated
# unsafe_code
# trivial_casts
# trivial_numeric_casts
# missing_docs
unused_extern_crates
unused_import_braces
unused_qualifications
clippy::clone_on_ref_ptr
clippy::all
clippy::correctness
clippy::suspicious
clippy::complexity
clippy::perf
clippy::style
# clippy::pedantic
# clippy::nursery
# clippy::missing_errors_doc
# clippy::missing_panics_doc
)
allow=(
missing_docs
clippy::missing_safety_doc
clippy::missing_panics_doc
clippy::missing_errors_doc
clippy::too_many_arguments
clippy::missing_const_for_fn
clippy::similar_names
clippy::type_complexity
)
if [ "{{ fix }}" = "true" ]; then
cargo clippy --workspace --features {{ TEST_FEATURES }} --fix --allow-dirty \
-- ${disallow[@]/#/-D } ${allow[@]/#/-A }
else
cargo clippy --workspace --features {{ TEST_FEATURES }} \
-- ${disallow[@]/#/-D } ${allow[@]/#/-A }
fi
test-prepare:
#!/usr/bin/env bash
set -euxo pipefail
cd singe-onnx/tests && uv run simple.py
test:
#!/usr/bin/env bash
set -euxo pipefail
RUST_TEST_THREADS=1 cargo test --workspace --lib --bins --tests --features {{ TEST_FEATURES }} -- --nocapture
RUST_TEST_THREADS=1 cargo test --workspace --doc --features {{ TEST_FEATURES }} -- --nocapture
docs:
cargo doc --workspace --all-features --no-deps
docs-open:
cargo doc --workspace --all-features --no-deps --open
docs-json:
#!/usr/bin/env bash
set -euo pipefail
packages=(
singe-cublas-sys
singe-cuda-sys
singe-cudnn-sys
singe-cudss-sys
singe-cufft-sys
singe-cufile-sys
singe-curand-sys
singe-cusolver-sys
singe-cusparse-sys
singe-cutensor-sys
singe-nccl-sys
singe-npp-sys
singe-nvml-sys
)
for package in "${packages[@]}"; do
cargo +nightly rustdoc -p "$package" --all-features -- -Z unstable-options --output-format json
done
clean:
#!/usr/bin/env bash
set -euxo pipefail
cargo clean
crates=(
singe-cublas
singe-cublas-sys
singe-cuda
singe-cuda-sys
singe-cufile
singe-cufile-sys
singe-cudnn
singe-cudnn-sys
singe-cudss
singe-cudss-sys
singe-cusolver
singe-cusolver-sys
singe-cupti
singe-cupti-sys
singe-cutensor
singe-cutensor-sys
singe-kernel
singe-nccl
singe-nccl-sys
singe-npp
singe-npp-sys
singe-nvml
singe-nvml-sys
singe-cusolver
singe-cusolver-sys
singe-cusparse
singe-cusparse-sys
)
for crate in "${crates[@]}"; do
(cd "./${crate}" && just -f justfile clean)
done