|
EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
|
Where loops run (decisions.md [execution-policies]). More...
Namespaces | |
| namespace | Emrys::execution |
| The library's execution policies: the constant execution::sequential and its type. | |
Concepts | |
| concept | Emrys::ExecutionPolicy |
An execution policy: execution::sequential, a policy of the standard library such as std::execution::par, or a policy of the user's own with a const forEachIndex(count, f) (see Execution policies). | |
Classes | |
| struct | Emrys::execution::Sequential |
| The type of execution::sequential, the default execution policy: plain loops on the calling thread, in index order. More... | |
Variables | |
| constexpr Sequential | Emrys::execution::sequential {} |
| The default execution policy: plain loops on the calling thread, in index order (Sequential). | |
Where loops run (decisions.md [execution-policies]).
An operation whose work grows with a run-time count of elements (a particle set's particles, a grid's cells, a mixture's components, a Monte Carlo estimate's draws) has an overload that takes an execution policy as its first argument, as the standard algorithms do, and the overload without one runs Sequential:
<execution>.std::execution::par or std::execution::par_unseq, runs the loops through std::for_each with that policy. The caller includes <execution>; with GCC's library, a parallel run also links TBB, without which the standard library runs the loop on one thread.i in [0, count), in any order and possibly at once, and returns when every call has. Every loop in the library is built on that one operation. It runs the same chunked loops as a standard policy, so the rest of this list holds for it as for par, except where the scratch comes from. A policy may also have a const get_allocator(), from which the library takes the scratch of its reductions, scans, and compactions, re-bound to each element type, instead of from the heap; it allocates on the calling thread, before or after a loop and never inside one, so that allocator need not be safe to call from several threads. The library calls nothing else on the policy: par_unseq and unseq it must not allocate or synchronize either, which rules out a space of dynamic size.std::execution::seq is a standard policy like the others, not Sequential: it runs on the calling thread but takes the chunked path, so it gives the parallel policies' results bitwise, allocates as they do, and, as the standard says of sequenced_policy, calls the elements in no specified order. It reproduces a parallel run on one thread; Sequential is the plain loops.