Commit Graph

325 Commits

Author SHA1 Message Date
129aaadeac OffsetDimSlice: impl IntoIter 2022-08-17 21:20:24 -07:00
a247b861e1 cross: hide the iteration features behind a flag
they don't compile on spirv due to the inherent use of Options,
but they'll be useful in the CPU-side code.
2022-08-17 21:14:21 -07:00
198cc16f3f cross: compile tests with the fmt feature so we can use assert_eq 2022-08-17 21:06:23 -07:00
3ed4cd5059 rename DimensionedSlice -> DimSlice 2022-08-17 20:45:36 -07:00
694906aa32 add OffsetDimensionedSlice, with basic indexing operations 2022-08-17 20:43:38 -07:00
ae5bfcf311 rename dim.rs -> dim_slice.rs 2022-08-17 20:34:47 -07:00
7a1e5815a8 rename Vec3uIter -> DimIter 2022-08-17 20:32:31 -07:00
b82c127957 add an enumerated method to DimensionedSlice 2022-08-17 18:12:32 -07:00
2311cf1dd3 cross: DimensionedSlice: add an indices method 2022-08-17 18:04:21 -07:00
782ac4d2c1 cross: impl IntoIterator for DimensionedSlice 2022-08-17 17:41:39 -07:00
1688707aed cross: backfill test for DimensionedSlice::IndexMut 2022-08-17 17:31:11 -07:00
92d4f464e1 cross: DimensionedSlice: backfill Index test 2022-08-17 17:28:31 -07:00
ee98e1a060 stim: re-express the AbstractStimulus list op as a fold
this gives a big perf boost: 10.5 fps -> 446 fps.

still far lower from the 720 fps we got on an ordinary Vec<Box<dyn
AbstractRegion>>. i think we had achieved 730  using the old
ListVisitor.

it's probably not worth list-ifying the stimuli; at least not at this
level. at the least, we probably want only 5 stimuli: one per core.
if we did that, the stimuli could even have all the same typename,
and be put into a plain old array; no boxing.
2022-08-17 03:28:52 -07:00
ffa13ccd79 app: multi-core-inverter: clean this up by using map/flatten operations 2022-08-17 02:53:14 -07:00
2e667a02dd cross: list: add some conveniences to query list length and access the first element 2022-08-17 02:45:44 -07:00
107a28e7fd app: multi_core_inverter: replace these into_lists with a map operation 2022-08-16 16:53:22 -07:00
7bb3740ce2 app: multi_core_inverter: convert to List primitives
goal will be to replace this with enumerate/map/flatten ops
2022-08-16 16:40:39 -07:00
d45b2042e1 cross: list: add more convenient indexing 2022-08-16 16:40:15 -07:00
4b04a48cc4 cross: list: allow enumerating by u32 instead of Tagged 2022-08-16 16:18:09 -07:00
07b5c855e8 cross: list: implement a Flatten operation 2022-08-16 15:52:09 -07:00
9d4853333d cross: list: implement an Extend operation 2022-08-16 15:28:10 -07:00
c353ce411f cross: list: remove the old (unused) Visitor infrastructure
replaced by Fold/Map/etc
2022-08-16 15:07:47 -07:00
4c5c978053 whitespace nits 2022-08-16 01:29:35 -07:00
fad70f45c1 stim: use Map + Sum for evaluating stimuli lists 2022-08-16 01:11:46 -07:00
e2728e0303 stim: impl Add for Fields to simplify some of this code 2022-08-16 00:17:23 -07:00
a68b3c7a49 cross: list: backfill more extensive Sum tests 2022-08-16 00:08:01 -07:00
57b90faa69 cross: list: implement a Sum operation 2022-08-16 00:03:15 -07:00
a8acf6cbb8 cross: list: extend fold to work by reference. 2022-08-15 23:51:19 -07:00
7704eb623a cross: list: remove special access to Node::{head,tail} 2022-08-15 23:00:49 -07:00
a2939a7807 cross: list: implement Enumerate operation 2022-08-15 21:25:41 -07:00
1cff95877e cross: list: implement a Map operation 2022-08-15 21:00:16 -07:00
96c690990f cross: list: make the fold impl more consistent with reverse 2022-08-15 19:18:05 -07:00
35ceefca42 cross: list: implement a Reverse operation
this was stupidly hard. it HAS to be a trait: it cannot be a
free-standing function else rustc gets stuck in recursive trait
expansion.
2022-08-15 19:14:44 -07:00
7c1824d58c cross: list: document why we use the flat impl 2022-08-15 18:46:44 -07:00
dcbef02765 cross: backfill test for list Appendable::append 2022-08-15 16:52:03 -07:00
a3f2b0b33f cross: list: more tests for fold operation 2022-08-15 03:39:22 -07:00
663d657969 cross: list: implement a Fold operation 2022-08-15 03:33:11 -07:00
1a86fb5ca3 cross: list: fold MaybeMeta and Meta into one trait 2022-08-15 02:32:47 -07:00
22051a39f8 cross: list: s/decl_/impl_/: these are implementations, not declarations 2022-08-14 21:04:52 -07:00
35d0e6a96d cross: list: add an Appendable trait.
this isn't tested... hope it works!
2022-08-14 21:03:49 -07:00
6e9b4465cb impl IntoList for all 100 list types
didn't end up using the Chomp stuff.
2022-08-14 21:01:49 -07:00
2225f98ec8 cross: list: implement IntoList on top of ChompTuple
this should be easier for macro generation of the impl.
2022-08-14 19:52:37 -07:00
19893157fa port: legacy sim accessors test to spirv 2022-08-14 19:16:09 -07:00
f61c0aeb00 spirv_backend: document why we don't support f64 2022-08-14 19:15:58 -07:00
1e994a4feb app: multi_core_inverter: more experiments (clock decay length, drive current, clock length) 2022-08-14 16:24:58 -07:00
f1143ec365 app: multi_core_inverter: don't save meas.csv
this boosts perf by like 5x
2022-08-13 16:20:24 -07:00
ee93c22f4a app: multi_core_inverter: perf: move the stimulus Gating to outside the CurlStimulus
the region.contains() logic is much more expensive than the time bounds
check.
this gets an easy 50% perf boost to the ENTIRE simulation
2022-08-13 15:00:56 -07:00
434dc2cbd5 app: multi_core_inverter: de-virtualize the stimuli
this gets like a 5% perf gain.
there are obviously cleaner ways to do it (e.g. use a ListVisitor),
but this is only a proof of concept.

given the low perf difference, i'll likely revert this or explore other
options.
2022-08-13 03:51:52 -07:00
bbb8b2b9ae driver: better APIs around list-based stimuli 2022-08-13 03:51:01 -07:00
df2ccac1d7 cross: list: implement Indexable up to P99
was previously P4
2022-08-13 03:50:11 -07:00