11/*
2- Copyright 2005-2013 Intel Corporation. All Rights Reserved.
2+ Copyright 2005-2014 Intel Corporation. All Rights Reserved.
33
44 This file is part of Threading Building Blocks.
55
5151
5252namespace tbb {
5353namespace serial {
54- namespace interface6 {
54+ namespace interface7 {
5555
5656// parallel_for serial annotated implementation
5757
@@ -72,10 +72,10 @@ class start_for : tbb::internal::no_copy {
7272
7373 // ! Splitting constructor used to generate children.
7474 /* * this becomes left child. Newly constructed object is right child. */
75- start_for ( start_for& parent_, split ) :
76- my_range ( parent_.my_range, split() ),
75+ start_for ( start_for& parent_, typename Partitioner::split_type& split_obj ) :
76+ my_range ( parent_.my_range, split_obj ),
7777 my_body ( parent_.my_body ),
78- my_partition ( parent_.my_partition, split() )
78+ my_partition ( parent_.my_partition, split_obj )
7979 {
8080 }
8181
@@ -94,14 +94,15 @@ class start_for : tbb::internal::no_copy {
9494
9595template < typename Range, typename Body, typename Partitioner >
9696void start_for< Range, Body, Partitioner >::execute() {
97- if ( !my_range.is_divisible () || !my_partition.divisions_left () ) {
97+ if ( !my_range.is_divisible () || !my_partition.is_divisible () ) {
9898 ANNOTATE_TASK_BEGIN ( tbb_parallel_for_range );
9999 {
100100 my_body ( my_range );
101101 }
102102 ANNOTATE_TASK_END ( tbb_parallel_for_range );
103103 } else {
104- start_for b ( *this , split () );
104+ typename Partitioner::split_type split_obj;
105+ start_for b ( *this , split_obj );
105106 this ->execute (); // Execute the left interval first to keep the serial order.
106107 b.execute (); // Execute the right interval then.
107108 }
@@ -111,28 +112,28 @@ void start_for< Range, Body, Partitioner >::execute() {
111112/* * @ingroup algorithms **/
112113template <typename Range, typename Body>
113114void parallel_for ( const Range& range, const Body& body ) {
114- serial::interface6 ::start_for<Range,Body,const __TBB_DEFAULT_PARTITIONER>::run (range,body,__TBB_DEFAULT_PARTITIONER ());
115+ serial::interface7 ::start_for<Range,Body,const __TBB_DEFAULT_PARTITIONER>::run (range,body,__TBB_DEFAULT_PARTITIONER ());
115116}
116117
117118// ! Parallel iteration over range with simple partitioner.
118119/* * @ingroup algorithms **/
119120template <typename Range, typename Body>
120121void parallel_for ( const Range& range, const Body& body, const simple_partitioner& partitioner ) {
121- serial::interface6 ::start_for<Range,Body,const simple_partitioner>::run (range,body,partitioner);
122+ serial::interface7 ::start_for<Range,Body,const simple_partitioner>::run (range,body,partitioner);
122123}
123124
124125// ! Parallel iteration over range with auto_partitioner.
125126/* * @ingroup algorithms **/
126127template <typename Range, typename Body>
127128void parallel_for ( const Range& range, const Body& body, const auto_partitioner& partitioner ) {
128- serial::interface6 ::start_for<Range,Body,const auto_partitioner>::run (range,body,partitioner);
129+ serial::interface7 ::start_for<Range,Body,const auto_partitioner>::run (range,body,partitioner);
129130}
130131
131132// ! Parallel iteration over range with affinity_partitioner.
132133/* * @ingroup algorithms **/
133134template <typename Range, typename Body>
134135void parallel_for ( const Range& range, const Body& body, affinity_partitioner& partitioner ) {
135- serial::interface6 ::start_for<Range,Body,affinity_partitioner>::run (range,body,partitioner);
136+ serial::interface7 ::start_for<Range,Body,affinity_partitioner>::run (range,body,partitioner);
136137}
137138
138139// ! Implementation of parallel iteration over stepped range of integers with explicit step and partitioner (ignored)
@@ -194,14 +195,14 @@ void parallel_for(Index first, Index last, const Function& f, affinity_partition
194195 parallel_for_impl (first, last, static_cast <Index>(1 ), f, p);
195196}
196197
197- } // namespace interface6
198+ } // namespace interface7
198199
199- using interface6 ::parallel_for;
200+ using interface7 ::parallel_for;
200201
201202} // namespace serial
202203
203204#ifndef __TBB_NORMAL_EXECUTION
204- using serial::interface6 ::parallel_for;
205+ using serial::interface7 ::parallel_for;
205206#endif
206207
207208} // namespace tbb
0 commit comments