-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the internal iteration protocol #100
Conversation
@brycelelbach Don't worry, I'm not going to change anything out from under you: even if I get this all done and it shows an improvement, I'll wait till you've finished your work on #92 and then update |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #100 +/- ##
==========================================
- Coverage 97.67% 97.65% -0.03%
==========================================
Files 66 66
Lines 2236 2172 -64
==========================================
- Hits 2184 2121 -63
+ Misses 52 51 -1
☔ View full report in Codecov by Sentry. |
@tcbrindle sounds good - I'll try to get you an updated PR sometime next week. |
@tcbrindle On the topic of improving the internal iteration protocol, I'd like to see the protocol evolved to better support parallelism in the future. I'd love to use flux to prototype a next generation parallel algorithms library. The customization point today, In the non-parallel case, we can implement non-early-exit algorithms like However, in parallel, implementing non-early-exit algorithms like Some options:
|
That would be awesome!
I guess in general we'd want some way to indicate that we want parallel execution (for all algorithms where it's possible), perhaps something like the standard execution policies? In that case we could say that |
This is the top-level wrapper function (or actually pair of functions) which will eventually call custom `iterate_while()` implementations if possible, or fall back to external iteration
As per feedback on #99
Covers T[N], reference_wrapper<Seq> and contiguous ranges
5bd292a
to
9901983
Compare
This has bitrotted, and I have better ideas for how to solve the problem |
This is an experimental PR to try out the ideas in #99, namely replacing the existing
for_each_while(seq, pred) -> cursor_t
customisation point with a new pair of customisation points:The idea being that this will allow us to use internal iteration in more places.
A rough plan of action:
flux::iterate_while
wrapper functionsflux::for_each_while
usingiterate_while
for_each_while
custom implementations withiterate_while
customisations:T[N]
std::reference_wrapper
ranges::contiguous_range
simple_sequence_base
chain_adaptor
cycle_adaptor
filter_adaptor
flatten_adaptor
map_adaptor
passthrough_traits_base
reverse_adaptor
scan_adaptor
scan_first_adaptor
take_adaptor
take_while_adaptor
array_ptr
range_sequence
repeat_sequence
single_sequence
unfold_sequence
fold_first
to useiterate_while
iterate_while
forsubsequence
iterate_while