sparta-solver 0.3.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. sparta_solver-0.3.7/.clang-format +29 -0
  2. sparta_solver-0.3.7/.gitattributes +1 -0
  3. sparta_solver-0.3.7/.github/workflows/wheels.yml +157 -0
  4. sparta_solver-0.3.7/.gitignore +36 -0
  5. sparta_solver-0.3.7/Cargo.lock +246 -0
  6. sparta_solver-0.3.7/Cargo.toml +46 -0
  7. sparta_solver-0.3.7/LICENSE +661 -0
  8. sparta_solver-0.3.7/LICENSE-THIRD-PARTY +59 -0
  9. sparta_solver-0.3.7/PKG-INFO +1576 -0
  10. sparta_solver-0.3.7/README.md +1550 -0
  11. sparta_solver-0.3.7/THIRD-PARTY-NOTICES +308 -0
  12. sparta_solver-0.3.7/bindings/julia/Project.toml +19 -0
  13. sparta_solver-0.3.7/bindings/julia/README.md +109 -0
  14. sparta_solver-0.3.7/bindings/julia/examples/sweep.jl +51 -0
  15. sparta_solver-0.3.7/bindings/julia/src/SPARTA.jl +29 -0
  16. sparta_solver-0.3.7/bindings/julia/src/library.jl +141 -0
  17. sparta_solver-0.3.7/bindings/julia/src/solver.jl +291 -0
  18. sparta_solver-0.3.7/bindings/julia/test/runtests.jl +137 -0
  19. sparta_solver-0.3.7/bindings/matlab/README.md +119 -0
  20. sparta_solver-0.3.7/bindings/matlab/SpartaSolver.m +247 -0
  21. sparta_solver-0.3.7/bindings/matlab/build_sparta_mex.m +52 -0
  22. sparta_solver-0.3.7/bindings/matlab/example_sweep.m +52 -0
  23. sparta_solver-0.3.7/bindings/matlab/sparta_mex.c +497 -0
  24. sparta_solver-0.3.7/bindings/matlab/test_sparta.m +97 -0
  25. sparta_solver-0.3.7/build.rs +390 -0
  26. sparta_solver-0.3.7/crates/scalpel/Cargo.toml +11 -0
  27. sparta_solver-0.3.7/crates/scalpel/README.md +162 -0
  28. sparta_solver-0.3.7/crates/scalpel/src/compress.rs +150 -0
  29. sparta_solver-0.3.7/crates/scalpel/src/cover.rs +200 -0
  30. sparta_solver-0.3.7/crates/scalpel/src/flow.rs +266 -0
  31. sparta_solver-0.3.7/crates/scalpel/src/graph.rs +219 -0
  32. sparta_solver-0.3.7/crates/scalpel/src/heap.rs +175 -0
  33. sparta_solver-0.3.7/crates/scalpel/src/leaf.rs +243 -0
  34. sparta_solver-0.3.7/crates/scalpel/src/lib.rs +198 -0
  35. sparta_solver-0.3.7/crates/scalpel/src/refine.rs +238 -0
  36. sparta_solver-0.3.7/crates/scalpel/src/separator.rs +542 -0
  37. sparta_solver-0.3.7/crates/scalpel/src/spectral.rs +203 -0
  38. sparta_solver-0.3.7/crates/scalpel/src/wide.rs +240 -0
  39. sparta_solver-0.3.7/crates/scalpel/tests/ordering.rs +181 -0
  40. sparta_solver-0.3.7/crates/sparta-blas/Cargo.toml +12 -0
  41. sparta_solver-0.3.7/crates/sparta-blas/examples/peak.rs +124 -0
  42. sparta_solver-0.3.7/crates/sparta-blas/examples/vs_accelerate.rs +153 -0
  43. sparta_solver-0.3.7/crates/sparta-blas/examples/vs_openblas.rs +173 -0
  44. sparta_solver-0.3.7/crates/sparta-blas/src/abi.rs +271 -0
  45. sparta_solver-0.3.7/crates/sparta-blas/src/element.rs +147 -0
  46. sparta_solver-0.3.7/crates/sparta-blas/src/gemm.rs +464 -0
  47. sparta_solver-0.3.7/crates/sparta-blas/src/getrf.rs +108 -0
  48. sparta_solver-0.3.7/crates/sparta-blas/src/isa.rs +146 -0
  49. sparta_solver-0.3.7/crates/sparta-blas/src/kernel.rs +229 -0
  50. sparta_solver-0.3.7/crates/sparta-blas/src/lib.rs +54 -0
  51. sparta_solver-0.3.7/crates/sparta-blas/src/pack.rs +95 -0
  52. sparta_solver-0.3.7/crates/sparta-blas/src/simd/mod.rs +102 -0
  53. sparta_solver-0.3.7/crates/sparta-blas/src/simd/neon.rs +102 -0
  54. sparta_solver-0.3.7/crates/sparta-blas/src/simd/x86.rs +185 -0
  55. sparta_solver-0.3.7/crates/sparta-blas/src/sme512/c.rs +232 -0
  56. sparta_solver-0.3.7/crates/sparta-blas/src/sme512/d.rs +291 -0
  57. sparta_solver-0.3.7/crates/sparta-blas/src/sme512/mod.rs +188 -0
  58. sparta_solver-0.3.7/crates/sparta-blas/src/sme512/pack.rs +503 -0
  59. sparta_solver-0.3.7/crates/sparta-blas/src/sme512/s.rs +224 -0
  60. sparta_solver-0.3.7/crates/sparta-blas/src/sme512/z.rs +283 -0
  61. sparta_solver-0.3.7/crates/sparta-blas/src/sytrf.rs +428 -0
  62. sparta_solver-0.3.7/crates/sparta-blas/src/threading.rs +40 -0
  63. sparta_solver-0.3.7/crates/sparta-blas/src/trsm.rs +320 -0
  64. sparta_solver-0.3.7/crates/sparta-blas/tests/kernels.rs +403 -0
  65. sparta_solver-0.3.7/pyproject.toml +67 -0
  66. sparta_solver-0.3.7/python/API.md +485 -0
  67. sparta_solver-0.3.7/python/Cargo.lock +446 -0
  68. sparta_solver-0.3.7/python/Cargo.toml +24 -0
  69. sparta_solver-0.3.7/python/sparta/__init__.py +284 -0
  70. sparta_solver-0.3.7/python/sparta/_config.py +220 -0
  71. sparta_solver-0.3.7/python/sparta/_matrix.py +194 -0
  72. sparta_solver-0.3.7/python/sparta/_optimize.py +218 -0
  73. sparta_solver-0.3.7/python/sparta/_options.py +172 -0
  74. sparta_solver-0.3.7/python/sparta/_quality.py +160 -0
  75. sparta_solver-0.3.7/python/sparta/_refinement.py +305 -0
  76. sparta_solver-0.3.7/python/sparta/_scaling.py +41 -0
  77. sparta_solver-0.3.7/python/sparta/_solver.py +962 -0
  78. sparta_solver-0.3.7/python/sparta/_symmetry.py +20 -0
  79. sparta_solver-0.3.7/python/sparta/_types.py +59 -0
  80. sparta_solver-0.3.7/python/src/cpu.rs +80 -0
  81. sparta_solver-0.3.7/python/src/lib.rs +329 -0
  82. sparta_solver-0.3.7/python/src/residual.rs +213 -0
  83. sparta_solver-0.3.7/python/src/tuning.rs +288 -0
  84. sparta_solver-0.3.7/python/src/values.rs +165 -0
  85. sparta_solver-0.3.7/run_sparta.sh +19 -0
  86. sparta_solver-0.3.7/src/analysis.rs +2568 -0
  87. sparta_solver-0.3.7/src/blas.rs +290 -0
  88. sparta_solver-0.3.7/src/config.rs +531 -0
  89. sparta_solver-0.3.7/src/cpu/README.md +270 -0
  90. sparta_solver-0.3.7/src/cpu/blocked.rs +447 -0
  91. sparta_solver-0.3.7/src/cpu/blocked_lu.rs +110 -0
  92. sparta_solver-0.3.7/src/cpu/dense.rs +572 -0
  93. sparta_solver-0.3.7/src/cpu/factor.rs +408 -0
  94. sparta_solver-0.3.7/src/cpu/level.rs +373 -0
  95. sparta_solver-0.3.7/src/cpu/mod.rs +640 -0
  96. sparta_solver-0.3.7/src/cpu/panel.rs +223 -0
  97. sparta_solver-0.3.7/src/cpu/profile.rs +186 -0
  98. sparta_solver-0.3.7/src/cpu/solve.rs +598 -0
  99. sparta_solver-0.3.7/src/cpu/sparse.rs +357 -0
  100. sparta_solver-0.3.7/src/cpu/supernodal.rs +580 -0
  101. sparta_solver-0.3.7/src/cpu/update.rs +57 -0
  102. sparta_solver-0.3.7/src/device.rs +210 -0
  103. sparta_solver-0.3.7/src/gpu/absent.rs +44 -0
  104. sparta_solver-0.3.7/src/gpu/hybrid.rs +268 -0
  105. sparta_solver-0.3.7/src/gpu/metal.rs +388 -0
  106. sparta_solver-0.3.7/src/gpu/mod.rs +447 -0
  107. sparta_solver-0.3.7/src/gpu/vulkan/device.rs +396 -0
  108. sparta_solver-0.3.7/src/gpu/vulkan/mod.rs +990 -0
  109. sparta_solver-0.3.7/src/gpu/vulkan/pipelines.rs +199 -0
  110. sparta_solver-0.3.7/src/gpu/vulkan/schedule.rs +515 -0
  111. sparta_solver-0.3.7/src/hybrid.rs +142 -0
  112. sparta_solver-0.3.7/src/kernels/assembly.metal +358 -0
  113. sparta_solver-0.3.7/src/kernels/common.metal +412 -0
  114. sparta_solver-0.3.7/src/kernels/ldlt_factor.metal +957 -0
  115. sparta_solver-0.3.7/src/kernels/ldlt_solve.metal +186 -0
  116. sparta_solver-0.3.7/src/kernels/ldlt_update.metal +326 -0
  117. sparta_solver-0.3.7/src/kernels/lu_factor.metal +546 -0
  118. sparta_solver-0.3.7/src/kernels/lu_solve.metal +136 -0
  119. sparta_solver-0.3.7/src/kernels/lu_update.metal +158 -0
  120. sparta_solver-0.3.7/src/kernels/vulkan/assembly.comp +159 -0
  121. sparta_solver-0.3.7/src/kernels/vulkan/common.comp +345 -0
  122. sparta_solver-0.3.7/src/kernels/vulkan/ldlt_factor.comp +854 -0
  123. sparta_solver-0.3.7/src/kernels/vulkan/ldlt_solve.comp +167 -0
  124. sparta_solver-0.3.7/src/kernels/vulkan/ldlt_update.comp +149 -0
  125. sparta_solver-0.3.7/src/kernels/vulkan/lu_factor.comp +479 -0
  126. sparta_solver-0.3.7/src/kernels/vulkan/lu_solve.comp +89 -0
  127. sparta_solver-0.3.7/src/kernels/vulkan/lu_update.comp +128 -0
  128. sparta_solver-0.3.7/src/kernels/vulkan/spirv/SOURCES +1 -0
  129. sparta_solver-0.3.7/src/kernels/vulkan/spirv/advance_panel.spv +0 -0
  130. sparta_solver-0.3.7/src/kernels/vulkan/spirv/assemble_children.spv +0 -0
  131. sparta_solver-0.3.7/src/kernels/vulkan/spirv/factor_narrow.spv +0 -0
  132. sparta_solver-0.3.7/src/kernels/vulkan/spirv/factor_narrow_lu.spv +0 -0
  133. sparta_solver-0.3.7/src/kernels/vulkan/spirv/factor_narrow_tail.spv +0 -0
  134. sparta_solver-0.3.7/src/kernels/vulkan/spirv/factor_narrow_tail_lu.spv +0 -0
  135. sparta_solver-0.3.7/src/kernels/vulkan/spirv/factor_nodes.spv +0 -0
  136. sparta_solver-0.3.7/src/kernels/vulkan/spirv/factor_nodes_lu.spv +0 -0
  137. sparta_solver-0.3.7/src/kernels/vulkan/spirv/factor_panel.spv +0 -0
  138. sparta_solver-0.3.7/src/kernels/vulkan/spirv/factor_panel_lu.spv +0 -0
  139. sparta_solver-0.3.7/src/kernels/vulkan/spirv/factor_panel_tail.spv +0 -0
  140. sparta_solver-0.3.7/src/kernels/vulkan/spirv/factor_panel_tail_lu.spv +0 -0
  141. sparta_solver-0.3.7/src/kernels/vulkan/spirv/initialize_large.spv +0 -0
  142. sparta_solver-0.3.7/src/kernels/vulkan/spirv/initialize_large_lu.spv +0 -0
  143. sparta_solver-0.3.7/src/kernels/vulkan/spirv/solve_backward.spv +0 -0
  144. sparta_solver-0.3.7/src/kernels/vulkan/spirv/solve_backward_lu.spv +0 -0
  145. sparta_solver-0.3.7/src/kernels/vulkan/spirv/solve_diagonal.spv +0 -0
  146. sparta_solver-0.3.7/src/kernels/vulkan/spirv/solve_forward.spv +0 -0
  147. sparta_solver-0.3.7/src/kernels/vulkan/spirv/solve_forward_atomic.spv +0 -0
  148. sparta_solver-0.3.7/src/kernels/vulkan/spirv/solve_forward_lu.spv +0 -0
  149. sparta_solver-0.3.7/src/kernels/vulkan/spirv/solve_forward_lu_atomic.spv +0 -0
  150. sparta_solver-0.3.7/src/kernels/vulkan/spirv/store_factors.spv +0 -0
  151. sparta_solver-0.3.7/src/kernels/vulkan/spirv/store_factors_lu.spv +0 -0
  152. sparta_solver-0.3.7/src/kernels/vulkan/spirv/update_schur.spv +0 -0
  153. sparta_solver-0.3.7/src/kernels/vulkan/spirv/update_schur_lu.spv +0 -0
  154. sparta_solver-0.3.7/src/kernels/vulkan/spirv/update_strip.spv +0 -0
  155. sparta_solver-0.3.7/src/kernels/vulkan/spirv/update_strip_lu.spv +0 -0
  156. sparta_solver-0.3.7/src/kernels/vulkan/spirv/zero_fronts.spv +0 -0
  157. sparta_solver-0.3.7/src/lib.rs +208 -0
  158. sparta_solver-0.3.7/src/metal.m +884 -0
  159. sparta_solver-0.3.7/src/optimize/mod.rs +381 -0
  160. sparta_solver-0.3.7/src/optimize/problem.rs +223 -0
  161. sparta_solver-0.3.7/src/optimize/report.rs +226 -0
  162. sparta_solver-0.3.7/src/optimize/search.rs +265 -0
  163. sparta_solver-0.3.7/src/optimize/space.rs +45 -0
  164. sparta_solver-0.3.7/src/preset.rs +147 -0
  165. sparta_solver-0.3.7/src/profile.rs +77 -0
  166. sparta_solver-0.3.7/src/profiles.rs +379 -0
  167. sparta_solver-0.3.7/src/scalar.rs +205 -0
  168. sparta_solver-0.3.7/src/settings.rs +243 -0
  169. sparta_solver-0.3.7/src/solver.rs +547 -0
  170. sparta_solver-0.3.7/src/sparse.rs +104 -0
  171. sparta_solver-0.3.7/src/symbolic/column_counts.rs +559 -0
  172. sparta_solver-0.3.7/src/symbolic/elimination_tree.rs +374 -0
  173. sparta_solver-0.3.7/src/symbolic/mod.rs +357 -0
  174. sparta_solver-0.3.7/src/symbolic/postorder.rs +286 -0
  175. sparta_solver-0.3.7/src/symbolic/supernode.rs +630 -0
  176. sparta_solver-0.3.7/src/threads.rs +94 -0
  177. sparta_solver-0.3.7/validate.sh +58 -0
  178. sparta_solver-0.3.7/website/README.md +46 -0
  179. sparta_solver-0.3.7/website/assets/logo.svg +237 -0
  180. sparta_solver-0.3.7/website/index.html +721 -0
