Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare > Class Template Reference

Body class used to test if elements in a range are presorted. More...

#include <parallel_sort.h>

Inheritance diagram for tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >:
Collaboration diagram for tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >:

Public Member Functions

 quick_sort_pretest_body (const Compare &_comp)
 
void operator() (const blocked_range< RandomAccessIterator > &range) const
 

Private Attributes

const Compare & comp
 

Detailed Description

template<typename RandomAccessIterator, typename Compare>
class tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >

Body class used to test if elements in a range are presorted.

Definition at line 125 of file parallel_sort.h.

Constructor & Destructor Documentation

◆ quick_sort_pretest_body()

template<typename RandomAccessIterator , typename Compare >
tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >::quick_sort_pretest_body ( const Compare &  _comp)
inline

Definition at line 129 of file parallel_sort.h.

Member Function Documentation

◆ operator()()

template<typename RandomAccessIterator , typename Compare >
void tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >::operator() ( const blocked_range< RandomAccessIterator > &  range) const
inline

Definition at line 131 of file parallel_sort.h.

131  {
132  task &my_task = task::self();
133  RandomAccessIterator my_end = range.end();
134 
135  int i = 0;
136  for (RandomAccessIterator k = range.begin(); k != my_end; ++k, ++i) {
137  if ( i%64 == 0 && my_task.is_cancelled() ) break;
138 
139  // The k-1 is never out-of-range because the first chunk starts at begin+serial_cutoff+1
140  if ( comp( *(k), *(k-1) ) ) {
141  my_task.cancel_group_execution();
142  break;
143  }
144  }
145  }
static task &__TBB_EXPORTED_FUNC self()
The innermost task being executed or destroyed by the current thread at the moment.
Definition: task.cpp:205
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task * task

References tbb::blocked_range< Value >::begin(), tbb::task::cancel_group_execution(), tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >::comp, tbb::blocked_range< Value >::end(), tbb::task::is_cancelled(), and tbb::task::self().

Here is the call graph for this function:

Member Data Documentation

◆ comp

template<typename RandomAccessIterator , typename Compare >
const Compare& tbb::interface9::internal::quick_sort_pretest_body< RandomAccessIterator, Compare >::comp
private

The documentation for this class was generated from the following file:

Copyright © 2005-2019 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.