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 121 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 125 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 127 of file parallel_sort.h.

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

127  {
128  task &my_task = task::self();
129  RandomAccessIterator my_end = range.end();
130 
131  int i = 0;
132  for (RandomAccessIterator k = range.begin(); k != my_end; ++k, ++i) {
133  if ( i%64 == 0 && my_task.is_cancelled() ) break;
134 
135  // The k-1 is never out-of-range because the first chunk starts at begin+serial_cutoff+1
136  if ( comp( *(k), *(k-1) ) ) {
137  my_task.cancel_group_execution();
138  break;
139  }
140  }
141  }
static task &__TBB_EXPORTED_FUNC self()
The innermost task being executed or destroyed by the current thread at the moment.
Definition: task.cpp:201
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
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

Definition at line 122 of file parallel_sort.h.


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.