17 #ifndef __TBB_parallel_for_H
18 #define __TBB_parallel_for_H
20 #define __TBB_parallel_for_H_include_area
32 namespace interface9 {
41 template<
typename Range,
typename Body,
typename Partitioner>
55 start_for(
const Range& range,
const Body& body, Partitioner& partitioner ) :
83 static void run(
const Range& range,
const Body& body, Partitioner& partitioner ) {
84 if( !range.empty() ) {
85 #if !__TBB_TASK_GROUP_CONTEXT || TBB_JOIN_OUTER_TASK_GROUP
100 #if __TBB_TASK_GROUP_CONTEXT
102 if( !range.empty() ) {
114 fgt_alg_begin_body( tbb::internal::PARALLEL_FOR_TASK, (
void *)
const_cast<Body*
>(&(this->my_body)), (
void*)
this );
120 void offer_work(
typename Partitioner::split_type& split_obj) {
139 template<
typename Range,
typename Body,
typename Partitioner>
141 my_partition.check_being_stolen( *
this );
142 my_partition.
execute(*
this, my_range);
154 template<
typename Function,
typename Index>
172 #if __TBB_ASSERT_ON_VECTORIZATION_FAILURE
173 #pragma vector always assert
176 for ( Index i = b; i < e; ++i, k += ms ) {
199 template<
typename Range,
typename Body>
206 template<
typename Range,
typename Body>
213 template<
typename Range,
typename Body>
220 template<
typename Range,
typename Body>
227 template<
typename Range,
typename Body>
232 #if __TBB_TASK_GROUP_CONTEXT
235 template<
typename Range,
typename Body>
242 template<
typename Range,
typename Body>
249 template<
typename Range,
typename Body>
256 template<
typename Range,
typename Body>
263 template<
typename Range,
typename Body>
270 namespace strict_ppl {
273 template <
typename Index,
typename Function,
typename Partitioner>
280 Index
end = (
last -
first - Index(1)) / step + Index(1);
288 template <
typename Index,
typename Function>
293 template <
typename Index,
typename Function>
295 parallel_for_impl<Index,Function,const simple_partitioner>(
first,
last, step, f, partitioner);
298 template <
typename Index,
typename Function>
300 parallel_for_impl<Index,Function,const auto_partitioner>(
first,
last, step, f, partitioner);
303 template <
typename Index,
typename Function>
305 parallel_for_impl<Index,Function,const static_partitioner>(
first,
last, step, f, partitioner);
308 template <
typename Index,
typename Function>
314 template <
typename Index,
typename Function>
319 template <
typename Index,
typename Function>
321 parallel_for_impl<Index,Function,const simple_partitioner>(
first,
last,
static_cast<Index
>(1), f, partitioner);
324 template <
typename Index,
typename Function>
326 parallel_for_impl<Index,Function,const auto_partitioner>(
first,
last,
static_cast<Index
>(1), f, partitioner);
329 template <
typename Index,
typename Function>
331 parallel_for_impl<Index,Function,const static_partitioner>(
first,
last,
static_cast<Index
>(1), f, partitioner);
334 template <
typename Index,
typename Function>
339 #if __TBB_TASK_GROUP_CONTEXT
340 template <
typename Index,
typename Function,
typename Partitioner>
347 Index
end = (
last -
first - Index(1)) / step + Index(1);
355 template <
typename Index,
typename Function>
360 template <
typename Index,
typename Function>
362 parallel_for_impl<Index,Function,const simple_partitioner>(
first,
last, step, f, partitioner, context);
365 template <
typename Index,
typename Function>
367 parallel_for_impl<Index,Function,const auto_partitioner>(
first,
last, step, f, partitioner, context);
370 template <
typename Index,
typename Function>
372 parallel_for_impl<Index,Function,const static_partitioner>(
first,
last, step, f, partitioner, context);
375 template <
typename Index,
typename Function>
382 template <
typename Index,
typename Function>
384 parallel_for_impl<Index,Function,const auto_partitioner>(
first,
last,
static_cast<Index
>(1), f,
auto_partitioner(), context);
387 template <
typename Index,
typename Function>
389 parallel_for_impl<Index,Function,const simple_partitioner>(
first,
last,
static_cast<Index
>(1), f, partitioner, context);
392 template <
typename Index,
typename Function>
394 parallel_for_impl<Index,Function,const auto_partitioner>(
first,
last,
static_cast<Index
>(1), f, partitioner, context);
397 template <
typename Index,
typename Function>
399 parallel_for_impl<Index,Function,const static_partitioner>(
first,
last,
static_cast<Index
>(1), f, partitioner, context);
402 template <
typename Index,
typename Function>
416 #if TBB_PREVIEW_SERIAL_SUBSET
417 #define __TBB_NORMAL_EXECUTION
418 #include "../serial/tbb/parallel_for.h"
419 #undef __TBB_NORMAL_EXECUTION
423 #undef __TBB_parallel_for_H_include_area