You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
op::via currently takes an ExecutorFactory, which seems somewhat unintuitive to me. Consider the following from composition_2.cpp:
template<class CPUExecutor, class IOExecutor>
void sugar(CPUExecutor cpu, IOExecutor io) {
// ...
// f on cpu - g on cpu (explicit: the first cpu task runs f and a second cpu task runs g)
cpu |
op::transform([](auto){ return f(); }) |
op::via([cpu]{return cpu;}) |
op::transform([](f_t ft) {return g(ft);}) |
op::submit([](g_t){});
// ...
}
In the simple and common case, I have to write something like op::via([cpu]{return cpu;}).
IIUC, cpu is a TimeSingleDeferred here.
Why doesn't op::via just take (some sort of) Deferred? This would be much cleaner IMHO.
Looking at the code, it doesn't seem like anything fancy is done with the ExecutorFactory. It's just used once.
op::viacurrently takes anExecutorFactory, which seems somewhat unintuitive to me. Consider the following from composition_2.cpp:In the simple and common case, I have to write something like
op::via([cpu]{return cpu;}).IIUC,
cpuis aTimeSingleDeferredhere.Why doesn't
op::viajust take (some sort of)Deferred? This would be much cleaner IMHO.Looking at the code, it doesn't seem like anything fancy is done with the
ExecutorFactory. It's just used once.BONUS QUESTION: We move from the
ExecutorFactoryin this capture, but not in this capture. Why?