@@ -0,0 +1,29 @@
1
+ # Formatting for the Metal kernels in src/kernels/.
2
+ #
3
+ # ReflowComments is off deliberately: the comments in those files carry measured
4
+ # timings and the reasoning behind tuning constants, and they are wrapped by hand
5
+ # to read as prose. A reformat must not touch them.
6
+ Language: Cpp
7
+ BasedOnStyle: LLVM
8
+ IndentWidth: 4
9
+ ColumnLimit: 100
10
+ ReflowComments: false
11
+ PointerAlignment: Left
12
+ DerivePointerAlignment: false
13
+ SpaceBeforeParens: ControlStatements
14
+ AllowShortBlocksOnASingleLine: Never
15
+ AllowShortIfStatementsOnASingleLine: Never
16
+ AllowShortLoopsOnASingleLine: false
17
+ AllowShortFunctionsOnASingleLine: None
18
+ AllowShortCaseLabelsOnASingleLine: false
19
+ BreakBeforeBraces: Attach
20
+ AlignAfterOpenBracket: Align
21
+ AlignEscapedNewlines: Left
22
+ MaxEmptyLinesToKeep: 1
23
+ KeepEmptyLinesAtTheStartOfBlocks: false
24
+ SortIncludes: Never
25
+ IndentPPDirectives: None
26
+ # A kernel signature is long enough that clang-format would otherwise park the
27
+ # return type on its own line, which reads worse than a wrapped parameter list.
28
+ PenaltyReturnTypeOnItsOwnLine: 10000
29
+ AlwaysBreakAfterReturnType: None
@@ -0,0 +1 @@
1
+ *.spv binary
@@ -0,0 +1,157 @@
1
+ # Builds the Python wheels and the source distribution, tests each wheel, and
2
+ # on a release publishes them to PyPI and attaches them to a GitHub Release.
3
+ # Users then install SPARTA with `pip install sparta-solver`, without Rust or
4
+ # a C compiler.
5
+ #
6
+ # Pushing a tag v* builds that tag, publishes it to PyPI and creates its
7
+ # GitHub Release. The tag must match the version in pyproject.toml (v0.3.7 for
8
+ # 0.3.7), or nothing is published. Running the workflow by hand ("Run
9
+ # workflow" on the Actions tab) builds and tests without publishing, or, given
10
+ # a tag, builds that tag and publishes it.
11
+ #
12
+ # PyPI accepts the upload through trusted publishing: the PyPI project
13
+ # sparta-solver names this repository, this workflow file (wheels.yml) and the
14
+ # environment "pypi" as its publisher. No API token is stored here.
15
+ name: wheels
16
+
17
+ on:
18
+ push:
19
+ tags: ["v*"]
20
+ workflow_dispatch:
21
+ inputs:
22
+ tag:
23
+ description: "Tag to build and publish, e.g. v0.3.7. Empty: build and test only."
24
+ required: false
25
+ default: ""
26
+
27
+ permissions:
28
+ contents: read
29
+
30
+ env:
31
+ TAG: ${{ inputs.tag || (startsWith(github.ref, 'refs/tags/') && github.ref_name) || '' }}
32
+
33
+ jobs:
34
+ wheel:
35
+ name: wheel ${{ matrix.name }}
36
+ runs-on: ${{ matrix.os }}
37
+ strategy:
38
+ fail-fast: false
39
+ matrix:
40
+ include:
41
+ - { name: macos-arm64, os: macos-15, target: aarch64-apple-darwin, test: true }
42
+ # Intel Macs: cross-compiled, CPU backend only, not run here.
43
+ - { name: macos-x86_64, os: macos-15, target: x86_64-apple-darwin, test: false }
44
+ # Both slices in one file, for apps that bundle one wheel for every
45
+ # Mac. pip prefers the single-architecture wheels above, which are
46
+ # half the size. The test runs the arm64 slice.
47
+ - { name: macos-universal2, os: macos-15, target: universal2-apple-darwin, test: true }
48
+ - { name: linux-x86_64, os: ubuntu-latest, target: x86_64-unknown-linux-gnu, test: true }
49
+ - { name: linux-aarch64, os: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu, test: true }
50
+ - { name: windows-x86_64, os: windows-latest, target: x86_64-pc-windows-msvc, test: true }
51
+ steps:
52
+ - uses: actions/checkout@v4
53
+ with:
54
+ ref: ${{ env.TAG || github.ref }}
55
+ - uses: actions/setup-python@v5
56
+ with:
57
+ python-version: "3.12"
58
+ # One abi3 wheel per platform serves Python 3.9 and later.
59
+ - uses: PyO3/maturin-action@v1
60
+ with:
61
+ target: ${{ matrix.target }}
62
+ args: --release --out dist
63
+ manylinux: auto
64
+ # CPU solves on a 2D grid, large enough to reach the dense kernels: a
65
+ # complex symmetric LDLT and a real unsymmetric LU. The runners have no
66
+ # usable GPU. On x86 these are the only runs of the AVX2 and AVX-512
67
+ # kernel sets, so a wrong kernel stops the release here.
68
+ - name: Test the wheel
69
+ if: matrix.test
70
+ shell: bash
71
+ run: |
72
+ python -m pip install dist/*.whl
73
+ cd "$RUNNER_TEMP"
74
+ python - <<'PY'
75
+ import numpy as np
76
+ from scipy import sparse
77
+ import sparta
78
+ print(sparta.__version__, sparta.blas_library(), sparta.gpu_available())
79
+ assert "scalar" not in sparta.blas_library(), "no vector kernel set was selected"
80
+ m = 120
81
+ t = sparse.diags([-1.0, 4.0, -1.0], [-1, 0, 1], shape=(m, m))
82
+ lap = sparse.kron(sparse.eye(m), t) + sparse.kron(sparse.diags([-1.0, -1.0], [-1, 1], shape=(m, m)), sparse.eye(m))
83
+ cases = {
84
+ "complex LDLT": (lap + 0.1j * sparse.eye(m * m)).tocsc(),
85
+ "real LU": (lap + sparse.diags([0.3], [m], shape=(m * m, m * m))).tocsc(),
86
+ }
87
+ for name, a in cases.items():
88
+ b = np.ones(m * m, dtype=a.dtype)
89
+ x = sparta.analyze(a, force_cpu=True).factorize().solve(b)
90
+ r = np.linalg.norm(a @ x - b) / np.linalg.norm(b)
91
+ print(name, "relative residual", r)
92
+ assert r < 1e-10, name
93
+ PY
94
+ - uses: actions/upload-artifact@v4
95
+ with:
96
+ name: wheel-${{ matrix.name }}
97
+ path: dist/*.whl
98
+
99
+ sdist:
100
+ runs-on: ubuntu-latest
101
+ steps:
102
+ - uses: actions/checkout@v4
103
+ with:
104
+ ref: ${{ env.TAG || github.ref }}
105
+ - name: Check that the tag matches the package version
106
+ if: env.TAG != ''
107
+ shell: bash
108
+ run: |
109
+ version=$(sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml)
110
+ echo "tag $TAG, pyproject.toml version $version"
111
+ test "$TAG" = "v$version"
112
+ - uses: PyO3/maturin-action@v1
113
+ with:
114
+ command: sdist
115
+ args: --out dist
116
+ - uses: actions/upload-artifact@v4
117
+ with:
118
+ name: sdist
119
+ path: dist/*.tar.gz
120
+
121
+ pypi:
122
+ needs: [wheel, sdist]
123
+ if: ${{ inputs.tag != '' || startsWith(github.ref, 'refs/tags/') }}
124
+ runs-on: ubuntu-latest
125
+ environment:
126
+ name: pypi
127
+ url: https://pypi.org/project/sparta-solver/
128
+ permissions:
129
+ id-token: write
130
+ steps:
131
+ - uses: actions/download-artifact@v4
132
+ with:
133
+ path: dist
134
+ merge-multiple: true
135
+ - uses: pypa/gh-action-pypi-publish@release/v1
136
+
137
+ release:
138
+ needs: [pypi]
139
+ runs-on: ubuntu-latest
140
+ permissions:
141
+ contents: write
142
+ steps:
143
+ - uses: actions/download-artifact@v4
144
+ with:
145
+ path: dist
146
+ merge-multiple: true
147
+ - uses: softprops/action-gh-release@v2
148
+ with:
149
+ tag_name: ${{ env.TAG }}
150
+ name: SPARTA ${{ env.TAG }}
151
+ files: dist/*
152
+ body: |
153
+ Install without Rust or a compiler (macOS, Linux and Windows, Python 3.9 or later):
154
+
155
+ ```
156
+ pip install sparta-solver
157
+ ```
@@ -0,0 +1,36 @@
1
+ # Build output. dist/ holds what `make package` produces.
2
+ /target/
3
+ /python/target/
4
+ dist/
5
+ debug
6
+ *.pdb
7
+
8
+ # Local toolchain caches, virtualenvs and validation logs
9
+ /.local/
10
+
11
+ # MATLAB and Julia binding build output
12
+ /bindings/matlab/*.mex*
13
+ /bindings/matlab/*.dll
14
+ /bindings/julia/Manifest.toml
15
+
16
+ # Python
17
+ __pycache__/
18
+ *.so
19
+ *.pyd
20
+ *.egg-info/
21
+
22
+ # rustfmt backups and cargo-mutants output
23
+ **/*.rs.bk
24
+ **/mutants.out*/
25
+
26
+ # Converted benchmark systems and their sources are large and problem-specific.
27
+ # .npy covers the loose solve-id / RHS / solution vectors that ship alongside the
28
+ # unsymmetric periodic-array matrices, which are not packed into a container.
29
+ *.npz
30
+ *.npy
31
+
32
+ # JetBrains: see github/gitignore Global/JetBrains.gitignore for the full list.
33
+ #.idea/
34
+
35
+ # Benchmark systems are too large for git.
36
+ test_matrices/
@@ -0,0 +1,246 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "ash"
7
+ version = "0.38.0+1.3.281"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f"
10
+ dependencies = [
11
+ "libloading",
12
+ ]
13
+
14
+ [[package]]
15
+ name = "autocfg"
16
+ version = "1.5.1"
17
+ source = "registry+https://github.com/rust-lang/crates.io-index"
18
+ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
19
+
20
+ [[package]]
21
+ name = "cfg-if"
22
+ version = "1.0.4"
23
+ source = "registry+https://github.com/rust-lang/crates.io-index"
24
+ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
25
+
26
+ [[package]]
27
+ name = "crossbeam-deque"
28
+ version = "0.8.8"
29
+ source = "registry+https://github.com/rust-lang/crates.io-index"
30
+ checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a"
31
+ dependencies = [
32
+ "crossbeam-epoch",
33
+ "crossbeam-utils",
34
+ ]
35
+
36
+ [[package]]
37
+ name = "crossbeam-epoch"
38
+ version = "0.9.21"
39
+ source = "registry+https://github.com/rust-lang/crates.io-index"
40
+ checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"
41
+ dependencies = [
42
+ "crossbeam-utils",
43
+ ]
44
+
45
+ [[package]]
46
+ name = "crossbeam-utils"
47
+ version = "0.8.23"
48
+ source = "registry+https://github.com/rust-lang/crates.io-index"
49
+ checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
50
+
51
+ [[package]]
52
+ name = "either"
53
+ version = "1.18.0"
54
+ source = "registry+https://github.com/rust-lang/crates.io-index"
55
+ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
56
+
57
+ [[package]]
58
+ name = "itoa"
59
+ version = "1.0.18"
60
+ source = "registry+https://github.com/rust-lang/crates.io-index"
61
+ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
62
+
63
+ [[package]]
64
+ name = "libloading"
65
+ version = "0.8.9"
66
+ source = "registry+https://github.com/rust-lang/crates.io-index"
67
+ checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"
68
+ dependencies = [
69
+ "cfg-if",
70
+ "windows-link",
71
+ ]
72
+
73
+ [[package]]
74
+ name = "memchr"
75
+ version = "2.8.3"
76
+ source = "registry+https://github.com/rust-lang/crates.io-index"
77
+ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
78
+
79
+ [[package]]
80
+ name = "num-complex"
81
+ version = "0.4.6"
82
+ source = "registry+https://github.com/rust-lang/crates.io-index"
83
+ checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
84
+ dependencies = [
85
+ "num-traits",
86
+ ]
87
+
88
+ [[package]]
89
+ name = "num-traits"
90
+ version = "0.2.19"
91
+ source = "registry+https://github.com/rust-lang/crates.io-index"
92
+ checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
93
+ dependencies = [
94
+ "autocfg",
95
+ ]
96
+
97
+ [[package]]
98
+ name = "proc-macro2"
99
+ version = "1.0.107"
100
+ source = "registry+https://github.com/rust-lang/crates.io-index"
101
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
102
+ dependencies = [
103
+ "unicode-ident",
104
+ ]
105
+
106
+ [[package]]
107
+ name = "quote"
108
+ version = "1.0.47"
109
+ source = "registry+https://github.com/rust-lang/crates.io-index"
110
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
111
+ dependencies = [
112
+ "proc-macro2",
113
+ ]
114
+
115
+ [[package]]
116
+ name = "rayon"
117
+ version = "1.12.0"
118
+ source = "registry+https://github.com/rust-lang/crates.io-index"
119
+ checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
120
+ dependencies = [
121
+ "either",
122
+ "rayon-core",
123
+ ]
124
+
125
+ [[package]]
126
+ name = "rayon-core"
127
+ version = "1.13.0"
128
+ source = "registry+https://github.com/rust-lang/crates.io-index"
129
+ checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
130
+ dependencies = [
131
+ "crossbeam-deque",
132
+ "crossbeam-utils",
133
+ ]
134
+
135
+ [[package]]
136
+ name = "scalpel"
137
+ version = "0.1.0"
138
+ dependencies = [
139
+ "rayon",
140
+ ]
141
+
142
+ [[package]]
143
+ name = "serde"
144
+ version = "1.0.229"
145
+ source = "registry+https://github.com/rust-lang/crates.io-index"
146
+ checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
147
+ dependencies = [
148
+ "serde_core",
149
+ ]
150
+
151
+ [[package]]
152
+ name = "serde_core"
153
+ version = "1.0.229"
154
+ source = "registry+https://github.com/rust-lang/crates.io-index"
155
+ checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
156
+ dependencies = [
157
+ "serde_derive",
158
+ ]
159
+
160
+ [[package]]
161
+ name = "serde_derive"
162
+ version = "1.0.229"
163
+ source = "registry+https://github.com/rust-lang/crates.io-index"
164
+ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
165
+ dependencies = [
166
+ "proc-macro2",
167
+ "quote",
168
+ "syn",
169
+ ]
170
+
171
+ [[package]]
172
+ name = "serde_json"
173
+ version = "1.0.151"
174
+ source = "registry+https://github.com/rust-lang/crates.io-index"
175
+ checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
176
+ dependencies = [
177
+ "itoa",
178
+ "memchr",
179
+ "serde",
180
+ "serde_core",
181
+ "zmij",
182
+ ]
183
+
184
+ [[package]]
185
+ name = "sparta-blas"
186
+ version = "0.1.0"
187
+ dependencies = [
188
+ "num-complex",
189
+ "rayon",
190
+ ]
191
+
192
+ [[package]]
193
+ name = "sparta-capi"
194
+ version = "0.3.7"
195
+ dependencies = [
196
+ "sparta-solver",
197
+ ]
198
+
199
+ [[package]]
200
+ name = "sparta-matgen"
201
+ version = "0.1.0"
202
+ dependencies = [
203
+ "num-complex",
204
+ ]
205
+
206
+ [[package]]
207
+ name = "sparta-solver"
208
+ version = "0.3.7"
209
+ dependencies = [
210
+ "ash",
211
+ "num-complex",
212
+ "rayon",
213
+ "scalpel",
214
+ "serde_json",
215
+ "sparta-blas",
216
+ "sparta-matgen",
217
+ ]
218
+
219
+ [[package]]
220
+ name = "syn"
221
+ version = "3.0.6"
222
+ source = "registry+https://github.com/rust-lang/crates.io-index"
223
+ checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee"
224
+ dependencies = [
225
+ "proc-macro2",
226
+ "quote",
227
+ "unicode-ident",
228
+ ]
229
+
230
+ [[package]]
231
+ name = "unicode-ident"
232
+ version = "1.0.26"
233
+ source = "registry+https://github.com/rust-lang/crates.io-index"
234
+ checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"
235
+
236
+ [[package]]
237
+ name = "windows-link"
238
+ version = "0.2.1"
239
+ source = "registry+https://github.com/rust-lang/crates.io-index"
240
+ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
241
+
242
+ [[package]]
243
+ name = "zmij"
244
+ version = "1.0.23"
245
+ source = "registry+https://github.com/rust-lang/crates.io-index"
246
+ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
@@ -0,0 +1,46 @@
1
+ [package]
2
+ name = "sparta-solver"
3
+ version = "0.3.7"
4
+ edition = "2021"
5
+ authors = ["Robert Fennis", "Milan Rother"]
6
+ license = "AGPL-3.0-or-later"
7
+ publish = false
8
+ readme = "README.md"
9
+
10
+ [workspace]
11
+ members = ["devtools/matgen", "crates/scalpel", "crates/sparta-capi", "crates/sparta-blas"]
12
+ exclude = ["python"]
13
+
14
+ [features]
15
+ # One GPU backend per build. With neither `metal` nor `vulkan`, `gpu` lets
16
+ # `build.rs` pick from the target: Apple Silicon gets Metal, Windows and Linux
17
+ # get Vulkan, anything else gets no device. `default-features = false` without
18
+ # either backend builds the analysis and the CPU backend only.
19
+ default = ["gpu"]
20
+ ## Compile the target's GPU backend, if it has one.
21
+ gpu = []
22
+ ## Apple Metal on Apple Silicon.
23
+ metal = []
24
+ ## Vulkan compute for AMD and NVIDIA, the default on Windows and Linux. Needs a
25
+ ## Vulkan 1.3 driver at run time, and glslc (the Vulkan SDK) at build time only
26
+ ## after a kernel edit; see https://github.com/FennisRobert/SPARTA/issues/31.
27
+ vulkan = ["dep:ash"]
28
+
29
+ [lib]
30
+ name = "sparta"
31
+
32
+ [dependencies]
33
+ scalpel = { path = "crates/scalpel" }
34
+ sparta-blas = { path = "crates/sparta-blas" }
35
+ rayon = "1.12"
36
+ num-complex = "0.4"
37
+ serde_json = "1"
38
+ ash = { version = "0.38", optional = true }
39
+
40
+ # Vulkan is the default backend there, so `ash` is needed without the feature.
41
+ [target.'cfg(any(target_os = "windows", target_os = "linux"))'.dependencies]
42
+ ash = "0.38"
43
+
44
+ [dev-dependencies]
45
+ rayon = "1.12"
46
+ sparta-matgen = { path = "devtools/matgen" }