[package]
authors = ["nathanielsimard <nathaniel.simard.42@gmail.com>"]
categories = ["science", "no-std", "embedded", "wasm"]
description = "Tensor tests for Burn backends"
documentation = "https://docs.rs/burn-backend-tests"
edition.workspace = true
keywords = ["deep-learning", "machine-learning", "tensor", "pytorch", "ndarray"]
license.workspace = true
name = "burn-backend-tests"
readme.workspace = true
repository = "https://github.com/tracel-ai/burn/tree/main/crates/burn-backend-tests"
version.workspace = true

[lints]
workspace = true

[lib]
proc-macro = true

[features]
default = [
    "burn-tensor/default",
    # Default
    # "ndarray",
    "std",
]
std = ["burn-tensor/std"]

# Backends
cuda = ["burn-tensor/cuda", "quantization", "cube"]
rocm = ["burn-tensor/rocm", "quantization", "cube"]
flex = ["burn-tensor/flex", "quantization"]
ndarray = ["burn-tensor/ndarray", "quantization"]
tch = ["burn-tensor/tch"]
vulkan = ["wgpu", "burn-tensor/vulkan"]
webgpu = ["wgpu", "burn-tensor/webgpu"]
metal = ["wgpu", "burn-tensor/metal"]
wgpu = ["burn-tensor/wgpu", "quantization", "cube"]
cpu = ["burn-tensor/cpu", "cube"]
# Runs the test suite against a remote `burn-remote` server.
# At runtime, set `BURN_DEVICE=remote` (and optionally `BURN_REMOTE_ADDRESS=ws://host:port`).
remote = ["burn-tensor/remote"]

autotune = ["burn-tensor/autotune"]
autotune-checks = ["burn-tensor/autotune-checks"]
memory-checks = ["burn-fusion?/memory-checks"]
fusion = ["burn-tensor/fusion", "burn-fusion/test-util"]
distributed = ["std", "burn-tensor/distributed"]

# CubeCL backends
cube = [
    "cubek",
    "autotune",
    "burn-tensor/ndarray",
    "burn-ndarray",
    # Not used directly, but included to avoid recompiling with and without fusion
    "burn-cubecl",
]

# Test configs
quantization = []

[dependencies]
burn-tensor = { workspace = true, features = ["autodiff"] }
burn-backend = { workspace = true }

# For random tests
cubek = { workspace = true, features = ["random"], optional = true }

# Explicitly enable test-only checks
burn-autodiff = { workspace = true, features = ["export_tests"] }
burn-ndarray = { workspace = true, optional = true, features = [
    "export_tests",
] }

# Manually enable so running the tests again with fusion feature doesn't have to compile other crates
burn-cubecl = { workspace = true, optional = true, features = [
    "default",
    "fusion",
] }

# Enabled alongside the `fusion` feature so spy-based tests can import the spy API.
burn-fusion = { workspace = true, optional = true }

num-traits = { workspace = true }
serial_test = { workspace = true }
rand.workspace = true

# might-panic macro
proc-macro2 = { workspace = true }
quote = { workspace = true }
syn = { workspace = true }


[dev-dependencies]
# Used to initialize device settings (test dtypes)
ctor = "0.10.1"
divan = "0.1"

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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