1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
[]
= "optirs-gpu"
= true
= true
= true
= "OptiRS GPU acceleration and multi-GPU optimization"
= "README.md"
= true
= true
= ["gpu", "wgpu", "metal", "opencl", "optimization"]
= ["science", "algorithms", "hardware-support"]
[]
= true
[]
= ["wgpu", "metal"]
= ["--cfg", "docsrs"]
[]
# Core dependencies
#
# NOTE: `optirs-core` is a *dev*-dependency, not a runtime one: nothing in this
# crate's library code references it. It is used by the GPU/CPU parity tests,
# which check that the WGSL optimizer kernels reproduce the reference CPU
# optimizers bit-for-bit within tolerance.
#
# `gpu` is always on: every type in this crate's public API is expressed in
# terms of `scirs2_core::gpu`, so the module must exist in every feature
# configuration (including `--no-default-features`). Backend *runtimes* stay
# optional and are forwarded by the features below.
= { = true, = ["gpu", "random"] } # Required for SciRS2 policy compliance
# ❌ FORBIDDEN DEPENDENCIES REMOVED - Use SciRS2-Core abstractions instead
# ndarray - Use scirs2_core::ndarray
# num-traits - Use scirs2_core::numeric
#
# GPU runtime crates (wgpu / pollster / metal / objc2 / opencl3 / cudarc) are NOT
# direct dependencies: every GPU access in this crate goes through
# `scirs2_core::gpu`, and the backend runtimes are pulled in by the
# `scirs2-core/<backend>` features forwarded below.
= { = true }
= { = true, = ["derive"] }
= { = true }
# On macOS the native Metal backend is enabled unconditionally, because it is
# the backend that currently reaches the GPU there: scirs2-core 0.6.5's runtime
# device probe (`gpu::backends::detect_gpu_backends`) never enumerates wgpu
# adapters, so `GpuContext::new(GpuBackend::Wgpu)` always reports
# "no devices detected at runtime". The `metal` deps are themselves
# macOS-gated inside scirs2-core, so this adds nothing on other platforms.
[]
= { = true, = ["metal"] }
[]
= { = true }
# optirs-core = { workspace = true } # TEMP disabled while optirs-core is mid-refactor
[]
# Default enables the WebGPU backend, which is the only backend with a complete
# compute path in scirs2-core 0.6.x (Vulkan / Metal / DX12 via wgpu).
= ["wgpu"]
# Real GPU compute path: forwards to scirs2-core's wgpu backend.
= ["scirs2-core/wgpu"]
# Native Metal backend. Enabled automatically on macOS (see the target-specific
# dependency above); listing it here lets it be requested explicitly too.
= ["scirs2-core/metal"]
# OpenCL context creation only — this crate ships no OpenCL C kernel sources,
# so `SUPPORTED_BACKENDS` does not include it. See README for the full matrix.
= ["scirs2-core/opencl"]
# NOTE: scirs2-core removed its CUDA backend in 0.6.x (moved to the oxicuda-*
# crates). This feature therefore forwards nothing GPU-real; it only gates the
# CUDA-specific *reporting* code paths, all of which return explicit errors.
= []