Commit 0e463ad
committed
Remove dead LAPACK code, fix Marshal.SizeOf pragma, convert hot-path dictionaries to FrozenDictionary
Dead code removal:
- Delete Backends/LAPACK/ directory (LAPACK.cs, LAPACK.NetLib.cs,
np.LAPACK.cs) containing 6 DllImport P/Invoke declarations and the
LAPACKProviderType enum — all dead code, called only from linear
algebra stubs that return null/default (inv, qr, svd, lstsq)
- Delete test/NumSharp.UnitTest/LAPACK/ (dgels.cs, dgesvd.cs) — tests
for the removed dead LAPACK infrastructure
Marshal.SizeOf fix:
- np.save.cs: Remove unnecessary #pragma warning disable 618 around
Marshal.SizeOf(Type) — only the Marshal.SizeOf(Object) overload is
obsolete, not the Type overload used here
FrozenDictionary conversion (System.Collections.Frozen, .NET 8+):
- np.find_common_type.cs: Convert all 4 type promotion dictionaries
(_typemap_arr_arr, _nptypemap_arr_arr, _typemap_arr_scalar,
_nptypemap_arr_scalar) from Dictionary to FrozenDictionary. These
contain 180+ entries each and are hit on every arithmetic/comparison
operation for type resolution. FrozenDictionary optimizes the hash
table at freeze time for faster lookups.
- np.dtype.cs: Convert DType._kind_list_map from Dictionary to
FrozenDictionary (14 entries, used in find_common_type).
- TypelessConvert.cs: Convert _delegates from Dictionary to
FrozenDictionary (156 entries, boxing type-conversion lookup table).
Test results unchanged: 1601 passed, 50 failed on both net8.0/net10.0.
2 previously-skipped LAPACK tests removed with the dead code.1 parent 623c39b commit 0e463ad
9 files changed
Lines changed: 545 additions & 731 deletions
File tree
- src/NumSharp.Core
- APIs
- Backends/LAPACK
- Creation
- Logic
- Utilities
- test/NumSharp.UnitTest/LAPACK
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
223 | | - | |
224 | | - | |
| 222 | + | |
225 | 223 | | |
226 | 224 | | |
227 | 225 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
0 commit comments