[package]
name = "runmat-accelerate"
version = "0.5.6"
edition = "2021"
license = "Apache-2.0"
description = "Pluggable GPU acceleration layer for RunMat (CUDA, ROCm, Metal, Vulkan/Spir-V)"
homepage = "https://runmat.com"
repository = "https://github.com/runmat-org/runmat"

[features]
# Backends are opt-in features
cuda = []
rocm = []
metal = []
vulkan = []
opencl = []
wgpu = ["dep:wgpu", "dep:pollster", "runmat-accelerate-api/wgpu"]

[dependencies]
serde = { workspace = true, features = ["derive"] }
anyhow = { workspace = true }
thiserror = { workspace = true }
runmat-builtins = { workspace = true }
runmat-runtime = { workspace = true }
runmat-hir = { workspace = true }
runmat-accelerate-api = { workspace = true }
runmat-time = { workspace = true }
once_cell = "1"
bytemuck = { version = "1.14", features = ["derive"] }
log = { workspace = true }
env_logger = { workspace = true }
serde_json = { workspace = true }
dirs = "5.0"
num-complex = "0.4"
rustfft = "6.2"
smallvec = "1.13"
rand = "0.8"
tracing = "0.1"
futures = "0.3"

# Optional backend deps
pollster = { version = "0.3", optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wgpu = { version = "24.0.0", optional = true }
tokio = { workspace = true, default-features = false, features = ["macros", "rt"] }
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
js-sys = "0.3"
web-sys = { version = "0.3", features = [
  "console",
  "DomException",
  "DomStringList",
  "IdbDatabase",
  "IdbFactory",
  "IdbObjectStore",
  "IdbOpenDbRequest",
  "IdbRequest",
  "IdbTransaction",
  "IdbTransactionMode",
] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
wgpu = { version = "0.19", optional = true, features = ["trace"] }
tokio = { workspace = true, default-features = false, features = ["macros", "rt-multi-thread"] }
