-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
104 lines (86 loc) · 3.13 KB
/
Copy pathMakefile
File metadata and controls
104 lines (86 loc) · 3.13 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
.DEFAULT_GOAL := build-cpu
# -----------------------------------------------------------------------------
# Real targets
# -----------------------------------------------------------------------------
node_modules: package-lock.json
npm ci
touch node_modules
package-lock.json: package.json
npm install --package-lock-only
# -----------------------------------------------------------------------------
# Phony targets
# -----------------------------------------------------------------------------
.PHONY: bench-cpu
bench-cpu:
cargo bench -p perception_bench_cpu --features cpu
.PHONY: bench-cuda
bench-cuda:
cargo bench -p perception_bench_cuda --features cuda
.PHONY: build-cpu
build-cpu:
cargo build --workspace
.PHONY: build-cuda
build-cuda:
cargo build --all-targets \
-p perception -p perception_backend_cuda -p perception_backend_cuda_test -p perception_bench_cuda -p perception_cli \
--features perception/cuda,perception_backend_cuda/cuda,perception_backend_cuda_test/cuda,perception_bench_cuda/cuda,perception_cli/cuda
.PHONY: clean
clean:
rm -rf node_modules
rm -rf target
.PHONY: clippy-cpu
clippy-cpu:
cargo clippy --workspace --all-targets --features perception_bench_cpu/cpu -- -D warnings
.PHONY: clippy-cuda
clippy-cuda:
cargo clippy --all-targets \
-p perception -p perception_backend_cuda -p perception_backend_cuda_test -p perception_bench_cuda -p perception_cli \
--features perception/cuda,perception_backend_cuda/cuda,perception_backend_cuda_test/cuda,perception_bench_cuda/cuda,perception_cli/cuda \
-- -D warnings
.PHONY: coverage-cpu
coverage-cpu: node_modules
cargo llvm-cov clean --workspace
cargo llvm-cov nextest --workspace --no-report
cargo llvm-cov report --json --output-path target/llvm-cov.json
cargo llvm-cov report --lcov --output-path target/lcov.info
cargo llvm-cov report
npx rust-coverage-check target/llvm-cov.json \
--workspace-root $(CURDIR) \
--gated perception_metric=100 \
--gated perception=100 \
--gated perception_cli=100 \
--gated perception_backend=100 \
--gated perception_backend_cpu=100 \
--gated perception_metric_bench=100 \
--gated perception_metric_bench_scenarios=100 \
--gated perception_metric_test=100 \
--gated perception_test=100
.PHONY: coverage-cuda
coverage-cuda: node_modules
cargo llvm-cov clean --workspace
cargo llvm-cov nextest -p perception_backend_cuda -p perception_backend_cuda_test \
--features perception_backend_cuda_test/cuda --no-report
cargo llvm-cov report --json --output-path target/llvm-cov-cuda.json
cargo llvm-cov report
npx rust-coverage-check target/llvm-cov-cuda.json \
--workspace-root $(CURDIR) \
--gated perception_backend_cuda=100 \
--gated perception_backend_cuda_test=100
.PHONY: coverage-clean
coverage-clean:
cargo llvm-cov clean --workspace
rm -rf target/llvm-cov-target
rm -f target/llvm-cov.json target/lcov.info
.PHONY: fmt
fmt:
cargo fmt --all
.PHONY: fmt-check
fmt-check:
cargo fmt --all -- --check
.PHONY: test-cpu
test-cpu:
cargo nextest run --workspace
.PHONY: test-cuda
test-cuda:
cargo nextest run -p perception_backend_cuda -p perception_backend_cuda_test \
--features perception_backend_cuda_test/cuda