|  | 
| 1 | 1 | [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 | 
| 9 | 9 | 
 | 
| 10 | 10 | [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 | 
| 13 | 15 | 
 | 
| 14 | 16 | [features] | 
| 15 |  | -default = [] | 
|  | 17 | +default = []                          # No features enabled by default | 
| 16 | 18 | 
 | 
| 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. | 
| 23 | 28 | docs = [ | 
| 24 | 29 |     "rv110x", | 
| 25 | 30 |     "rk2118", | 
| 26 | 31 |     "rk35xx", | 
| 27 | 32 |     "rk3576", | 
| 28 | 33 |     "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). | 
| 30 | 38 | libloading = ["rknpu2-sys/libloading"] | 
| 31 | 39 | 
 | 
| 32 | 40 | [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 | 
| 35 | 43 | 
 | 
| 36 | 44 | [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