55cpp-taskflow works on directed acyclic graphs.
66And here we want to pass information between the flow elements.
77
8- To do so, we see the cpp-taskflow arcs as objects memory where the functions on
9- the nodes read from or write to.
8+ To do so, we see the cpp-taskflow arcs as objects where the functions on the
9+ nodes read from or write to.
1010
11- The function on every node will *read from* the objects of memory of its
12- incoming edges and *write to* the objects of its outcoming edges .
11+ The function on every node will *read from* the objects on the incoming arcs
12+ and *write to* the objects on the outcoming arcs .
1313
1414The cpp-taskflow semantics ensures the synchronization.
1515
1616
17- Nodes without incoming edges will require the input from somewhere else;
18- instead nodes without outcoming edges have to execute some side effects to be
19- useful.
17+ Nodes without incoming arcs will require the input from somewhere else; instead
18+ nodes without outcoming arcs have to execute some side effects to be useful.
2019
2120
22- In this example we fill up (in parallel) two vectors of the results of a fair
23- percentile die and we pick up the maximum values from each cell, and output the
24- result.
21+ In this example we fill up (in parallel) two vectors of the same size with the
22+ results of a fair percentile die, once done we pick up the maximum values from
23+ each cell. Finally we output the result.
2524
2625.----------------.
2726| fill in vector |----|
@@ -38,7 +37,8 @@ The code assumes the taskflow is executed once, when using the Framework
3837feature the programmer needs care to keep the invariants.
3938
4039It is then suggested to use const references (eg., vector<int> const&) for the
41- objects related to the incoming arcs and references for outcoming ones.
40+ objects related to the incoming arcs and non-cost references for outcoming
41+ ones.
4242
4343*/
4444
@@ -94,7 +94,7 @@ class Pick_up_max {
9494 for (std::vector<int >::size_type i{}, e = in1_.size (); i < e; ++i) {
9595 in1_[i] = std::max (in1_[i], in2_[i]);
9696 }
97- // the taskflow is executed once, so we avoid one copy
97+ // the taskflow is executed once, so we avoid one allocation
9898 out_.swap (in1_);
9999 }
100100private:
@@ -143,7 +143,7 @@ int main() {
143143 Print (out)
144144 );
145145
146- // Set up dependencies
146+ // Set up the dependencies
147147 fill_in_vector1.precede (pick_up_max);
148148 fill_in_vector2.precede (pick_up_max);
149149 pick_up_max.precede (print);
0 commit comments