[workspace]
members = [".", "mnn-bridge", "mnn-sync", "mnn-sys", "tools/bencher"]
[workspace.package]
license = "Apache-2.0"
description = "Rust bindings for MNN, a lightweight deep neural network inference engine."
repository = "https://github.com/aftershootco/mnn-rs"
documentation = "https://docs.rs/mnn"

[package]
name = "mnn"
version = "0.2.0"
edition = "2024"
license = { workspace = true }
description = { workspace = true }
repository = { workspace = true }
documentation = { workspace = true }

[workspace.dependencies]
mnn = { version = "0.2.0", path = "." }
error-stack = { version = "0.5" }

[dependencies]
libc = "0.2"
mnn-sys = { version = "0.1", path = "mnn-sys", features = [] }
thiserror = "2.0"
error-stack.workspace = true
oneshot = "0.1"
tracing = { version = "0.1.40", optional = true }
dunce = "1.0.5"
serde = { version = "1.0", features = ["derive"], optional = true }

[features]
metal = ["mnn-sys/metal"]
coreml = ["mnn-sys/coreml"]
vulkan = ["mnn-sys/vulkan"]
opencl = ["mnn-sys/opencl"]
opengl = ["mnn-sys/opengl"]
crt_static = ["mnn-sys/crt_static"]
# Disable mnn-threadpool to enable this
openmp = ["mnn-sys/openmp"]
mnn-threadpool = ["mnn-sys/mnn-threadpool"]
tracing = ["dep:tracing"]
profile = ["tracing"]
serde = ["dep:serde"]

default = ["mnn-threadpool"]


[dev-dependencies]
anyhow = "1.0"
bytemuck = "1.17"
clap = { version = "4.5", features = ["derive"] }
divan = "0.1.14"
tracing = "0.1.40"
tracing-subscriber = "0.3.19"
tracing-test = { version = "0.2.5", features = ["no-env-filter"] }

[[bench]]
name = "mnn-bench"
harness = false

[profile.rwd]
debug = true
inherits = "release"
