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
<divclass="ttc" id="aclasstf_1_1Executor_html"><divclass="ttname"><ahref="classtf_1_1Executor.html">tf::Executor</a></div><divclass="ttdoc">class to create an executor</div><divclass="ttdef"><b>Definition</b> executor.hpp:62</div></div>
222
222
<divclass="ttc" id="aclasstf_1_1Executor_html_a519777f5783981d534e9e53b99712069"><divclass="ttname"><ahref="classtf_1_1Executor.html#a519777f5783981d534e9e53b99712069">tf::Executor::run</a></div><divclass="ttdeci">tf::Future< void > run(Taskflow &taskflow)</div><divclass="ttdoc">runs a taskflow once</div></div>
223
223
<divclass="ttc" id="aclasstf_1_1FlowBuilder_html_a2582a216d54dacca2b7022ea7e89452a"><divclass="ttname"><ahref="classtf_1_1FlowBuilder.html#a2582a216d54dacca2b7022ea7e89452a">tf::FlowBuilder::for_each_by_index</a></div><divclass="ttdeci">Task for_each_by_index(R range, C callable, P part=P())</div><divclass="ttdoc">constructs a parallel-for task over a one-dimensional index range</div></div>
224
-
<divclass="ttc" id="aclasstf_1_1IndexRange_html"><divclass="ttname"><ahref="classtf_1_1IndexRange.html">tf::IndexRange</a></div><divclass="ttdoc">class to create an N-dimensional index range of integral indices</div><divclass="ttdef"><b>Definition</b> iterator.hpp:139</div></div>
224
+
<divclass="ttc" id="aclasstf_1_1IndexRange_html"><divclass="ttname"><ahref="classtf_1_1IndexRange.html">tf::IndexRange</a></div><divclass="ttdoc">class to create an N-dimensional index range of integral indices</div><divclass="ttdef"><b>Definition</b> iterator.hpp:152</div></div>
225
225
<divclass="ttc" id="aclasstf_1_1Taskflow_html"><divclass="ttname"><ahref="classtf_1_1Taskflow.html">tf::Taskflow</a></div><divclass="ttdoc">class to create a taskflow object</div><divclass="ttdef"><b>Definition</b> taskflow.hpp:64</div></div>
226
226
<divclass="ttc" id="anamespacetf_html_a9922bf2ed04b3e630d4e62258d1a4213"><divclass="ttname"><ahref="namespacetf.html#a9922bf2ed04b3e630d4e62258d1a4213">tf::distance</a></div><divclass="ttdeci">constexpr size_t distance(T beg, T end, T step)</div><divclass="ttdoc">calculates the number of iterations in the given index range</div><divclass="ttdef"><b>Definition</b> iterator.hpp:71</div></div>
227
227
</div><!-- fragment --><p>The stateful <code>std::ref(range)</code> is the key to making this work without rebuilding the taskflow each level. The <code>sweep</code> task reads the range at execution time, so updating <code>range</code> with <code>reset</code> before each <code>executor.run</code> call is all that is needed to redirect the parallel loop to the new frontier.</p>
<divclass="ttc" id="aclasstf_1_1Executor_html_a519777f5783981d534e9e53b99712069"><divclass="ttname"><ahref="classtf_1_1Executor.html#a519777f5783981d534e9e53b99712069">tf::Executor::run</a></div><divclass="ttdeci">tf::Future< void > run(Taskflow &taskflow)</div><divclass="ttdoc">runs a taskflow once</div></div>
244
244
<divclass="ttc" id="aclasstf_1_1FlowBuilder_html_a2582a216d54dacca2b7022ea7e89452a"><divclass="ttname"><ahref="classtf_1_1FlowBuilder.html#a2582a216d54dacca2b7022ea7e89452a">tf::FlowBuilder::for_each_by_index</a></div><divclass="ttdeci">Task for_each_by_index(R range, C callable, P part=P())</div><divclass="ttdoc">constructs a parallel-for task over a one-dimensional index range</div></div>
245
-
<divclass="ttc" id="aclasstf_1_1IndexRange_html_a2c4decf957f5e663b3432314ae54c4c1"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#a2c4decf957f5e663b3432314ae54c4c1">tf::IndexRange::dim</a></div><divclass="ttdeci">const IndexRange< T, 1 > & dim(size_t d) const</div><divclass="ttdoc">returns the 1D range for dimension d (read-only)</div><divclass="ttdef"><b>Definition</b> iterator.hpp:190</div></div>
246
-
<divclass="ttc" id="aclasstf_1_1IndexRange_html_a70a09db095224a162768dd1aea24106d"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#a70a09db095224a162768dd1aea24106d">tf::IndexRange< T, 1 >::begin</a></div><divclass="ttdeci">T begin() const</div><divclass="ttdoc">queries the starting index of the range</div><divclass="ttdef"><b>Definition</b> iterator.hpp:510</div></div>
247
-
<divclass="ttc" id="aclasstf_1_1IndexRange_html_ab1a9d8f6e0ad823ab357382d494e9112"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#ab1a9d8f6e0ad823ab357382d494e9112">tf::IndexRange< T, 1 >::step_size</a></div><divclass="ttdeci">T step_size() const</div><divclass="ttdoc">queries the step size of the range</div><divclass="ttdef"><b>Definition</b> iterator.hpp:520</div></div>
248
-
<divclass="ttc" id="aclasstf_1_1IndexRange_html_ad842a8a81b82d02f3ab5343b96c5b0ea"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#ad842a8a81b82d02f3ab5343b96c5b0ea">tf::IndexRange< T, 1 >::end</a></div><divclass="ttdeci">T end() const</div><divclass="ttdoc">queries the ending index of the range</div><divclass="ttdef"><b>Definition</b> iterator.hpp:515</div></div>
245
+
<divclass="ttc" id="aclasstf_1_1IndexRange_html_a2c4decf957f5e663b3432314ae54c4c1"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#a2c4decf957f5e663b3432314ae54c4c1">tf::IndexRange::dim</a></div><divclass="ttdeci">const IndexRange< T, 1 > & dim(size_t d) const</div><divclass="ttdoc">returns the 1D range for dimension d (read-only)</div><divclass="ttdef"><b>Definition</b> iterator.hpp:203</div></div>
246
+
<divclass="ttc" id="aclasstf_1_1IndexRange_html_a70a09db095224a162768dd1aea24106d"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#a70a09db095224a162768dd1aea24106d">tf::IndexRange< T, 1 >::begin</a></div><divclass="ttdeci">T begin() const</div><divclass="ttdoc">queries the starting index of the range</div><divclass="ttdef"><b>Definition</b> iterator.hpp:717</div></div>
247
+
<divclass="ttc" id="aclasstf_1_1IndexRange_html_ab1a9d8f6e0ad823ab357382d494e9112"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#ab1a9d8f6e0ad823ab357382d494e9112">tf::IndexRange< T, 1 >::step_size</a></div><divclass="ttdeci">T step_size() const</div><divclass="ttdoc">queries the step size of the range</div><divclass="ttdef"><b>Definition</b> iterator.hpp:727</div></div>
248
+
<divclass="ttc" id="aclasstf_1_1IndexRange_html_ad842a8a81b82d02f3ab5343b96c5b0ea"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#ad842a8a81b82d02f3ab5343b96c5b0ea">tf::IndexRange< T, 1 >::end</a></div><divclass="ttdeci">T end() const</div><divclass="ttdoc">queries the ending index of the range</div><divclass="ttdef"><b>Definition</b> iterator.hpp:722</div></div>
<divclass="ttc" id="aclasstf_1_1Executor_html_a519777f5783981d534e9e53b99712069"><divclass="ttname"><ahref="classtf_1_1Executor.html#a519777f5783981d534e9e53b99712069">tf::Executor::run</a></div><divclass="ttdeci">tf::Future< void > run(Taskflow &taskflow)</div><divclass="ttdoc">runs a taskflow once</div></div>
207
207
<divclass="ttc" id="aclasstf_1_1FlowBuilder_html_a2582a216d54dacca2b7022ea7e89452a"><divclass="ttname"><ahref="classtf_1_1FlowBuilder.html#a2582a216d54dacca2b7022ea7e89452a">tf::FlowBuilder::for_each_by_index</a></div><divclass="ttdeci">Task for_each_by_index(R range, C callable, P part=P())</div><divclass="ttdoc">constructs a parallel-for task over a one-dimensional index range</div></div>
208
-
<divclass="ttc" id="aclasstf_1_1IndexRange_html_a2c4decf957f5e663b3432314ae54c4c1"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#a2c4decf957f5e663b3432314ae54c4c1">tf::IndexRange::dim</a></div><divclass="ttdeci">const IndexRange< T, 1 > & dim(size_t d) const</div><divclass="ttdoc">returns the 1D range for dimension d (read-only)</div><divclass="ttdef"><b>Definition</b> iterator.hpp:190</div></div>
209
-
<divclass="ttc" id="aclasstf_1_1IndexRange_html_a70a09db095224a162768dd1aea24106d"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#a70a09db095224a162768dd1aea24106d">tf::IndexRange< T, 1 >::begin</a></div><divclass="ttdeci">T begin() const</div><divclass="ttdoc">queries the starting index of the range</div><divclass="ttdef"><b>Definition</b> iterator.hpp:510</div></div>
210
-
<divclass="ttc" id="aclasstf_1_1IndexRange_html_ab1a9d8f6e0ad823ab357382d494e9112"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#ab1a9d8f6e0ad823ab357382d494e9112">tf::IndexRange< T, 1 >::step_size</a></div><divclass="ttdeci">T step_size() const</div><divclass="ttdoc">queries the step size of the range</div><divclass="ttdef"><b>Definition</b> iterator.hpp:520</div></div>
211
-
<divclass="ttc" id="aclasstf_1_1IndexRange_html_ad842a8a81b82d02f3ab5343b96c5b0ea"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#ad842a8a81b82d02f3ab5343b96c5b0ea">tf::IndexRange< T, 1 >::end</a></div><divclass="ttdeci">T end() const</div><divclass="ttdoc">queries the ending index of the range</div><divclass="ttdef"><b>Definition</b> iterator.hpp:515</div></div>
208
+
<divclass="ttc" id="aclasstf_1_1IndexRange_html_a2c4decf957f5e663b3432314ae54c4c1"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#a2c4decf957f5e663b3432314ae54c4c1">tf::IndexRange::dim</a></div><divclass="ttdeci">const IndexRange< T, 1 > & dim(size_t d) const</div><divclass="ttdoc">returns the 1D range for dimension d (read-only)</div><divclass="ttdef"><b>Definition</b> iterator.hpp:203</div></div>
209
+
<divclass="ttc" id="aclasstf_1_1IndexRange_html_a70a09db095224a162768dd1aea24106d"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#a70a09db095224a162768dd1aea24106d">tf::IndexRange< T, 1 >::begin</a></div><divclass="ttdeci">T begin() const</div><divclass="ttdoc">queries the starting index of the range</div><divclass="ttdef"><b>Definition</b> iterator.hpp:717</div></div>
210
+
<divclass="ttc" id="aclasstf_1_1IndexRange_html_ab1a9d8f6e0ad823ab357382d494e9112"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#ab1a9d8f6e0ad823ab357382d494e9112">tf::IndexRange< T, 1 >::step_size</a></div><divclass="ttdeci">T step_size() const</div><divclass="ttdoc">queries the step size of the range</div><divclass="ttdef"><b>Definition</b> iterator.hpp:727</div></div>
211
+
<divclass="ttc" id="aclasstf_1_1IndexRange_html_ad842a8a81b82d02f3ab5343b96c5b0ea"><divclass="ttname"><ahref="classtf_1_1IndexRange.html#ad842a8a81b82d02f3ab5343b96c5b0ea">tf::IndexRange< T, 1 >::end</a></div><divclass="ttdeci">T end() const</div><divclass="ttdoc">queries the ending index of the range</div><divclass="ttdef"><b>Definition</b> iterator.hpp:722</div></div>
<divclass="ttc" id="aclasstf_1_1IndexRange_html"><divclass="ttname"><ahref="classtf_1_1IndexRange.html">tf::IndexRange</a></div><divclass="ttdoc">class to create an N-dimensional index range of integral indices</div><divclass="ttdef"><b>Definition</b> iterator.hpp:139</div></div>
239
+
<divclass="ttc" id="aclasstf_1_1IndexRange_html"><divclass="ttname"><ahref="classtf_1_1IndexRange.html">tf::IndexRange</a></div><divclass="ttdoc">class to create an N-dimensional index range of integral indices</div><divclass="ttdef"><b>Definition</b> iterator.hpp:152</div></div>
240
240
<divclass="ttc" id="aclasstf_1_1Taskflow_html"><divclass="ttname"><ahref="classtf_1_1Taskflow.html">tf::Taskflow</a></div><divclass="ttdoc">class to create a taskflow object</div><divclass="ttdef"><b>Definition</b> taskflow.hpp:64</div></div>
241
241
</div><!-- fragment --><h1><aclass="anchor" id="Stencil3DConditionTask"></a>
<divclass="line"> [](<spanclass="keywordtype">int</span> i) { return i == -1; },</div>
382
382
<divclass="line"> guided_partitioner</div>
383
383
<divclass="line">);</div>
384
-
<divclass="ttc" id="aclasstf_1_1GuidedPartitioner_html"><divclass="ttname"><ahref="classtf_1_1GuidedPartitioner.html">tf::GuidedPartitioner</a></div><divclass="ttdoc">class to create a guided partitioner for scheduling parallel algorithms</div><divclass="ttdef"><b>Definition</b> partitioner.hpp:402</div></div>
384
+
<divclass="ttc" id="aclasstf_1_1GuidedPartitioner_html"><divclass="ttname"><ahref="classtf_1_1GuidedPartitioner.html">tf::GuidedPartitioner</a></div><divclass="ttdoc">class to create a guided partitioner for scheduling parallel algorithms</div><divclass="ttdef"><b>Definition</b> partitioner.hpp:408</div></div>
385
385
<divclass="ttc" id="aclasstf_1_1StaticPartitioner_html"><divclass="ttname"><ahref="classtf_1_1StaticPartitioner.html">tf::StaticPartitioner</a></div><divclass="ttdoc">class to construct a static partitioner for scheduling parallel algorithms</div><divclass="ttdef"><b>Definition</b> partitioner.hpp:262</div></div>
386
386
</div><!-- fragment --><p>As a rule of thumb, prefer <aclass="el" href="classtf_1_1StaticPartitioner.html" title="class to construct a static partitioner for scheduling parallel algorithms">tf::StaticPartitioner</a> when the predicate or comparator costs the same for every element and <aclass="el" href="classtf_1_1GuidedPartitioner.html" title="class to create a guided partitioner for scheduling parallel algorithms">tf::GuidedPartitioner</a> for irregular workloads where evaluation cost varies across elements. <aclass="el" href="classtf_1_1DynamicPartitioner.html" title="class to create a dynamic partitioner for scheduling parallel algorithms">tf::DynamicPartitioner</a> is a good choice when chunks must be kept small and strictly equal in size.</p>
387
387
<dlclass="section note"><dt>Note</dt><dd>By default, parallel-find tasks use <aclass="el" href="namespacetf.html#ace2c5adcd5039483eebb6dbdbb6f33e3" title="default partitioner set to tf::GuidedPartitioner">tf::DefaultPartitioner</a> (currently <aclass="el" href="classtf_1_1GuidedPartitioner.html" title="class to create a guided partitioner for scheduling parallel algorithms">tf::GuidedPartitioner</a>) if no partitioner is specified. </dd></dl>
0 commit comments