Skip to content

Commit f5f9f3f

Browse files
Merge pull request #9 from CodeVoyager15/CodeVoyager15-patch-916-1
Add annotated comments to Cargo.toml for clarity
2 parents a7eb3ce + 9f8c5fe commit f5f9f3f

File tree

1 file changed

+30
-21
lines changed

1 file changed

+30
-21
lines changed

crates/rknpu2/Cargo.toml

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,47 @@
11
[package]
2-
name = "rknpu2"
3-
version = "0.0.7"
4-
edition = "2024"
5-
description = "Unofficial bindings to rknpu2 (librknnrt and librknnmrt)"
6-
repository = "https://github.com/boundarybitlabs/rknpu2-rs"
7-
license = "MIT OR Apache-2.0"
8-
documentation = "https://docs.rs/rknpu2"
2+
name = "rknpu2" # Crate name (used in Cargo and crates.io)
3+
version = "0.0.7" # Crate version
4+
edition = "2024" # Rust edition to use (2024 edition features)
5+
description = "Unofficial bindings..."# Short summary shown on crates.io
6+
repository = "https://github.com/..." # Source code repository
7+
license = "MIT OR Apache-2.0" # Dual license, common for Rust projects
8+
documentation = "https://docs.rs/..." # Auto-generated documentation on docs.rs
99

1010
[dependencies]
11-
half = { workspace = true }
12-
rknpu2-sys = "0.0.1"
11+
half = { workspace = true } # Use the 'half' crate (for f16 floats),
12+
# but pull version from workspace root
13+
rknpu2-sys = "0.0.1" # Low-level FFI bindings to Rockchip's
14+
# rknnrt and rknnmrt C libraries
1315

1416
[features]
15-
default = []
17+
default = [] # No features enabled by default
1618

17-
rv110x = ["rknpu2-sys/rv110x"] # For RV1103 / RV1106 / B variants
18-
rk2118 = ["rknpu2-sys/rk2118"] # For RK2118
19-
rk35xx = ["rknpu2-sys/rk35xx"] # For RK356x / RV1126B
20-
rk3576 = [
21-
"rknpu2-sys/rk3576",
22-
] # For RK3576 / RK3588 with full multi-core support
19+
# Feature flags for selecting which Rockchip NPU chip family to target.
20+
rv110x = ["rknpu2-sys/rv110x"] # For RV1103 / RV1106 / B series chips
21+
rk2118 = ["rknpu2-sys/rk2118"] # For RK2118 chips
22+
rk35xx = ["rknpu2-sys/rk35xx"] # For RK356x / RV1126B chips
23+
rk3576 = ["rknpu2-sys/rk3576"] # For RK3576 / RK3588 with full multi-core NPU
24+
25+
# A "meta feature" used only when building documentation on docs.rs.
26+
# It enables all chip features + libloading, so that the docs show the full API,
27+
# regardless of which chip a user is actually building for.
2328
docs = [
2429
"rv110x",
2530
"rk2118",
2631
"rk35xx",
2732
"rk3576",
2833
"libloading",
29-
] # Requires nightly compiler
34+
]
35+
36+
# Optional feature to load NPU libraries dynamically at runtime
37+
# (via the libloading crate, re-exposed by rknpu2-sys).
3038
libloading = ["rknpu2-sys/libloading"]
3139

3240
[dev-dependencies]
33-
image = "0.25.6"
34-
itertools = "0.14.0"
41+
image = "0.25.6" # Used in tests/examples for working with images
42+
itertools = "0.14.0" # Extra iterator utilities for test/example code
3543

3644
[package.metadata.docs.rs]
37-
features = ["docs"]
38-
rustc-args = ["--cfg", "docsrs"]
45+
features = ["docs"] # When building on docs.rs, enable the `docs` feature
46+
rustc-args = ["--cfg", "docsrs"] # Pass a compiler cfg flag (`docsrs`) so the crate
47+
# can detect it’s being built for docs.rs

0 commit comments

Comments
 (0)