]> git.sesse.net Git - casparcg/blobdiff - tbb/include/tbb/parallel_sort.h
2.0. Updated tbb library.
[casparcg] / tbb / include / tbb / parallel_sort.h
index 00500460aa0035c5a2078f03a7a559f702ef256d..cdfbb6102b4edddeb0c3667a8b37fdc5d83066a5 100644 (file)
@@ -111,6 +111,7 @@ partition:
     }
 };
 
+#if __TBB_TASK_GROUP_CONTEXT
 //! Body class used to test if elements in a range are presorted
 /** @ingroup algorithms */
 template<typename RandomAccessIterator, typename Compare>
@@ -137,6 +138,7 @@ public:
     }
 
 };
+#endif /* __TBB_TASK_GROUP_CONTEXT */
 
 //! Body class used to sort elements in a range that is smaller than the grainsize.
 /** @ingroup algorithms */
@@ -152,6 +154,7 @@ struct quick_sort_body {
 /** @ingroup algorithms */
 template<typename RandomAccessIterator, typename Compare>
 void parallel_quick_sort( RandomAccessIterator begin, RandomAccessIterator end, const Compare& comp ) {
+#if __TBB_TASK_GROUP_CONTEXT
     task_group_context my_context;
     const int serial_cutoff = 9;
 
@@ -170,6 +173,7 @@ void parallel_quick_sort( RandomAccessIterator begin, RandomAccessIterator end,
 
     if (my_context.is_group_execution_cancelled())
 do_parallel_quick_sort:
+#endif /* __TBB_TASK_GROUP_CONTEXT */
         parallel_for( quick_sort_range<RandomAccessIterator,Compare>(begin, end-begin, comp ), 
                       quick_sort_body<RandomAccessIterator,Compare>(),
                       auto_partitioner() );