[package]
name = "diffusionx"
authors = ["Xiangong Tang <tangxiangong@gmail.com>"]
edition = "2024"
license = "MIT OR Apache-2.0"
repository = "https://github.com/tangxiangong/diffusionx"
categories = ["science", "mathematics"]
keywords = ["stochastic-process", "simulation", "Monte-Carlo", "gpu"]
version = "0.11.4"
description = "A multi-threaded crate for random number generation and stochastic process simulation, with optional GPU acceleration."
readme = "README.md"
rust-version = "1.88"

[package.metadata.docs.rs]
features = ["visualize", "io"]
rustdoc-args = ["--cfg", "docsrs", "--html-in-header", "./docs-header.html"]

[lib]
name = "diffusionx"
doctest = false

[features]
default = ["mimalloc"]
cuda = ["dep:cudarc"]
mimalloc = ["dep:mimalloc"]
metal = ["dep:metal"]
io = ["dep:csv"]
visualize = [
    "dep:plotters",
    "dep:derive_builder",
    "dep:plotters-backend",
    "dep:either",
]

[dependencies]
csv = { version = "1.4", optional = true }
cudarc = { version = "0.19", optional = true, features = [
    "cuda-version-from-build-system",
] }
derive_builder = { version = "0.20", optional = true }
either = { version = "1", optional = true }
gauss-quad = "0.3"
metal = { version = "0.33", optional = true }
mimalloc = { version = "0.1", optional = true }
num-complex = "0.4"
num-traits = "0.2"
plotters = { version = "0.3", optional = true }
plotters-backend = { version = "0.3", optional = true }
rand = "0.10"
rand_distr = "0.6"
rand_xoshiro = "0.8"
rayon = "1.12"
realfft = "3.5"
thiserror = "2"

[dev-dependencies]
criterion = "0.8"

# Workaround for rustc ICE with scrape-examples and Unicode characters
# See: https://github.com/rust-lang/rust/issues/147399
# Disable scrape-examples for all example targets
[[example]]
name = "CIR"
doc-scrape-examples = false

[[example]]
name = "bm"
doc-scrape-examples = false

[[example]]
name = "langevin"
doc-scrape-examples = false

[[example]]
name = "randoms"
doc-scrape-examples = false

[profile.release]
lto = true
codegen-units = 1
panic = "abort"

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

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

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

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