[workspace]
members = [".", "echidna-optim"]

[package]
name = "echidna"
version = "0.13.0"
edition = "2021"
rust-version = "1.93"
description = "A high-performance automatic differentiation library for Rust"
license = "MIT OR Apache-2.0"
repository = "https://github.com/Entrolution/echidna"
documentation = "https://docs.rs/echidna"
readme = "README.md"
keywords = ["autodiff", "differentiation", "gradient", "jacobian", "scientific"]
categories = ["mathematics", "science", "algorithms"]

[lib]
bench = false

[dependencies]
num-traits = "0.2"
approx = { version = "0.5", optional = true }
simba = { version = "0.10", optional = true }
bumpalo = { version = "3", features = ["collections"], optional = true }
rayon = { version = "1", optional = true }
serde = { version = "1", features = ["derive"], optional = true }
ndarray = { version = "0.17", optional = true }
faer = { version = "0.24", optional = true }
nalgebra = { version = "0.35", optional = true }
wgpu = { version = "30", optional = true }
bytemuck = { version = "1", features = ["derive"], optional = true }
pollster = { version = "0.4", optional = true }
cudarc = { version = "0.19", optional = true, features = ["cuda-version-from-build-system"] }

[dev-dependencies]
criterion = { version = "0.8", features = ["html_reports"] }
approx = "0.5"
serde_json = "1"
ciborium = "0.2"
nalgebra = "0.35"
num-dual = "0.14"
ad_trait = "0.3.0"
tempfile = "3"

[features]
default = ["simba"]
simba = ["dep:simba", "dep:approx"]
bytecode = ["dep:bumpalo"]
parallel = ["dep:rayon", "bytecode"]
serde = ["dep:serde"]
ndarray = ["dep:ndarray", "bytecode"]
faer = ["dep:faer", "bytecode"]
nalgebra = ["dep:nalgebra", "bytecode"]
taylor = []
laurent = ["taylor"]
stde = ["bytecode", "taylor"]
diffop = ["bytecode", "taylor"]
gpu-wgpu = ["dep:wgpu", "dep:bytemuck", "dep:pollster", "bytecode"]
gpu-cuda = ["dep:cudarc", "bytecode"]

[[bench]]
name = "forward"
harness = false

[[bench]]
name = "reverse"
harness = false

[[bench]]
name = "bytecode"
harness = false
required-features = ["bytecode"]

[[bench]]
name = "taylor"
harness = false
required-features = ["stde"]

[[bench]]
name = "stde"
harness = false
required-features = ["stde"]

[[bench]]
name = "advanced"
harness = false
required-features = ["bytecode"]

[[bench]]
name = "comparison"
harness = false
required-features = ["bytecode"]

[[bench]]
name = "diffop"
harness = false
required-features = ["diffop"]

[[bench]]
name = "gpu"
harness = false
required-features = ["gpu-wgpu"]

[package.metadata.docs.rs]
features = ["simba", "bytecode", "parallel", "serde", "ndarray", "faer", "nalgebra", "taylor", "laurent", "stde", "diffop", "gpu-wgpu"]
rustdoc-args = ["--cfg", "docsrs"]
