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

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

[lib]
doctest = false
name = "diffusionx"

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

[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 }
dispatch2 = { version = "0.3", optional = true }
either = { version = "1", optional = true }
gauss-quad = "0.3"
mimalloc = { version = "0.1", optional = true }
num-complex = "0.4"
num-traits = "0.2"
objc2 = { version = "0.6", optional = true }
objc2-foundation = { version = "0.3", optional = true, features = [
    "NSError",
    "NSString",
] }
objc2-metal = { version = "0.3", optional = true }
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]]
doc-scrape-examples = false
name = "CIR"

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

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

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

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

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

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

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

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