__gnu_parallel(3)
๐
__gnu_parallel โ GNU parallel code for public use ๐
okay bestie, sit down, hydrate, and let me tell you about __gnu_parallel ๐ this is the page from section 3 of the Library Functions Manual, and it's literally the GNU parallel code for public use โ all the shared machinery that makes GNU's parallel algorithms go brrr โก
it's giving "one header, a hundred little helper types, and every single one of them matters" ๐ซถ so let's do this properly, no skimming, no skipping. iykyk ๐ธ
๐ NAME ๐
__gnu_parallel โ GNU parallel code for public use.
โจ SYNOPSIS โจ
this is the cast list, bestie โ every class, typedef and enum that lives in here. buckle up, it's a big friend group ๐
๐ Classes ๐
struct __accumulate_binop_reductโ general reduction, powered by a binary operator ๐งฎstruct __accumulate_selectorโ the selector forstd::accumulate()โจstruct __adjacent_difference_selectorโ hands you back the difference between two adjacent__elements๐ซstruct __adjacent_find_selectorโ runs a predicate over two elements that are sitting right next to each other ๐ฏclass __binder1stโ basicallystd::binder1st, except it spells the argument types out loud, no guessing ๐class __binder2ndโstd::binder2nd's cousin, argument types stated explicitly ๐struct __count_if_selectorโ the selector forstd::count_if ()๐ขstruct __count_selectorโ the selector forstd::count()๐ขstruct __fill_selectorโ the selector forstd::fill()๐ชฃstruct __find_first_of_selectorโ tests a predicate on several elements at once ๐struct __find_if_selectorโ tests a predicate on one single element; this is the onestd::find()andstd::find_if ()roll with ๐struct __for_each_selectorโ the selector forstd::for_each()๐struct __generate_selectorโ the selector forstd::generate()๐ฑstruct __generic_find_selectorโ the base class of all__gnu_parallel::__find_templateselectors, the founding mother ๐struct __generic_for_each_selectorโ the generic__selectorfor embarrassingly parallel functions ๐struct __identity_selectorโ a selector that just returns the iterator you handed it, that's it, that's the whole job ๐ชstruct __inner_product_selectorโ the selector forstd::inner_product()โ๏ธstruct __max_element_reductโ reduction for finding the maximum element, using a comparator ๐struct __min_element_reductโ reduction for finding the maximum element, using a comparator ๐struct __mismatch_selectorโ tests an inverted predicate on a single element ๐struct __multiway_merge_3_variant_sentinel_switchโ the switch for 3-way merging with__sentinelsturned off ๐struct __multiway_merge_3_variant_sentinel_switch< true, _RAIterIterator, _RAIter3, _DifferenceTp, _Compare >โ the switch for 3-way merging with__sentinelsturned on ๐struct __multiway_merge_4_variant_sentinel_switchโ the switch for 4-way merging with__sentinelsturned off ๐struct __multiway_merge_4_variant_sentinel_switch< true, _RAIterIterator, _RAIter3, _DifferenceTp, _Compare >โ the switch for 4-way merging with__sentinelsturned on ๐struct __multiway_merge_k_variant_sentinel_switchโ the switch for k-way merging with__sentinelsturned on ๐struct __multiway_merge_k_variant_sentinel_switch< false, __stable, _RAIterIterator, _RAIter3, _DifferenceTp, _Compare >โ the switch for k-way merging with__sentinelsturned off ๐struct __replace_if_selectorโ the selector forstd::replace()โป๏ธstruct __replace_selectorโ the selector forstd::replace()โป๏ธstruct __transform1_selectorโ thestd::transform()__selector, one-input-sequence flavour โจstruct __transform2_selectorโ thestd::transform()__selector, two-input-sequences flavour โจclass __unary_negateโ likestd::unary_negate, but the argument types are given explicitly ๐ซstruct _DRandomShufflingGlobalDataโ data that every thread taking part in__gnu_parallel::__parallel_random_shuffle()knows about ๐struct _DRSSorterPUโ local data for one thread participating in__gnu_parallel::__parallel_random_shuffle()๐struct _DummyReductโ a reduction function that does absolutely nothing ๐class _EqualFromLessโ constructs a predicate for equality out of a strict weak ordering predicate ๐struct _EqualToโ likestd::equal_to, except it's chill with two different types ๐class _GuardedIteratorโ an_Iteratorwrapper that carries an implicit supremum at the end of the sequence, and that supremum dominates every single comparison ๐class _IteratorPairโ a pair of iterators; the usual iterator operations get applied to both child iterators ๐ฏclass _IteratorTripleโ a triple of iterators; the usual iterator operations get applied to all three child iterators ๐ฏ๐ฏstruct _Jobโ one__jobfor a certain thread ๐งพstruct _Lessโ likestd::less, except it allows two different types ๐คclass _Lexicographicโ compares__apair of types lexicographically, ascending ๐คclass _LexicographicReverseโ compares__apair of types lexicographically, descending ๐คclass _LoserTreeโ the stable_LoserTreevariant ๐ณclass _LoserTree< false, _Tp, _Compare >โ the unstable_LoserTreevariant ๐ณclass _LoserTreeBaseโ guarded loser/tournament tree ๐ณclass _LoserTreePointerโ stable_LoserTreeimplementation ๐ณclass _LoserTreePointer< false, _Tp, _Compare >โ unstable_LoserTreeimplementation ๐ณclass _LoserTreePointerBaseโ base class of the _Loser Tree implementation that uses pointers ๐class _LoserTreePointerUnguardedโ stable unguarded_LoserTreevariant that stores pointers ๐ฏclass _LoserTreePointerUnguarded< false, _Tp, _Compare >โ unstable unguarded_LoserTreevariant that stores pointers ๐ฏclass _LoserTreePointerUnguardedBaseโ unguarded loser tree that keeps only pointers to the elements in the tree structure ๐ฏstruct _LoserTreeTraitsโ traits that figure out whether the loser tree should be using pointers or copies ๐คclass _LoserTreeUnguardedโ stable implementation of the unguarded_LoserTree๐ณclass _LoserTreeUnguarded< false, _Tp, _Compare >โ non-stable implementation of the unguarded_LoserTree๐ณclass _LoserTreeUnguardedBaseโ base class for the unguarded_LoserTreeimplementation ๐ณstruct _Multipliesโ likestd::multiplies, except it allows two different types โ๏ธstruct _Nothingโ a functor doing nothing ๐ซฅstruct _Pieceโ subsequence description ๐งฉstruct _Plusโ likestd::plus, except it allows two different types โstruct _PMWMSSortingDataโ data accessed by all threads ๐๏ธclass _PseudoSequenceโ a sequence that conceptually consists of multiple copies of the same element; the copies are not stored explicitly, of course ๐class _PseudoSequenceIteratorโ the_Iteratorassociated with__gnu_parallel::_PseudoSequence; it features the usual random-access iterator functionality โจstruct _QSBThreadLocalโ information local to one thread in the parallel quicksort run ๐งตclass _RandomNumberโ random number generator, based on the Mersenne twister ๐ฒclass _RestrictedBoundedConcurrentQueueโ a double-ended queue of bounded size that allows lock-free atomic access.push_front()andpop_front()must not be called concurrently with each other, whilepop_back()can be called concurrently at all times.empty(),size(), andtop()are intentionally not provided โ calling them would not make sense in a concurrent setting ๐ฆstruct _SamplingSorterโ stable sorting functor ๐struct _SamplingSorter< false, _RAIter, _StrictWeakOrdering >โ non-__stablesorting functor ๐struct _Settingsโclass _Settingsrun-time settings for the parallel mode, including all the tunable parameters โ๏ธstruct _SplitConsistentlyโ split consistently โ๏ธstruct _SplitConsistently< false, _RAIter, _Compare, _SortingPlacesIterator >โ split by sampling โ๏ธstruct _SplitConsistently< true, _RAIter, _Compare, _SortingPlacesIterator >โ split by exact splitting โ๏ธstruct balanced_quicksort_tagโ forces parallel sorting using balanced quicksort at compile time โ๏ธstruct balanced_tagโ recommends parallel execution using dynamic load-balancing at compile time โ๏ธstruct constant_size_blocks_tagโ selects the constant block size variant forstd::find()๐งฑstruct default_parallel_tagโ recommends parallel execution using the default parallel algorithm ๐ฏstruct equal_split_tagโ selects the equal splitting variant forstd::find()โ๏ธstruct exact_tagโ forces parallel merging with exact splitting, at compile time ๐ฏstruct find_tagโ base class for thestd::find()variants ๐งฌstruct growing_blocks_tagโ selects the growing block size variant forstd::find()๐ฑstruct multiway_mergesort_exact_tagโ forces parallel sorting using multiway mergesort with exact splitting at compile time ๐struct multiway_mergesort_sampling_tagโ forces parallel sorting using multiway mergesort with splitting by sampling at compile time ๐struct multiway_mergesort_tagโ forces parallel sorting using multiway mergesort at compile time ๐struct omp_loop_static_tagโ recommends parallel execution using OpenMP static load-balancing at compile time ๐struct omp_loop_tagโ recommends parallel execution using OpenMP dynamic load-balancing at compile time ๐struct parallel_tagโ recommends parallel execution at compile time, optionally using a user-specified number of threads ๐งตstruct quicksort_tagโ forces parallel sorting using unbalanced quicksort at compile time โกstruct sampling_tagโ forces parallel merging with exact splitting, at compile time ๐ฒstruct sequential_tagโ forces sequential execution at compile time ๐ขstruct unbalanced_tagโ recommends parallel execution using static load-balancing at compile time ๐ข
๐ Typedefs ๐
typedef unsigned short _BinIndexโ a type to hold the index of a bin ๐๏ธtypedef int64_t _CASableโ the longest compare-and-swappable integer type on this platform ๐typedef uint64_t _SequenceIndexโ unsigned integer for indexing__elements; the total number of elements for each algorithm has to fit into this type ๐typedef uint16_t _ThreadIndexโ unsigned integer for indexing a thread number; the maximum thread number (for each processor) has to fit into this type ๐งต
๐ Enumerations ๐
enum _AlgorithmStrategy { heuristic, force_sequential, force_parallel }โ strategies for run-time algorithm selection ๐งenum _FindAlgorithm { GROWING_BLOCKS, CONSTANT_SIZE_BLOCKS, EQUAL_SPLIT }โ find algorithms ๐enum _MultiwayMergeAlgorithm { LOSER_TREE }โ merging algorithms ๐enum _Parallelism { sequential, parallel_unbalanced, parallel_balanced, parallel_omp_loop, parallel_omp_loop_static, parallel_taskqueue }โ the run-time equivalents for the compile-time tags โ๏ธenum _PartialSumAlgorithm { RECURSIVE, LINEAR }โ partial sum algorithms: recursive, linear โenum _SortAlgorithm { MWMS, QS, QS_BALANCED }โ sorting algorithms ๐enum _SplittingAlgorithm { SAMPLING, EXACT }โ sorting/merging algorithms: sampling,__exactโ๏ธ
bestie this is literally part one of ten, so don't you dare think we're done ๐ there is so much more of this page coming โจ
โจ Functions โจ
the function lineup, exact signatures only, no skips. every option and detail stays, only the vibe is upgraded. ๐
__add_ompโ no description in the source, just this exact signature:
template<typename _Tp> _Tp __add_omp (volatile _Tp *__ptr, _Tp __addend)
__calc_bordersโ precalculates__advancesfor the Knuth-Morris-Pratt algorithm. string-matching prep fr fr.
template<typename _RAIter, typename _DifferenceTp> void __calc_borders
(_RAIter __elements, _DifferenceTp __length, _DifferenceTp *__off)
__cas_ompโ no description, exact signature:
template<typename _Tp> bool __cas_omp (volatile _Tp *__ptr, _Tp
__comparand, _Tp __replacement)
__compare_and_swapโ compare-and-swap. that's the whole vibe.
template<typename _Tp> bool __compare_and_swap (volatile _Tp *__ptr, _Tp
__comparand, _Tp __replacement)
__copy_tailโ no description, exact signature:
template<typename _IIter, typename _OutputIterator> _OutputIterator
__copy_tail (std::pair< _IIter, _IIter > __b, std::pair< _IIter,
_IIter > __e, _OutputIterator __r)
__decode2โ decodes two integers from onegnu_parallel::_CASable. cute.
void __decode2 (_CASable __x, int &__a, int &__b)
__determine_samplesโ selects_M_samplesfrom a sequence. periodt.
template<typename _RAIter, typename _DifferenceTp> void
__determine_samples (_PMWMSSortingData< _RAIter > *__sd,
_DifferenceTp __num_samples)
__encode2โ encodes two integers into onegnu_parallel::_CASable. the reverse of decode, slay.
_CASable __encode2 (int __a, int __b)
__equally_splitโ function to split a sequence into parts of almost equal size. lowkey the group project splitter.
template<typename _DifferenceType, typename _OutputIterator>
_OutputIterator __equally_split (_DifferenceType __n, _ThreadIndex
__num_threads, _OutputIterator __s)
__equally_split_pointโ function to split a sequence into parts of almost equal size. same energy, different return.
template<typename _DifferenceType> _DifferenceType __equally_split_point
(_DifferenceType __n, _ThreadIndex __num_threads, _ThreadIndex
__thread_no)
__fetch_and_addโ add a value to a variable, atomically. no cap, atomicity is the moment.
template<typename _Tp> _Tp __fetch_and_add (volatile _Tp *__ptr, _Tp
__addend)
__find_templateโ parallelstd::find, switch for different algorithms. the main character of find.
template<typename _RAIter1, typename _RAIter2, typename _Pred, typename
_Selector> std::pair< _RAIter1, _RAIter2 > __find_template (_RAIter1
__begin1, _RAIter1 __end1, _RAIter2 __begin2, _Pred __pred,
_Selector __selector)
__find_template(constant_size_blocks_tag) โ parallelstd::find, constant block size variant. blocks stay same size, consistency queen.
template<typename _RAIter1, typename _RAIter2, typename _Pred, typename
_Selector> std::pair< _RAIter1, _RAIter2 > __find_template (_RAIter1
__begin1, _RAIter1 __end1, _RAIter2 __begin2, _Pred __pred,
_Selector __selector, constant_size_blocks_tag)
__find_template(equal_split_tag) โ parallelstd::find, equal splitting variant. everyone gets a fair slice.
template<typename _RAIter1, typename _RAIter2, typename _Pred, typename
_Selector> std::pair< _RAIter1, _RAIter2 > __find_template (_RAIter1
__begin1, _RAIter1 __end1, _RAIter2 __begin2, _Pred __pred,
_Selector __selector, equal_split_tag)
__find_template(growing_blocks_tag) โ parallelstd::find, growing block size variant. blocks start small and grow, it's giving adaptive.
template<typename _RAIter1, typename _RAIter2, typename _Pred, typename
_Selector> std::pair< _RAIter1, _RAIter2 > __find_template (_RAIter1
__begin1, _RAIter1 __end1, _RAIter2 __begin2, _Pred __pred,
_Selector __selector, growing_blocks_tag)
__for_each_template_random_accessโ chose the desired algorithm by evaluating__parallelism_tag. it's the picker.
template<typename _IIter, typename _UserOp, typename _Functionality,
typename _Red, typename _Result> _UserOp
__for_each_template_random_access (_IIter __begin, _IIter __end,
_UserOp __user_op, _Functionality &__functionality, _Red
__reduction, _Result __reduction_start, _Result &__output, typename
std::iterator_traits< _IIter >::difference_type __bound,
_Parallelism __parallelism_tag)
__for_each_template_random_access_edโ embarrassingly parallel algorithm for random access iterators, using hand-crafted parallelization by equal splitting the work. hand-crafted? we love a bespoke moment.
template<typename _RAIter, typename _Op, typename _Fu, typename _Red,
typename _Result> _Op __for_each_template_random_access_ed (_RAIter
__begin, _RAIter __end, _Op __o, _Fu &__f, _Red __r, _Result __base,
_Result &__output, typename std::iterator_traits< _RAIter
>::difference_type __bound)
__for_each_template_random_access_omp_loopโ embarrassingly parallel algorithm for random access iterators, using an OpenMP for loop. OpenMP said let me handle this.
template<typename _RAIter, typename _Op, typename _Fu, typename _Red,
typename _Result> _Op __for_each_template_random_access_omp_loop
(_RAIter __begin, _RAIter __end, _Op __o, _Fu &__f, _Red __r,
_Result __base, _Result &__output, typename std::iterator_traits<
_RAIter >::difference_type __bound)
__for_each_template_random_access_omp_loop_staticโ embarrassingly parallel algorithm for random access iterators, using an OpenMP for loop with static scheduling. static scheduling, she's stable.
template<typename _RAIter, typename _Op, typename _Fu, typename _Red,
typename _Result> _Op
__for_each_template_random_access_omp_loop_static (_RAIter __begin,
_RAIter __end, _Op __o, _Fu &__f, _Red __r, _Result __base, _Result
&__output, typename std::iterator_traits< _RAIter >::difference_type
__bound)
__for_each_template_random_access_workstealingโ work stealing algorithm for random access iterators. stealing work but make it collaborative. ๐
template<typename _RAIter, typename _Op, typename _Fu, typename _Red,
typename _Result> _Op __for_each_template_random_access_workstealing
(_RAIter __begin, _RAIter __end, _Op __op, _Fu &__f, _Red __r,
_Result __base, _Result &__output, typename std::iterator_traits<
_RAIter >::difference_type __bound)
__get_max_threadsโ no description, exact signature:
_ThreadIndex __get_max_threads ()
__is_parallelโ no description, exact signature:
bool __is_parallel (const _Parallelism __p)
__is_sortedโ check whether[__begin, __end)is sorted according to__comp. the vibe check for order.
template<typename _IIter, typename _Compare> bool __is_sorted (_IIter
__begin, _IIter __end, _Compare __comp)
__median_of_three_iteratorsโ compute the median of three referenced elements, according to__comp. middle child energy.
template<typename _RAIter, typename _Compare> _RAIter
__median_of_three_iterators (_RAIter __a, _RAIter __b, _RAIter __c,
_Compare __comp)
__merge_advanceโ merge routine being able to merge only the__max_lengthsmallest elements. only the smallest, we're selective.
template<typename _RAIter1, typename _RAIter2, typename _OutputIterator,
typename _DifferenceTp, typename _Compare> _OutputIterator
__merge_advance (_RAIter1 &__begin1, _RAIter1 __end1, _RAIter2
&__begin2, _RAIter2 __end2, _OutputIterator __target, _DifferenceTp
__max_length, _Compare __comp)
__merge_advance_movcโ merge routine being able to merge only the__max_lengthsmallest elements. same brief, different implementation.
template<typename _RAIter1, typename _RAIter2, typename _OutputIterator,
typename _DifferenceTp, typename _Compare> _OutputIterator
__merge_advance_movc (_RAIter1 &__begin1, _RAIter1 __end1, _RAIter2
&__begin2, _RAIter2 __end2, _OutputIterator __target, _DifferenceTp
__max_length, _Compare __comp)
__merge_advance_usualโ merge routine being able to merge only the__max_lengthsmallest elements. the usual, as the name says.
template<typename _RAIter1, typename _RAIter2, typename _OutputIterator,
typename _DifferenceTp, typename _Compare> _OutputIterator
__merge_advance_usual (_RAIter1 &__begin1, _RAIter1 __end1, _RAIter2
&__begin2, _RAIter2 __end2, _OutputIterator __target, _DifferenceTp
__max_length, _Compare __comp)
__parallel_merge_advanceโ parallel merge routine being able to merge only the__max_lengthsmallest elements. parallel merge, slay.
template<typename _RAIter1, typename _RAIter3, typename _Compare>
_RAIter3 __parallel_merge_advance (_RAIter1 &__begin1, _RAIter1
__end1, _RAIter1 &__begin2, _RAIter1 __end2, _RAIter3 __target,
typename std::iterator_traits< _RAIter1 >::difference_type
__max_length, _Compare __comp)
__parallel_merge_advanceโ merge routine fallback to sequential in case the iterators of the two input sequences are of different type. when types don't match, it falls back, no drama.
template<typename _RAIter1, typename _RAIter2, typename _RAIter3,
typename _Compare> _RAIter3 __parallel_merge_advance (_RAIter1
&__begin1, _RAIter1 __end1, _RAIter2 &__begin2, _RAIter2 __end2,
_RAIter3 __target, typename std::iterator_traits< _RAIter1
>::difference_type __max_length, _Compare __comp)
__parallel_nth_elementโ parallel implementation ofstd::nth_element(). nth element but make it parallel.
template<typename _RAIter, typename _Compare> void
__parallel_nth_element (_RAIter __begin, _RAIter __nth, _RAIter
__end, _Compare __comp)
__parallel_partial_sortโ parallel implementation ofstd::partial_sort(). partial sort, full parallel energy.
template<typename _RAIter, typename _Compare> void
__parallel_partial_sort (_RAIter __begin, _RAIter __middle, _RAIter
__end, _Compare __comp)
__parallel_partial_sumโ parallel partial sum front-__end. front to end, parallel.
template<typename _IIter, typename _OutputIterator, typename
_BinaryOperation> _OutputIterator __parallel_partial_sum (_IIter
__begin, _IIter __end, _OutputIterator __result, _BinaryOperation
__bin_op)
__parallel_partial_sum_basecaseโ base case prefix sum routine. the base case, holding it down.
template<typename _IIter, typename _OutputIterator, typename
_BinaryOperation> _OutputIterator __parallel_partial_sum_basecase
(_IIter __begin, _IIter __end, _OutputIterator __result,
_BinaryOperation __bin_op, typename std::iterator_traits< _IIter
>::value_type __value)
__parallel_partial_sum_linearโ parallel partial sum implementation, two-phase approach, no recursion. two-phase, no recursion, clean.
template<typename _IIter, typename _OutputIterator, typename
_BinaryOperation> _OutputIterator __parallel_partial_sum_linear
(_IIter __begin, _IIter __end, _OutputIterator __result,
_BinaryOperation __bin_op, typename std::iterator_traits< _IIter
>::difference_type __n)
__parallel_partitionโ parallel implementation ofstd::partition. partition but parallel.
template<typename _RAIter, typename _Predicate> std::iterator_traits<
_RAIter >::difference_type __parallel_partition (_RAIter __begin,
_RAIter __end, _Predicate __pred, _ThreadIndex __num_threads)
__parallel_random_shuffleโ parallel random public call. public call, random shuffle.
template<typename _RAIter, typename _RandomNumberGenerator> void
__parallel_random_shuffle (_RAIter __begin, _RAIter __end,
_RandomNumberGenerator __rng=_RandomNumber())
__parallel_random_shuffle_drsโ main parallel random shuffle step. the main step, main character.
template<typename _RAIter, typename _RandomNumberGenerator> void
__parallel_random_shuffle_drs (_RAIter __begin, _RAIter __end,
typename std::iterator_traits< _RAIter >::difference_type __n,
_ThreadIndex __num_threads, _RandomNumberGenerator &__rng)
__parallel_random_shuffle_drs_puโ random shuffle code executed by each thread. each thread gets a turn.
template<typename _RAIter, typename _RandomNumberGenerator> void
__parallel_random_shuffle_drs_pu (_DRSSorterPU< _RAIter,
_RandomNumberGenerator > *__pus)
__parallel_set_differenceโ no description, exact signature:
template<typename _IIter, typename _OutputIterator, typename _Compare>
_OutputIterator __parallel_set_difference (_IIter __begin1, _IIter
__end1, _IIter __begin2, _IIter __end2, _OutputIterator __result,
_Compare __comp)
__parallel_set_intersectionโ no description, exact signature:
template<typename _IIter, typename _OutputIterator, typename _Compare>
_OutputIterator __parallel_set_intersection (_IIter __begin1, _IIter
__end1, _IIter __begin2, _IIter __end2, _OutputIterator __result,
_Compare __comp)
__parallel_set_operationโ no description, exact signature:
template<typename _IIter, typename _OutputIterator, typename _Operation>
_OutputIterator __parallel_set_operation (_IIter __begin1, _IIter
__end1, _IIter __begin2, _IIter __end2, _OutputIterator __result,
_Operation __op)
- and the source cuts off mid-signature here:
template<typename _IIter, typename _OutputIterator, typename _Compare>
template<typename _IIter, typename _OutputIterator, typename _Compare>
_OutputIterator __parallel_set_symmetric_difference (_IIter __begin1, _IIter __end1, _IIter __begin2, _IIter __end2, _OutputIterator __result, _Compare __comp)
no little blurb in the docs for this one bestie, she's just here, existing, looking gorgeous ๐
template<typename _IIter, typename _OutputIterator, typename _Compare>
_OutputIterator __parallel_set_union (_IIter __begin1, _IIter __end1, _IIter __begin2, _IIter __end2, _OutputIterator __result, _Compare __comp)
same energy โ signature only, no commentary, and honestly? iconic for that ๐
template<bool __stable, typename _RAIter, typename _Compare, typename _Parallelism>
void __parallel_sort (_RAIter __begin, _RAIter __end, _Compare __comp, _Parallelism __parallelism)
the generic sort-y one, no blurb attached, take the signature and go ๐
โจ okay but now we get to the __parallel_sort overloads and they ALL have opinions โจ
template<bool __stable, typename _RAIter, typename _Compare>
void __parallel_sort (_RAIter __begin, _RAIter __end, _Compare __comp,
balanced_quicksort_tag __parallelism)
Choose balanced quicksort for parallel sorting. like, when you want your parallel sort to be balanced quicksort specifically ๐
template<bool __stable, typename _RAIter, typename _Compare>
void __parallel_sort (_RAIter __begin, _RAIter __end, _Compare __comp,
default_parallel_tag __parallelism)
Choose multiway mergesort with exact splitting, for parallel sorting. yep, exact splitting, that's the whole vibe โจ
template<bool __stable, typename _RAIter, typename _Compare>
void __parallel_sort (_RAIter __begin, _RAIter __end, _Compare __comp,
multiway_mergesort_exact_tag __parallelism)
Choose multiway mergesort with exact splitting, for parallel sorting. twins with the one above fr fr ๐ฏ
template<bool __stable, typename _RAIter, typename _Compare>
void __parallel_sort (_RAIter __begin, _RAIter __end, _Compare __comp,
multiway_mergesort_sampling_tag __parallelism)
Choose multiway mergesort with splitting by sampling, for parallel sorting. different splitting, still mergesort, still parallel, still slaying ๐ธ
template<bool __stable, typename _RAIter, typename _Compare>
void __parallel_sort (_RAIter __begin, _RAIter __end, _Compare __comp,
multiway_mergesort_tag __parallelism)
Choose multiway mergesort, splitting variant at run-time, for parallel sorting. she picks her splitting variant at run-time, she's flexible like that ๐
template<bool __stable, typename _RAIter, typename _Compare>
void __parallel_sort (_RAIter __begin, _RAIter __end, _Compare __comp,
parallel_tag __parallelism)
Choose a parallel sorting algorithm. just. a parallel sorting algorithm. dealer's choice, bestie ๐
template<bool __stable, typename _RAIter, typename _Compare>
void __parallel_sort (_RAIter __begin, _RAIter __end, _Compare __comp,
quicksort_tag __parallelism)
Choose quicksort for parallel sorting. quicksort, parallel, periodt ๐ฅ
๐ the unbalanced quicksort girlies ๐
template<typename _RAIter, typename _Compare>
void __parallel_sort_qs (_RAIter __begin, _RAIter __end, _Compare __comp, _ThreadIndex __num_threads)
Unbalanced quicksort main call. the main character of the unbalanced quicksort situation ๐ซ
template<typename _RAIter, typename _Compare>
void __parallel_sort_qs_conquer (_RAIter __begin, _RAIter __end, _Compare __comp, _ThreadIndex __num_threads)
Unbalanced quicksort conquer step. she conquers. literally. ๐ก๏ธ
template<typename _RAIter, typename _Compare>
std::iterator_traits<_RAIter>::difference_type __parallel_sort_qs_divide (_RAIter __begin, _RAIter __end, _Compare __comp, typename std::iterator_traits<_RAIter>::difference_type __pivot_rank, typename std::iterator_traits<_RAIter>::difference_type __num_samples, _ThreadIndex __num_threads)
Unbalanced quicksort divide step. divide, then conquer, that's the order, don't @ me โจ
template<typename _RAIter, typename _Compare>
void __parallel_sort_qsb (_RAIter __begin, _RAIter __end, _Compare __comp, _ThreadIndex __num_threads)
Top-level quicksort routine. top level, top tier, top everything ๐
๐ฆ unique_copy but make it parallel ๐ฆ
template<typename _IIter, class _OutputIterator>
_OutputIterator __parallel_unique_copy (_IIter __first, _IIter __last, _OutputIterator __result)
Parallel std::unique_copy(), without explicit equality predicate. no predicate, she just knows ๐ซถ
template<typename _IIter, class _OutputIterator, class _BinaryPredicate>
_OutputIterator __parallel_unique_copy (_IIter __first, _IIter __last, _OutputIterator __result, _BinaryPredicate __binary_pred)
Parallel std::unique_copy(), w/__o explicit equality predicate. yes, the docs literally say w/__o, we are NOT fixing it, it's part of her charm ๐ญ
๐ balanced quicksort internals, the backstage pass ๐
template<typename _RAIter, typename _Compare>
void __qsb_conquer (_QSBThreadLocal<_RAIter> **__tls, _RAIter __begin, _RAIter __end, _Compare __comp, _ThreadIndex __iam, _ThreadIndex __num_threads, bool __parent_wait)
Quicksort conquer step. (the b stands for balanced, iykyk) ๐
template<typename _RAIter, typename _Compare>
std::iterator_traits<_RAIter>::difference_type __qsb_divide (_RAIter __begin, _RAIter __end, _Compare __comp, _ThreadIndex __num_threads)
Balanced quicksort divide step. balanced this time, not like her chaotic cousin up there โ๏ธ
template<typename _RAIter, typename _Compare>
void __qsb_local_sort_with_helping (_QSBThreadLocal<_RAIter> **__tls, _Compare &__comp, _ThreadIndex __iam, bool __wait)
Quicksort step doing load-balanced local sort. she does a local sort AND balances the load AND helps?? she's literally the whole team ๐ซถ
โญ lil math besties, they're so cute โญ
template<typename _RandomNumberGenerator>
int __random_number_pow2 (int __logp, _RandomNumberGenerator &__rng)
Generate a random number in [0,2^__logp). note the half-open interval bestie, it does NOT include 2^__logp ๐ธ
template<typename _Size>
_Size __rd_log2 (_Size __n)
Calculates the rounded-down logarithm of __n for base 2. rounded DOWN. not up. down. ๐
template<typename _Tp>
_Tp __round_up_to_pow2 (_Tp __x)
Round up to the next greater power of 2. and this one rounds UP, see, they're a matched set ๐
๐ search, but parallel ๐
template<typename __RAIter1, typename __RAIter2, typename _Pred>
__RAIter1 __search_template (__RAIter1 __begin1, __RAIter1 __end1, __RAIter2 __begin2, __RAIter2 __end2, _Pred __pred)
Parallel std::search. parallel search, parallel vibes, parallel everything ๐
๐ง sequential things that are quietly doing the most ๐ง
template<bool __stable, bool __sentinels, typename _RAIterIterator, typename _RAIter3, typename _DifferenceTp, typename _Compare>
_RAIter3 __sequential_multiway_merge (_RAIterIterator __seqs_begin, _RAIterIterator __seqs_end, _RAIter3 __target, const typename std::iterator_traits<typename std::iterator_traits<_RAIterIterator>::value_type::first_type>::value_type &__sentinel, _DifferenceTp __length, _Compare __comp)
Sequential multi-way merging switch. she's a switch, and she's sequential, and she merges multiple ways, that's three whole things ๐
template<typename _RAIter, typename _RandomNumberGenerator>
void __sequential_random_shuffle (_RAIter __begin, _RAIter __end, _RandomNumberGenerator &__rng)
Sequential cache-efficient random shuffle. sequential AND cache-efficient AND random, she contains multitudes โจ
๐ the range-shrinking situation (this is such a serve) ๐
template<typename _IIter>
void __shrink (std::vector<_IIter> &__os_starts, size_t &__count_to_two, size_t &__range_length)
Combines two ranges into one and thus halves the number of ranges. two become one, math is beautiful actually ๐
template<typename _IIter>
void __shrink_and_double (std::vector<_IIter> &__os_starts, size_t &__count_to_two, size_t &__range_length, const bool __make_twice)
Shrinks and doubles the ranges. shrink AND double, she's doing both, she's unhinged, we love her ๐ญ
void __yield ()
Yield control to another thread, without waiting for the end of the time slice. no arguments, no waiting, she just yields and dips immediately ๐
template<typename _IIter, typename _FunctorType>
size_t list_partition (const _IIter __begin, const _IIter __end, _IIter *__starts, size_t *__lengths, const int __num_parts, _FunctorType &__f, int __oversampling=0)
Splits a sequence given by input iterators into parts of almost equal size. almost equal bestie, not exactly equal, don't come for her. also hi __oversampling=0, the default ๐
template<typename _Tp>
const _Tp & max (const _Tp &__a, const _Tp &__b)
Equivalent to std::max. just std::max. that's it. that's the description ๐ฟ
template<typename _Tp>
const _Tp & min (const _Tp &__a, const _Tp &__b)
Equivalent to std::min. and here's std::min's twin, standing right next to her ๐
๐ multiseq time, and these descriptions EAT ๐
template<typename _RanSeqs, typename _RankType, typename _RankIterator, typename _Compare>
void multiseq_partition (_RanSeqs __begin_seqs, _RanSeqs __end_seqs, _RankType __rank, _RankIterator __begin_offsets, _Compare __comp=std::less<typename std::iterator_traits<typename std::iterator_traits<_RanSeqs>::value_type::first_type>::value_type>())
Splits several sorted sequences at a certain global __rank, resulting in a splitting point for each sequence. The sequences are passed via a sequence of random-access iterator pairs, none of the sequences may be empty. If there are several equal elements across the split, the ones on the __left side will be chosen from sequences with smaller number.
okay that was a lot, let me translate: sequences come in as pairs of random-access iterators, none of them may be empty (rule is a rule), and if there's a tie across the split, the left side wins and it's picked from the sequence with the smaller number. also yes, the __comp default is that whole std::less<...> monster, we're keeping every character of it ๐
template<typename _Tp, typename _RanSeqs, typename _RankType, typename _Compare>
_Tp multiseq_selection (_RanSeqs __begin_seqs, _RanSeqs __end_seqs, _RankType __rank, _RankType &__offset, _Compare __comp=std::less<_Tp>())
Selects the element at a certain global __rank from several sorted sequences.
and she's got a __comp defaulted to std::less<_Tp>(), plus a __offset she fills in for you ๐ซถ
๐ซ multiway_merge overload family portrait ๐ซ
template<typename _RAIterPairIterator, typename _RAIterOut, typename _DifferenceTp, typename _Compare>
_RAIterOut multiway_merge (_RAIterPairIterator __seqs_begin, _RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp __length, _Compare __comp, __gnu_parallel::exact_tag __tag)
no blurb for the exact_tag one, bestie โ she's just out here taking an __gnu_parallel::exact_tag and being mysterious ๐ต
template<typename _RAIterPairIterator, typename _RAIterOut, typename _DifferenceTp, typename _Compare>
_RAIterOut multiway_merge (_RAIterPairIterator __seqs_begin, _RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp __length, _Compare __comp, __gnu_parallel::sampling_tag __tag)
same deal for sampling_tag โ no description in the docs, just the signature, and she's serving anyway ๐
template<typename _RAIterPairIterator, typename _RAIterOut, typename _DifferenceTp, typename _Compare>
_RAIterOut multiway_merge (_RAIterPairIterator __seqs_begin, _RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp __length, _Compare __comp, __gnu_parallel::sequential_tag)
Multiway Merge Frontend. the frontend!! she's the face of the operation ๐
template<typename _RAIterPairIterator, typename _RAIterOut, typename _DifferenceTp, typename _Compare>
_RAIterOut multiway_merge (_RAIterPairIterator __seqs_begin, _RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp __length, _Compare __comp, default_parallel_tag __tag)
no blurb for the default_parallel_tag overload either โ signature only, she's lowkey about it ๐
template<typename _RAIterPairIterator, typename _RAIterOut, typename _DifferenceTp, typename _Compare>
_RAIterOut multiway_merge (_RAIterPairIterator __seqs_begin, _RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp __length, _Compare __comp, parallel_tag __tag=parallel_tag(0))
and the parallel_tag one has no description either, but she DOES have a default: __tag=parallel_tag(0). keep that, it matters โญ
๐ฅ the 3-way and 4-way girlies ๐ฅ
template<template<typename _RAI, typename _Cp> class iterator, typename _RAIterIterator, typename _RAIter3, typename _DifferenceTp, typename _Compare>
_RAIter3 multiway_merge_3_variant (_RAIterIterator __seqs_begin, _RAIterIterator __seqs_end, _RAIter3 __target, _DifferenceTp __length, _Compare __comp)
Highly efficient 3-way merging procedure. highly efficient. the docs said highly. they meant it ๐ฅ
template<template<typename _RAI, typename _Cp> class iterator, typename _RAIterIterator, typename _RAIter3, typename _DifferenceTp, typename _Compare>
_RAIter3 multiway_merge_4_variant (_RAIterIterator __seqs_begin, _RAIterIterator __seqs_end, _RAIter3 __target, _DifferenceTp __length, _Compare __comp)
Highly efficient 4-way merging procedure. four ways this time, equally highly efficient, equally iconic ๐
template<bool __stable, typename _RAIterIterator, typename _Compare, typename _DifferenceType>
void multiway_merge_exact_splitting (_RAIterIterator __seqs_begin, _RAIterIterator __seqs_end, _DifferenceType __length, _DifferenceType __total_length, _Compare __comp, std::vector<std::pair<_DifferenceType, _DifferenceType> > *__pieces)
Exact splitting for parallel multiway-merge routine. exact, not approximate, she does not do approximate โจ
template<typename _LT, typename _RAIterIterator, typename _RAIter3,
bestie this one got cut off mid-signature in the source ๐ญ โ she's literally still being written, we'll pick her back up in the next part, don't panic ๐ซถ
typename _DifferenceTp, typename _Compare> _RAIter3
multiway_merge_loser_tree (_RAIterIterator __seqs_begin,
_RAIterIterator __seqs_end, _RAIter3 __target, _DifferenceTp
__length, _Compare __comp)
Multi-way merging procedure for a high branching factor, guarded case. ๐ It's giving guarded merging realness, no cap.
multiway_merge_loser_tree_sentinelโ Multi-way merging procedure for a high branching factor, requiring sentinels to exist. ๐ก๏ธ
template<typename _UnguardedLoserTree, typename _RAIterIterator,
typename _RAIter3, typename _DifferenceTp, typename _Compare>
_RAIter3 multiway_merge_loser_tree_sentinel (_RAIterIterator
__seqs_begin, _RAIterIterator __seqs_end, _RAIter3 __target, const
typename std::iterator_traits< typename std::iterator_traits<
_RAIterIterator >::value_type::first_type >::value_type &__sentinel,
_DifferenceTp __length, _Compare __comp)
multiway_merge_loser_tree_unguardedโ Multi-way merging procedure for a high branching factor, unguarded case. ๐
template<typename _LT, typename _RAIterIterator, typename _RAIter3,
typename _DifferenceTp, typename _Compare> _RAIter3
multiway_merge_loser_tree_unguarded (_RAIterIterator __seqs_begin,
_RAIterIterator __seqs_end, _RAIter3 __target, const typename
std::iterator_traits< typename std::iterator_traits< _RAIterIterator
>::value_type::first_type >::value_type &__sentinel, _DifferenceTp
__length, _Compare __comp)
multiway_merge_sampling_splittingโ Sampling based splitting for parallel multiway-merge routine. ๐ฒ
template<bool __stable, typename _RAIterIterator, typename _Compare,
typename _DifferenceType> void multiway_merge_sampling_splitting
(_RAIterIterator __seqs_begin, _RAIterIterator __seqs_end,
_DifferenceType __length, _DifferenceType __total_length, _Compare
__comp, std::vector< std::pair< _DifferenceType, _DifferenceType > >
*__pieces)
multiway_merge_sentinels(with__gnu_parallel::exact_tag __tag)
template<typename _RAIterPairIterator, typename _RAIterOut, typename
_DifferenceTp, typename _Compare> _RAIterOut
multiway_merge_sentinels (_RAIterPairIterator __seqs_begin,
_RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp
__length, _Compare __comp, __gnu_parallel::exact_tag __tag)
multiway_merge_sentinels(with__gnu_parallel::sequential_tag) โ Multiway Merge Frontend. ๐
template<typename _RAIterPairIterator, typename _RAIterOut, typename
_DifferenceTp, typename _Compare> _RAIterOut
multiway_merge_sentinels (_RAIterPairIterator __seqs_begin,
_RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp
__length, _Compare __comp, __gnu_parallel::sequential_tag)
multiway_merge_sentinels(withdefault_parallel_tag __tag)
template<typename _RAIterPairIterator, typename _RAIterOut, typename
_DifferenceTp, typename _Compare> _RAIterOut
multiway_merge_sentinels (_RAIterPairIterator __seqs_begin,
_RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp
__length, _Compare __comp, default_parallel_tag __tag)
multiway_merge_sentinels(withparallel_tag __tag=parallel_tag(0))
template<typename _RAIterPairIterator, typename _RAIterOut, typename
_DifferenceTp, typename _Compare> _RAIterOut
multiway_merge_sentinels (_RAIterPairIterator __seqs_begin,
_RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp
__length, _Compare __comp, parallel_tag __tag=parallel_tag(0))
multiway_merge_sentinels(withsampling_tag __tag)
template<typename _RAIterPairIterator, typename _RAIterOut, typename
_DifferenceTp, typename _Compare> _RAIterOut
multiway_merge_sentinels (_RAIterPairIterator __seqs_begin,
_RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp
__length, _Compare __comp, sampling_tag __tag)
parallel_multiway_mergeโ Parallel multi-way merge routine. ๐ฅ
template<bool __stable, bool __sentinels, typename _RAIterIterator,
typename _RAIter3, typename _DifferenceTp, typename _Splitter,
typename _Compare> _RAIter3 parallel_multiway_merge (_RAIterIterator
__seqs_begin, _RAIterIterator __seqs_end, _RAIter3 __target,
_Splitter __splitter, _DifferenceTp __length, _Compare __comp,
_ThreadIndex __num_threads)
parallel_sort_mwmsโ PMWMS main call. ๐
template<bool __stable, bool __exact, typename _RAIter, typename
_Compare> void parallel_sort_mwms (_RAIter __begin, _RAIter __end,
_Compare __comp, _ThreadIndex __num_threads)
parallel_sort_mwms_puโ PMWMS code executed by each thread. ๐งต
template<bool __stable, bool __exact, typename _RAIter, typename
_Compare> void parallel_sort_mwms_pu (_PMWMSSortingData< _RAIter >
*__sd, _Compare &__comp)
stable_multiway_merge(with__gnu_parallel::exact_tag __tag)
template<typename _RAIterPairIterator, typename _RAIterOut, typename
_DifferenceTp, typename _Compare> _RAIterOut stable_multiway_merge
(_RAIterPairIterator __seqs_begin, _RAIterPairIterator __seqs_end,
_RAIterOut __target, _DifferenceTp __length, _Compare __comp,
__gnu_parallel::exact_tag __tag)
stable_multiway_merge(with__gnu_parallel::sequential_tag)
template<typename _RAIterPairIterator, typename _RAIterOut, typename
_DifferenceTp, typename _Compare> _RAIterOut stable_multiway_merge
(_RAIterPairIterator __seqs_begin, _RAIterPairIterator __seqs_end,
_RAIterOut __target, _DifferenceTp __length, _Compare __comp,
__gnu_parallel::sequential_tag)
stable_multiway_merge(withdefault_parallel_tag __tag)
template<typename _RAIterPairIterator, typename _RAIterOut, typename
_DifferenceTp, typename _Compare> _RAIterOut stable_multiway_merge
(_RAIterPairIterator __seqs_begin, _RAIterPairIterator __seqs_end,
_RAIterOut __target, _DifferenceTp __length, _Compare __comp,
default_parallel_tag __tag)
stable_multiway_merge(withparallel_tag __tag=parallel_tag(0))
template<typename _RAIterPairIterator, typename _RAIterOut, typename
_DifferenceTp, typename _Compare> _RAIterOut stable_multiway_merge
(_RAIterPairIterator __seqs_begin, _RAIterPairIterator __seqs_end,
_RAIterOut __target, _DifferenceTp __length, _Compare __comp,
parallel_tag __tag=parallel_tag(0))
stable_multiway_merge(withsampling_tag __tag)
template<typename _RAIterPairIterator, typename _RAIterOut, typename
_DifferenceTp, typename _Compare> _RAIterOut stable_multiway_merge
(_RAIterPairIterator __seqs_begin, _RAIterPairIterator __seqs_end,
_RAIterOut __target, _DifferenceTp __length, _Compare __comp,
sampling_tag __tag)
stable_multiway_merge_sentinels(with__gnu_parallel::exact_tag __tag)
template<typename _RAIterPairIterator, typename _RAIterOut, typename
_DifferenceTp, typename _Compare> _RAIterOut
stable_multiway_merge_sentinels (_RAIterPairIterator __seqs_begin,
_RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp
__length, _Compare __comp, __gnu_parallel::exact_tag __tag)
stable_multiway_merge_sentinels(with__gnu_parallel::sequential_tag)
template<typename _RAIterPairIterator, typename _RAIterOut, typename
_DifferenceTp, typename _Compare> _RAIterOut
stable_multiway_merge_sentinels (_RAIterPairIterator __seqs_begin,
_RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp
__length, _Compare __comp, __gnu_parallel::sequential_tag)
stable_multiway_merge_sentinels(withdefault_parallel_tag __tag)
template<typename _RAIterPairIterator, typename _RAIterOut, typename
_DifferenceTp, typename _Compare> _RAIterOut
stable_multiway_merge_sentinels (_RAIterPairIterator __seqs_begin,
_RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp
__length, _Compare __comp, default_parallel_tag __tag)
stable_multiway_merge_sentinels(withparallel_tag __tag=parallel_tag(0))
template<typename _RAIterPairIterator, typename _RAIterOut, typename
_DifferenceTp, typename _Compare> _RAIterOut
stable_multiway_merge_sentinels (_RAIterPairIterator __seqs_begin,
_RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp
__length, _Compare __comp, parallel_tag __tag=parallel_tag(0))
stable_multiway_merge_sentinels(withsampling_tag __tag)
template<typename _RAIterPairIterator, typename _RAIterOut, typename
_DifferenceTp, typename _Compare> _RAIterOut
stable_multiway_merge_sentinels (_RAIterPairIterator __seqs_begin,
_RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp
__length, _Compare __comp, sampling_tag __tag)
โจ Variables โจ
static const int _CASable_bitsโ Number of bits of_CASable. ๐ขstatic const _CASable _CASable_maskโ_CASablewith the right half of bits set to 1. ๐ญ
๐ Detailed Description ๐
GNU parallel code for public use. ๐ It's giving open-source, bestie. No cap.
๐ Typedef Documentation ๐
typedef unsigned short __gnu_parallel::_BinIndexโ Type to hold the index of a bin. Since many variables of this type are allocated, it should be chosen as small as possible. ๐ฆtypedef int64_t __gnu_parallel::_CASableโ Longest compare-and-swappable integer type on this platform. ๐typedef uint64_t __gnu_parallel::_SequenceIndexโ Unsigned integer to index__elements. The total number of elements for each algorithm must fit into this type. ๐ขtypedef uint16_t __gnu_parallel::_ThreadIndexโ Unsigned integer to index a thread number. The maximum thread number (for each processor) must fit into this type. ๐งต
๐ Enumeration Type Documentation ๐
enum __gnu_parallel::_AlgorithmStrategyโ Strategies for run-time algorithm selection: ๐งenum __gnu_parallel::_FindAlgorithmโ Find algorithms: ๐enum __gnu_parallel::_MultiwayMergeAlgorithmโ Merging algorithms: ๐enum __gnu_parallel::_Parallelismโ Run-time equivalents for the compile-time tags. ๐ท๏ธsequentialโ Not parallel. ๐ขparallel_unbalancedโ Parallel unbalanced (equal-sized chunks). โ๏ธparallel_balancedโ Parallel balanced (work-stealing). ๐คนparallel_omp_loopโ Parallel with OpenMP dynamic load-balancing. ๐parallel_omp_loop_staticโ Parallel with OpenMP static load-balancing. ๐parallel_taskqueueโ Parallel with OpenMP taskqueue construct. ๐
enum __gnu_parallel::_PartialSumAlgorithmโ Partial sum algorithms: recursive, linear. โenum __gnu_parallel::_SortAlgorithmโ Sorting algorithms: ๐คenum __gnu_parallel::_SplittingAlgorithmโ Sorting/merging algorithms: sampling,__exact. ๐ฏ
๐ฅ Function Documentation ๐ฅ
__calc_borders
template<typename _RAIter, typename _DifferenceTp> void
__gnu_parallel::__calc_borders (_RAIter __elements, _DifferenceTp
__length, _DifferenceTp * __off)
Precalculate __advances for Knuth-Morris-Pratt algorithm. ๐งฎ
Parameters
__elementsโ Begin iterator of sequence to search for.__lengthโ Length of sequence to search for.__offโ Returned__offsets.
Referenced by __search_template().
__compare_and_swap
template<typename _Tp> bool __gnu_parallel::__compare_and_swap (volatile _Tp
* __ptr, _Tp __comparand, _Tp __replacement) [inline]
Compare-and-swap. Compare *__ptr and __comparand. If equal, let *__ptr=__replacement and return true, return false otherwise. ๐
Parameters
__ptrโ Pointer to signed integer.__comparandโ Compare value.__replacementโ Replacement value.
Referenced by __parallel_partition(), __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::pop_back(), and __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::pop_front().
__decode2
void __gnu_parallel::__decode2 (_CASable __x, int & __a, int & __b) [inline]
Decode two integers from one gnu_parallel::_CASable. ๐
Parameters
__xโ__gnu_parallel::_CASableto decode integers from.__aโ First integer, to be decoded from the most-significant_CASable_bits/2bits of__x.__bโ Second integer, to be encoded in the least-significant_CASable_bits/2bits of__x.
See also __encode2
References _CASable_bits, and _CASable_mask.
Referenced by __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::pop_back(), __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::pop_front(), and __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::push_front().
๐ธ __determine_samples
template<typename _RAIter, typename _DifferenceTp>
void __gnu_parallel::__determine_samples(_PMWMSSortingData< _RAIter > * __sd, _DifferenceTp __num_samples)
okay so this one's whole job is picking out _M_samples from a sequence ๐
like it goes shopping and comes back with the samples, no cap.
Parameters
__sdโ pointer to the algorithm data, bestie. The_Resultgets parked right into__sd->_M_samples.__num_samplesโ how many_M_sampleswe're selecting. the count, the whole vibe.
References โ __equally_split(), __gnu_parallel::_PMWMSSortingData< _RAIter >::_M_samples, __gnu_parallel::_PMWMSSortingData< _RAIter >::_M_source, and __gnu_parallel::_PMWMSSortingData< _RAIter >::_M_starts.
๐ __encode2
_CASable __gnu_parallel::__encode2(int __a, int __b) [inline]
packing two integers into ONE gnu_parallel::_CASable. two little guys, one container. iconic honestly โจ
Parameters
__aโ first integer, and it gets encoded into the most-significant_CASable_bits/2bits. front of the line, main character.__bโ second integer, encoded into the least-significant_CASable_bits/2bits. back of the bus but still slaying.
Returns โ a value that encodes __a and __b together. periodt.
See also โ __decode2
References โ _CASable_bits.
Referenced by โ __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::_RestrictedBoundedConcurrentQueue(), __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::pop_back(), __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::pop_front(), and __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::push_front().
๐ฆ __equally_split
template<typename _DifferenceType, typename _OutputIterator>
_OutputIterator __gnu_parallel::__equally_split(_DifferenceType __n, _ThreadIndex __num_threads, _OutputIterator __s)
the function that splits a sequence into parts of almost equal size ๐ซถ and yes, the word is almost, don't come for me. the resulting sequence __s of length __num_threads+1 holds all the splitting positions you get when you split the range [0,__n) into parts of almost equal size (plus minus 1, okay, it's giving approximate). the first entry is 0, the last one is n. and heads up โ you may end up with empty parts. it happens. no one's judging ๐
Parameters
__nโ number of elements.__num_threadsโ number of parts.__sโ the splitters themselves.
Returns โ the end of the __splitter sequence, i.e. __s+__num_threads+1.
Referenced by โ __determine_samples(), __find_template(), __parallel_partial_sum_linear(), __parallel_unique_copy(), __search_template(), and multiway_merge_exact_splitting().
๐ธ __equally_split_point
template<typename _DifferenceType>
_DifferenceType __gnu_parallel::__equally_split_point(_DifferenceType __n, _ThreadIndex __num_threads, _ThreadIndex __thread_no)
another splitter function, bestie, but this one's a little different โ it hands you the position of the splitting point between thread number __thread_no (included) and thread number __thread_no+1 (excluded). so it's literally telling you where the line is drawn between those two threads ๐
Parameters
__nโ number of elements.__num_threadsโ number of parts.__thread_noโ number of threads.
Returns โ the splitting point. that's it, that's the whole thing.
Referenced by โ __for_each_template_random_access_ed().
โจ __fetch_and_add
template<typename _Tp>
_Tp __gnu_parallel::__fetch_and_add(volatile _Tp * __ptr, _Tp __addend) [inline]
adds a value to a variable, and it does it atomically ๐ฅ no race conditions, no drama, no two threads fighting over the same number like it's the last croissant.
Parameters
__ptrโ pointer to a signed integer.__addendโ the value to add.
Referenced by โ __find_template(), __for_each_template_random_access_workstealing(), __parallel_partition(), and __gnu_parallel::_RestrictedBoundedConcurrentQueue< _Tp >::push_front().
๐ __find_template (the dispatcher)
template<typename _RAIter1, typename _RAIter2, typename _Pred, typename _Selector>
std::pair< _RAIter1, _RAIter2 >
__gnu_parallel::__find_template(_RAIter1 __begin1, _RAIter1 __end1, _RAIter2 __begin2, _Pred __pred, _Selector __selector) [inline]
this is the parallel std::find, and it's basically the switchboard operator that picks between the different algorithms ๐ one call, many vibes.
Parameters
__begin1โ begin iterator of the first sequence.__end1โ end iterator of the first sequence.__begin2โ begin iterator of the second sequence. must have same length as the first sequence, no exceptions.__predโ the find predicate.__selectorโ the_Functionality(e. g.std::find_if(),std::equal(),...).
Returns โ the place of finding in both sequences.
References โ __find_template(), __gnu_parallel::_Settings::get(), and std::make_pair().
Referenced by โ __find_template().
๐ __find_template (constant block size variant)
template<typename _RAIter1, typename _RAIter2, typename _Pred, typename _Selector>
std::pair< _RAIter1, _RAIter2 >
__gnu_parallel::__find_template(_RAIter1 __begin1, _RAIter1 __end1, _RAIter2 __begin2, _Pred __pred, _Selector __selector, constant_size_blocks_tag)
parallel std::find, but the constant block size flavour. the blocks stay the same size the entire time. consistency queen ๐
Parameters
__begin1โ begin iterator of the first sequence.__end1โ end iterator of the first sequence.__begin2โ begin iterator of the second sequence. the second__sequencemust have same length as the first sequence.__predโ the find predicate.__selectorโ the_Functionality(e. g.std::find_if(),std::equal(),...).
Returns โ the place of finding in both sequences.
See also
__gnu_parallel::_Settings::find_sequential_search_size__gnu_parallel::_Settings::find_block_size
There are two main differences between the growing blocks and the constant-size blocks variants, and I'm listing them because they matter:
- For GB, the block size grows; for CSB, the block size is fixed.
- For GB, the blocks are allocated dynamically; for CSB, the blocks are allocated in a predetermined manner, namely spacial round-robin.
References โ _GLIBCXX_CALL, __gnu_parallel::_Settings::find_initial_block_size, __gnu_parallel::_Settings::find_sequential_search_size, std::pair< _T1, _T2 >::first, __gnu_parallel::_Settings::get(), and std::min().
โญ __find_template (equal splitting variant)
template<typename _RAIter1, typename _RAIter2, typename _Pred, typename _Selector>
std::pair< _RAIter1, _RAIter2 >
__gnu_parallel::__find_template(_RAIter1 __begin1, _RAIter1 __end1, _RAIter2 __begin2, _Pred __pred, _Selector __selector, equal_split_tag)
parallel std::find, equal splitting variant. everyone gets their fair share, we love an even split ๐ซถ
Parameters
__begin1โ begin iterator of the first sequence.__end1โ end iterator of the first sequence.__begin2โ begin iterator of the second sequence. the second__sequencemust have same length as the first sequence.__predโ the find predicate.__selectorโ the_Functionality(e. g.std::find_if(),std::equal(),...).
Returns โ the place of finding in both sequences.
References โ __equally_split(), and _GLIBCXX_CALL.
๐ฅ __find_template (growing blocks variant)
template<typename _RAIter1, typename _RAIter2, typename _Pred, typename _Selector>
std::pair< _RAIter1, _RAIter2 >
__gnu_parallel::__find_template(_RAIter1 __begin1, _RAIter1 __end1, _RAIter2 __begin2, _Pred __pred, _Selector __selector, growing_blocks_tag)
parallel std::find, growing block size variant. the blocks literally start small and grow up. glow-up arc ๐ฑโก๏ธ๐ณ
Parameters
__begin1โ begin iterator of the first sequence.__end1โ end iterator of the first sequence.__begin2โ begin iterator of the second sequence. the second__sequencemust have same length as the first sequence.__predโ the find predicate.__selectorโ the_Functionality(e. g.std::find_if(),std::equal(),...).
Returns โ the place of finding in both sequences.
See also
__gnu_parallel::_Settings::find_sequential_search_size__gnu_parallel::_Settings::find_scale_factor
There are two main differences between the growing blocks and the constant-size blocks variants โ same list, because it's the same comparison:
- For GB, the block size grows; for CSB, the block size is fixed.
- For GB, the blocks are allocated dynamically; for CSB, the blocks are allocated in a predetermined manner, namely spacial round-robin.
References โ __fetch_and_add(), _GLIBCXX_CALL, __gnu_parallel::_Settings::find_scale_factor, __gnu_parallel::_Settings::find_sequential_search_size, std::pair< _T1, _T2 >::first, __gnu_parallel::_Settings::get(), std::max(), and std::min().
๐ __for_each_template_random_access
template<typename _IIter, typename _UserOp, typename _Functionality, typename _Red, typename _Result>
_UserOp
__gnu_parallel::__for_each_template_random_access(_IIter __begin, _IIter __end, _UserOp __user_op, _Functionality & __functionality, _Red __reduction, _Result __reduction_start, _Result & __output, typename std::iterator_traits< _IIter >::difference_type __bound, _Parallelism __parallelism_tag)
this one chooses the desired algorithm by evaluating __parallelism_tag. it's the group-chat admin deciding which plan we're going with based on the tag ๐
Parameters
__beginโ begin iterator of input sequence.__endโ end iterator of input sequence.__user_opโ a user-specified functor (comparator, predicate, associative operator,...).__functionalityโ functor to process an element with__user_op(depends on desired functionality, e. g. accumulate, for_each,...).__reductionโ reduction functor.__reduction_startโ initial value for reduction.__outputโ output iterator.__boundโ maximum number of elements processed.__parallelism_tagโ the parallelization method.
References โ __for_each_template_random_access_ed(), __for_each_template_random_access_omp_loop(), __for_each_template_random_access_workstealing(), parallel_omp_loop, parallel_omp_loop_static, and parallel_unbalanced.
๐ __for_each_template_random_access_ed
template<typename _RAIter, typename _Op, typename _Fu, typename _Red, typename _Result>
_Op
__gnu_parallel::__for_each_template_random_access_ed(_RAIter __begin, _RAIter __end, _Op __o, _Fu & __f, _Red __r, _Result __base, _Result & __output, typename std::iterator_traits< _RAIter >::difference_type __bound)
the embarrassingly parallel algorithm for random access iterators, doing hand-crafted parallelization by equal splitting the work โจ hand-crafted!! artisanal!! no cap.
Parameters
__beginโ begin iterator of element sequence.__endโ end iterator of element sequence.__oโ user-supplied functor (comparator, predicate, adding functor, ...).__fโ functor to "process" an element with__op(depends on desired functionality, e. g. forstd::for_each(), ...).__rโ functor to "add" a single__resultto the already processed elements (depends on functionality).__baseโ base value for reduction.__outputโ pointer to position where final result is written to.__boundโ maximum number of elements processed (e. g. forstd::count_n()).
Returns โ the user-supplied functor (that may contain a part of the result). yeah, it hands the functor back to you, and it might be carrying some of the result inside. sneaky but iconic.
References โ __equally_split_point(), and min().
Referenced by โ __for_each_template_random_access().
๐ง __for_each_template_random_access_omp_loop
template<typename _RAIter, typename _Op, typename _Fu, typename _Red, typename _Result>
_Op
__gnu_parallel::__for_each_template_random_access_omp_loop(_RAIter __begin, _RAIter __end, _Op __o, _Fu & __f, _Red __r, _Result __base, _Result & __output, typename std::iterator_traits< _RAIter >::difference_type __bound)
embarrassingly parallel algorithm for random access iterators, but this time it's using an OpenMP for loop ๐ธ same energy, different engine.
โจ Parameters โจ
__beginโ begin iterator of the element sequence, bestie. where it all starts ๐ซถ__endโ end iterator of the element sequence. the finish line, we don't touch it.__oโ the user-supplied functor (comparator, predicate, adding functor, whatever flavour of the above you're on today).__fโ the functor that processes an element together with__op. what exactly it does depends on what you're trying to do, e.g. forstd::for_each(), ...__rโ the functor that adds a single__resultonto the elements that have already been processed (again, depends on the functionality).__baseโ the base value for the reduction. the lil seed everything grows from ๐ฑ__outputโ pointer to the position where the final result gets written. the final destination, no cap.__boundโ the maximum number of elements processed (e.g. forstd::count_n()).
๐ Returns
The user-supplied functor (which may contain a part of the result). yes it hands you back your own functor, possibly holding onto some of the work it did.
References min().
Referenced by __for_each_template_random_access().
template<typename _RAIter, typename _Op, typename _Fu, typename _Red,
typename _Result> _Op
__gnu_parallel::__for_each_template_random_access_omp_loop_static
(_RAIter __begin, _RAIter __end, _Op __o, _Fu & __f, _Red __r, _Result
__base, _Result & __output, typename std::iterator_traits< _RAIter
>::difference_type __bound)
Embarrassingly parallel algorithm for random access iterators, and it does it with an OpenMP for loop on static scheduling. set it and forget it energy ๐
๐ธ Parameters
__beginโ begin iterator of element sequence.__endโ end iterator of element sequence.__oโ user-supplied functor (comparator, predicate, adding functor, ...).__fโ functor to process an element with__op(depends on desired functionality, e. g. forstd::for_each(), ...).__rโ functor to add a single__resultto the already processed__elements(depends on functionality).__baseโ base value for reduction.__outputโ pointer to position where final result is written to__boundโ maximum number of elements processed (e. g. forstd::count_n()).
๐ฆ Returns
User-supplied functor (that may contain a part of the result).
References std::min().
template<typename _RAIter, typename _Op, typename _Fu, typename _Red,
typename _Result> _Op
__gnu_parallel::__for_each_template_random_access_workstealing (_RAIter
__begin, _RAIter __end, _Op __op, _Fu & __f, _Red __r, _Result __base,
_Result & __output, typename std::iterator_traits< _RAIter
>::difference_type __bound)
Work stealing algorithm for random access iterators. this one is so iconic โ it uses O(1) additional memory, and the synchronization at the job lists is done with atomic operations. no locks, just vibes and atomics โจ
๐ Parameters
__beginโ begin iterator of element sequence.__endโ end iterator of element sequence.__opโ user-supplied functor (comparator, predicate, adding functor, ...).__fโ functor to process an element with__op(depends on desired functionality, e. g. forstd::for_each(), ...).__rโ functor to add a single__resultto the already processed elements (depends on functionality).__baseโ base value for reduction.__outputโ pointer to position where final result is written to__boundโ maximum number of elements processed (e. g. forstd::count_n()).
โญ Returns
User-supplied functor (that may contain a part of the result).
References __fetch_and_add(), __yield(), _GLIBCXX_CALL, __gnu_parallel::_Job< _DifferenceTp >::_M_first, __gnu_parallel::_Job< _DifferenceTp >::_M_last, __gnu_parallel::_Job< _DifferenceTp >::_M_load, __gnu_parallel::_Settings::cache_line_size, __gnu_parallel::_Settings::get(), max(), and min().
Referenced by __for_each_template_random_access().
template<typename _IIter, typename _Compare> bool
__gnu_parallel::__is_sorted (_IIter __begin, _IIter __end, _Compare
__comp)
Check whether [__begin, __end) is sorted according to __comp. vibe check but for ordering, honestly ๐
๐ Parameters
__beginโ begin iterator of sequence.__endโ end iterator of sequence.__compโ comparator.
๐ซ Returns
true if sorted, false otherwise. that's it, that's the answer.
Referenced by __sequential_multiway_merge(), multiway_merge_loser_tree_sentinel(), and parallel_multiway_merge().
template<typename _RAIter, typename _Compare> _RAIter
__gnu_parallel::__median_of_three_iterators (_RAIter __a, _RAIter __b,
_RAIter __c, _Compare __comp)
Compute the median of three referenced elements, according to __comp. three little iterators walk into a bar and one of them is the median ๐
๐ Parameters
__aโ first iterator.__bโ second iterator.__cโ third iterator.__compโ comparator.
Referenced by __qsb_divide().
template<typename _RAIter1, typename _RAIter2, typename _OutputIterator,
typename _DifferenceTp, typename _Compare> _OutputIterator
__gnu_parallel::__merge_advance (_RAIter1 & __begin1, _RAIter1 __end1,
_RAIter2 & __begin2, _RAIter2 __end2, _OutputIterator __target,
_DifferenceTp __max_length, _Compare __comp) [inline]
Merge routine being able to merge only the __max_length smallest elements. The __begin iterators are advanced accordingly, and heads up โ they might not reach __end, in contrast to the usual variant. Also there's a static switch on whether to use the conditional-move variant. fancy ๐
๐ธ Parameters
__begin1โ begin iterator of first sequence.__end1โ end iterator of first sequence.__begin2โ begin iterator of second sequence.__end2โ end iterator of second sequence.__targetโ target begin iterator.__max_lengthโ maximum number of elements to merge.__compโ comparator.
๐ Returns
Output end iterator.
References __merge_advance_movc(), and _GLIBCXX_CALL.
Referenced by __parallel_merge_advance(), and __sequential_multiway_merge().
template<typename _RAIter1, typename _RAIter2, typename _OutputIterator,
typename _DifferenceTp, typename _Compare> _OutputIterator
__gnu_parallel::__merge_advance_movc (_RAIter1 & __begin1, _RAIter1
__end1, _RAIter2 & __begin2, _RAIter2 __end2, _OutputIterator __target,
_DifferenceTp __max_length, _Compare __comp)
Merge routine being able to merge only the __max_length smallest elements. The __begin iterators are advanced accordingly, and they might not reach __end, in contrast to the usual variant. This one has specially designed code so the compiler can generate conditional moves instead of branches. branchless bestie behaviour fr fr ๐ง
๐ Parameters
__begin1โ begin iterator of first sequence.__end1โ end iterator of first sequence.__begin2โ begin iterator of second sequence.__end2โ end iterator of second sequence.__targetโ target begin iterator.__max_lengthโ maximum number of elements to merge.__compโ comparator.
โจ Returns
Output end iterator.
Referenced by __merge_advance().
template<typename _RAIter1, typename _RAIter2, typename _OutputIterator,
typename _DifferenceTp, typename _Compare> _OutputIterator
__gnu_parallel::__merge_advance_usual (_RAIter1 & __begin1, _RAIter1
__end1, _RAIter2 & __begin2, _RAIter2 __end2, _OutputIterator __target,
_DifferenceTp __max_length, _Compare __comp)
Merge routine being able to merge only the __max_length smallest elements. The __begin iterators are advanced accordingly, they might not reach __end, in contrast to the usual variant. no conditional-move tricks here, just the plain version doing its thing ๐ซถ
๐ธ Parameters
__begin1โ begin iterator of first sequence.__end1โ end iterator of first sequence.__begin2โ begin iterator of second sequence.__end2โ end iterator of second sequence.__targetโ target begin iterator.__max_lengthโ maximum number of elements to merge.__compโ comparator.
๐ฆ Returns
Output end iterator.
template<typename _RAIter1, typename _RAIter3, typename _Compare> _RAIter3
__gnu_parallel::__parallel_merge_advance (_RAIter1 & __begin1, _RAIter1
__end1, _RAIter1 & __begin2, _RAIter1 __end2, _RAIter3 __target,
typename std::iterator_traits< _RAIter1 >::difference_type __max_length,
_Compare __comp) [inline]
Parallel merge routine being able to merge only the __max_length smallest elements. The __begin iterators are advanced accordingly, they might not reach __end, in contrast to the usual variant. The functionality is projected onto parallel_multiway_merge. glow up ๐
๐ Parameters
__begin1โ begin iterator of first sequence.__end1โ end iterator of first sequence.__begin2โ begin iterator of second sequence.__end2โ end iterator of second sequence.__targetโ target begin iterator.__max_lengthโ maximum number of elements to merge.__compโ comparator.
๐ Returns
Output end iterator.
References std::make_pair(), multiway_merge_exact_splitting(), and parallel_multiway_merge().
template<typename _RAIter1, typename _RAIter2, typename _RAIter3, typename
_Compare> _RAIter3 __gnu_parallel::__parallel_merge_advance (_RAIter1 &
__begin1, _RAIter1 __end1, _RAIter2 & __begin2, _RAIter2 __end2,
_RAIter3 __target, typename std::iterator_traits< _RAIter1
>::difference_type __max_length, _Compare __comp) [inline]
Merge routine fallback to sequential in case the iterators of the two input sequences are of different type. sometimes you just gotta walk it yourself, and that's okay ๐ญ
๐ธ Parameters
__begin1โ begin iterator of first sequence.__end1โ end iterator of first sequence.__begin2โ begin iterator of second sequence.__end2โ end iterator of second sequence.__targetโ target begin iterator.__max_lengthโ maximum number of elements to merge.__compโ comparator.
โญ Returns
Output end iterator.
References __merge_advance().
template<typename _RAIter, typename _Compare> void
__gnu_parallel::__parallel_nth_element (_RAIter __begin, _RAIter __nth,
_RAIter __end, _Compare __comp)
Parallel implementation of std::nth_element(). same energy, more threads ๐ฅ
๐ Parameters
__beginโ begin iterator of input sequence.__nthโ_Iteratorof element that must be in position afterwards.__endโ end iterator of input sequence.__compโ comparator.
References __parallel_partition(), _GLIBCXX_CALL, __gnu_parallel::_Settings::get(), std::max(), __gnu_parallel::_Settings::nth_element_minimal_n, and __gnu_parallel::_Settings::partition_minimal_n.
Referenced by __parallel_partial_sort().
template<typename _RAIter, typename _Compare> void
__gnu_parallel::__parallel_partial_sort (_RAIter __begin, _RAIter
__middle, _RAIter __end, _Compare __comp)
Parallel implementation of std::partial_sort(). partially sorted, fully slaying ๐
๐ฆ Parameters
__beginโ begin iterator of input sequence.__middleโ sort until this position.__endโ end iterator of input sequence.__compโ comparator.
References __parallel_nth_element().
template<typename _IIter, typename _OutputIterator, typename
_BinaryOperation> _OutputIterator __gnu_parallel::__parallel_partial_sum
(_IIter __begin, _IIter __end, _OutputIterator __result,
_BinaryOperation __bin_op)
Parallel partial sum front-__end. running total but make it multithreaded โจ
๐ Parameters
__beginโ begin iterator of input sequence.__endโ end iterator of input sequence.__resultโ begin iterator of output sequence.__bin_opโ associative binary function.
๐ Returns
End iterator of output sequence.
References for the previous entry: __parallel_partial_sum_linear(), _GLIBCXX_CALL, and __gnu_parallel::_Settings::get(). ๐
__gnu_parallel::__parallel_partial_sum_basecase ๐ธ
template<typename _IIter, typename _OutputIterator, typename
_BinaryOperation> _OutputIterator
__gnu_parallel::__parallel_partial_sum_basecase (_IIter __begin, _IIter
__end, _OutputIterator __result, _BinaryOperation __bin_op, typename
std::iterator_traits< _IIter >::value_type __value)
Okay bestie, this one is the base case prefix sum routine. ๐
Parameters
__beginโ begin iterator of input sequence. ๐__endโ end iterator of input sequence. โจ__resultโ begin iterator of output sequence. ๐__bin_opโ associative binary function. ๐ง__valueโ start value. Must be passed since the neutral element is unknown in general. (no cap, itโs required!) ๐ญ
Returns
End iterator of output sequence. ๐ซถ
Referenced by
__parallel_partial_sum_linear()๐
__gnu_parallel::__parallel_partial_sum_linear ๐
template<typename _IIter, typename _OutputIterator, typename
_BinaryOperation> _OutputIterator
__gnu_parallel::__parallel_partial_sum_linear (_IIter __begin, _IIter
__end, _OutputIterator __result, _BinaryOperation __bin_op, typename
std::iterator_traits< _IIter >::difference_type __n)
This is the parallel partial sum implementation, two-phase approach, no recursion. Itโs giving efficient. ๐ฅ
Parameters
__beginโ begin iterator of input sequence.__endโ end iterator of input sequence.__resultโ begin iterator of output sequence.__bin_opโ associative binary function.__nโ length of sequence.
Returns
End iterator of output sequence. ๐
References
__equally_split()__parallel_partial_sum_basecase()__gnu_parallel::_Settings::get()std::max()std::min()__gnu_parallel::_Settings::partial_sum_dilation
Referenced by
__parallel_partial_sum()
__gnu_parallel::__parallel_partition ๐
template<typename _RAIter, typename _Predicate> std::iterator_traits<
_RAIter >::difference_type __gnu_parallel::__parallel_partition (_RAIter
__begin, _RAIter __end, _Predicate __pred, _ThreadIndex __num_threads)
Parallel implementation of std::partition. Periodt. ๐
Parameters
__beginโ begin iterator of input sequence to split.__endโ end iterator of input sequence to split.__predโ partition predicate, possibly including some kind of pivot.__num_threadsโ maximum number of threads to use for this task.
Returns
Number of elements not fulfilling the predicate. ๐ญ
References
__compare_and_swap()__fetch_and_add()_GLIBCXX_CALL_GLIBCXX_VOLATILE__gnu_parallel::_Settings::get()std::max()__gnu_parallel::_Settings::partition_chunk_share__gnu_parallel::_Settings::partition_chunk_size
Referenced by
__parallel_nth_element()__parallel_sort_qs_divide()__qsb_divide()
__gnu_parallel::__parallel_random_shuffle ๐ฆ
template<typename _RAIter, typename _RandomNumberGenerator> void
__gnu_parallel::__parallel_random_shuffle (_RAIter __begin, _RAIter
__end, _RandomNumberGenerator __rng = _RandomNumber()) [inline]
Parallel random public call. Itโs the public vibe. โจ
Parameters
__beginโ begin iterator of sequence.__endโ end iterator of sequence.__rngโ random number generator to use.
References
__parallel_random_shuffle_drs()
__gnu_parallel::__parallel_random_shuffle_drs ๐ธ
template<typename _RAIter, typename _RandomNumberGenerator> void
__gnu_parallel::__parallel_random_shuffle_drs (_RAIter __begin, _RAIter
__end, typename std::iterator_traits< _RAIter >::difference_type __n,
_ThreadIndex __num_threads, _RandomNumberGenerator & __rng)
Main parallel random shuffle step. The main character of shuffling. ๐
Parameters
__beginโ begin iterator of sequence.__endโ end iterator of sequence.__nโ length of sequence.__num_threadsโ number of threads to use.__rngโ random number generator to use.
References
__gnu_parallel::_DRSSorterPU< _RAIter, _RandomNumberGenerator >::__bins_end__parallel_random_shuffle_drs_pu()__rd_log2()__round_up_to_pow2()__sequential_random_shuffle()_GLIBCXX_CALL__gnu_parallel::_DRandomShufflingGlobalData< _RAIter >::_M_bin_proc__gnu_parallel::_DRSSorterPU< _RAIter, _RandomNumberGenerator >::_M_bins_begin__gnu_parallel::_DRandomShufflingGlobalData< _RAIter >::_M_dist__gnu_parallel::_DRandomShufflingGlobalData< _RAIter >::_M_num_bins__gnu_parallel::_DRandomShufflingGlobalData< _RAIter >::_M_num_bits__gnu_parallel::_DRSSorterPU< _RAIter, _RandomNumberGenerator >::_M_num_threads__gnu_parallel::_DRSSorterPU< _RAIter, _RandomNumberGenerator >::_M_sd__gnu_parallel::_DRSSorterPU< _RAIter, _RandomNumberGenerator >::_M_seed__gnu_parallel::_DRandomShufflingGlobalData< _RAIter >::_M_starts__gnu_parallel::_DRandomShufflingGlobalData< _RAIter >::_M_temporaries__gnu_parallel::_Settings::get()__gnu_parallel::_Settings::L2_cache_sizestd::max()std::numeric_limits< _Tp >::max()std::min()__gnu_parallel::_Settings::TLB_size
Referenced by
__parallel_random_shuffle()
__gnu_parallel::__parallel_random_shuffle_drs_pu ๐ง
template<typename _RAIter, typename _RandomNumberGenerator> void
__gnu_parallel::__parallel_random_shuffle_drs_pu (_DRSSorterPU< _RAIter,
_RandomNumberGenerator > * __pus)
Random shuffle code executed by each thread. Itโs giving teamwork. ๐ซถ
Parameters
__pusโ array of thread-local data records.
References
__random_number_pow2()__sequential_random_shuffle()__gnu_parallel::_DRandomShufflingGlobalData< _RAIter >::_M_bin_proc__gnu_parallel::_DRSSorterPU< _RAIter, _RandomNumberGenerator >::_M_bins_begin__gnu_parallel::_DRandomShufflingGlobalData< _RAIter >::_M_dist__gnu_parallel::_DRandomShufflingGlobalData< _RAIter >::_M_num_bins__gnu_parallel::_DRandomShufflingGlobalData< _RAIter >::_M_num_bits__gnu_parallel::_DRSSorterPU< _RAIter, _RandomNumberGenerator >::_M_num_threads__gnu_parallel::_DRSSorterPU< _RAIter, _RandomNumberGenerator >::_M_sd__gnu_parallel::_DRSSorterPU< _RAIter, _RandomNumberGenerator >::_M_seed__gnu_parallel::_DRandomShufflingGlobalData< _RAIter >::_M_source__gnu_parallel::_DRandomShufflingGlobalData< _RAIter >::_M_starts__gnu_parallel::_DRandomShufflingGlobalData< _RAIter >::_M_temporariesstd::partial_sum()
Referenced by
__parallel_random_shuffle_drs()
__gnu_parallel::__parallel_sort โ balanced_quicksort_tag ๐
template<bool __stable, typename _RAIter, typename _Compare> void
__gnu_parallel::__parallel_sort (_RAIter __begin, _RAIter __end,
_Compare __comp, balanced_quicksort_tag __parallelism) [inline]
Choose balanced quicksort for parallel sorting. Slay. ๐
Parameters
__beginโ begin iterator of input sequence.__endโ end iterator of input sequence.__compโ comparator.
Template Parameters
__stableโ sort stable.
References
__gnu_parallel::parallel_tag::__get_num_threads()__parallel_sort_qsb()_GLIBCXX_CALL
__gnu_parallel::__parallel_sort โ default_parallel_tag โจ
template<bool __stable, typename _RAIter, typename _Compare> void
__gnu_parallel::__parallel_sort (_RAIter __begin, _RAIter __end,
_Compare __comp, default_parallel_tag __parallelism) [inline]
Choose multiway mergesort with exact splitting, for parallel sorting. Itโs giving exact. ๐
Parameters
__beginโ begin iterator of input sequence.__endโ end iterator of input sequence.__compโ comparator.
Template Parameters
__stableโ sort stable.
References
__gnu_parallel::parallel_tag::__get_num_threads()_GLIBCXX_CALL
__gnu_parallel::__parallel_sort โ multiway_mergesort_exact_tag ๐
template<bool __stable, typename _RAIter, typename _Compare> void
__gnu_parallel::__parallel_sort (_RAIter __begin, _RAIter __end,
_Compare __comp, multiway_mergesort_exact_tag __parallelism) [inline]
Choose multiway mergesort with exact splitting, for parallel sorting. Same vibe, different tag. ๐ฅ
Parameters
__beginโ begin iterator of input sequence.__endโ end iterator of input sequence.__compโ comparator.
Template Parameters
__stableโ sort stable.
References
__gnu_parallel::parallel_tag::__get_num_threads()_GLIBCXX_CALLparallel_sort_mwms()
__gnu_parallel::__parallel_sort โ multiway_mergesort_sampling_tag ๐ฆ
template<bool __stable, typename _RAIter, typename _Compare> void
__gnu_parallel::__parallel_sort (_RAIter __begin, _RAIter __end,
_Compare __comp, multiway_mergesort_sampling_tag __parallelism) [inline]
Choose multiway mergesort with splitting by sampling, for parallel sorting. Sampling? We love a good sample. ๐
Parameters
__beginโ begin iterator of input sequence.__endโ end iterator of input sequence.__compโ comparator.
Template Parameters
__stableโ sort stable.
References
__gnu_parallel::parallel_tag::__get_num_threads()_GLIBCXX_CALLparallel_sort_mwms()
__gnu_parallel::__parallel_sort โ multiway_mergesort_tag ๐
template<bool __stable, typename _RAIter, typename _Compare> void
__gnu_parallel::__parallel_sort (_RAIter __begin, _RAIter __end,
_Compare __comp, multiway_mergesort_tag __parallelism) [inline]
Choose multiway mergesort, splitting variant at run-time, for parallel sorting. Run-time decisions? Main character energy. ๐
Parameters
__beginโ begin iterator of input sequence.__endโ end iterator of input sequence.__compโ comparator.
Template Parameters
__stableโ sort stable.
References
__gnu_parallel::parallel_tag::__get_num_threads()_GLIBCXX_CALL__gnu_parallel::_Settings::get()parallel_sort_mwms()
__gnu_parallel::__parallel_sort โ parallel_tag ๐
template<bool __stable, typename _RAIter, typename _Compare> void
__gnu_parallel::__parallel_sort (_RAIter __begin, _RAIter __end,
_Compare __comp, parallel_tag __parallelism) [inline]
Choose a parallel sorting algorithm. The generic baddie. โจ
Parameters
__beginโ begin iterator of input sequence.__endโ end iterator of input sequence.__compโ comparator.
Template Parameters
__stableโ sort stable.
References
__gnu_parallel::parallel_tag::__get_num_threads()__parallel_sort_qs()__parallel_sort_qsb()_GLIBCXX_CALL__gnu_parallel::_Settings::get()parallel_sort_mwms()
__gnu_parallel::__parallel_sort โ quicksort_tag ๐
template<bool __stable, typename _RAIter, typename _Compare> void
__gnu_parallel::__parallel_sort (_RAIter __begin, _RAIter __end,
_Compare __comp, quicksort_tag __parallelism) [inline]
Choose quicksort for parallel sorting. Quick like a bunny. ๐ฆ
Parameters
__beginโ begin iterator of input sequence.__endโ end iterator of input sequence.__compโ comparator.
Template Parameters
__stableโ sort stable.
References
__gnu_parallel::parallel_tag::__get_num_threads()__parallel_sort_qs()_GLIBCXX_CALL
__gnu_parallel::__parallel_sort_qs ๐ฅ
template<typename _RAIter, typename _Compare> void
__gnu_parallel::__parallel_sort_qs (_RAIter __begin, _RAIter __end,
_Compare __comp, _ThreadIndex __num_threads)
Unbalanced quicksort main call. Itโs unbalanced but thatโs the vibe. ๐
Parameters
__beginโ begin iterator of input sequence.__endโ end iterator input sequence, ignored.__compโ comparator.__num_threadsโ number of threads that are allowed to work on this part.
References
__parallel_sort_qs_conquer()_GLIBCXX_CALL
Referenced by
__parallel_sort()__parallel_sort()
__gnu_parallel::__parallel_sort_qs_conquer ๐ธ
template<typename _RAIter, typename _Compare> void
__gnu_parallel::__parallel_sort_qs_conquer (_RAIter __begin, _RAIter
__end, _Compare __comp, _ThreadIndex __num_threads)
Unbalanced quicksort conquer step.
okay so the parameters for that last one are:
__beginโ Begin iterator of subsequence. ๐ฆ__endโ End iterator of subsequence. ๐ฆ__compโ Comparator. ๐__num_threadsโ Number of threads that are allowed to work on this part. ๐
References: __parallel_sort_qs_conquer(), __parallel_sort_qs_divide(), and __gnu_parallel::_Settings::get(). โจ
Referenced by: __parallel_sort_qs(), and __parallel_sort_qs_conquer(). ๐
__gnu_parallel::__parallel_sort_qs_divide โ unbalanced quicksort divide step ๐
template<typename _RAIter, typename _Compare>
std::iterator_traits< _RAIter >::difference_type
__gnu_parallel::__parallel_sort_qs_divide (_RAIter __begin, _RAIter __end,
_Compare __comp,
typename std::iterator_traits< _RAIter >::difference_type __pivot_rank,
typename std::iterator_traits< _RAIter >::difference_type __num_samples,
_ThreadIndex __num_threads)
Bestie, this is the unbalanced quicksort divide step. It's giving divide and conquer, but make it unbalanced. ๐
Parameters:
__beginโ Begin iterator of subsequence. ๐ธ__endโ End iterator of subsequence. ๐ธ__compโ Comparator. ๐__pivot_rankโ Desired__rankof the pivot. ๐__num_samplesโ Choose pivot from that many samples. ๐ฒ__num_threadsโ Number of threads that are allowed to work on this part. ๐
References: __parallel_partition(), and std::min(). โจ
Referenced by: __parallel_sort_qs_conquer(). ๐
__gnu_parallel::__parallel_sort_qsb โ top-level quicksort routine ๐
template<typename _RAIter, typename _Compare>
void
__gnu_parallel::__parallel_sort_qsb (_RAIter __begin, _RAIter __end,
_Compare __comp, _ThreadIndex __num_threads)
This is the top-level quicksort routine. Main character energy fr fr. ๐
Parameters:
__beginโ Begin iterator of sequence. ๐__endโ End iterator of sequence. ๐__compโ Comparator. ๐__num_threadsโ Number of threads that are allowed to work on this part. ๐
References: __qsb_conquer(), __rd_log2(), _GLIBCXX_CALL, and std::make_pair(). โจ
Referenced by: __parallel_sort(), and __parallel_sort(). ๐
__gnu_parallel::__parallel_unique_copy โ parallel std::unique_copy() without explicit equality predicate ๐ฆ
template<typename _IIter, class _OutputIterator>
_OutputIterator
__gnu_parallel::__parallel_unique_copy (_IIter __first, _IIter __last,
_OutputIterator __result) [inline]
It's std::unique_copy() but parallel, and no explicit equality predicate. Iconic. โจ
Parameters:
__firstโ Begin iterator of input sequence. ๐__lastโ End iterator of input sequence. ๐__resultโ Begin iterator of result__sequence. ๐
Returns: End iterator of result __sequence. ๐ซถ
References: __parallel_unique_copy(). ๐ฅ
__gnu_parallel::__parallel_unique_copy โ parallel std::unique_copy() with explicit equality predicate ๐
template<typename _IIter, class _OutputIterator, class _BinaryPredicate>
_OutputIterator
__gnu_parallel::__parallel_unique_copy (_IIter __first, _IIter __last,
_OutputIterator __result, _BinaryPredicate __binary_pred)
Parallel std::unique_copy(), w/__o explicit equality predicate. (Yes, the original says w/__o โ we keep it exactly, no cap.) ๐ญ
Parameters:
__firstโ Begin iterator of input sequence. ๐__lastโ End iterator of input sequence. ๐__resultโ Begin iterator of result__sequence. ๐__binary_predโ Equality predicate. ๐
Returns: End iterator of result __sequence. ๐ซถ
References: __equally_split(), and _GLIBCXX_CALL. โจ
Referenced by: __parallel_unique_copy(). ๐
__gnu_parallel::__qsb_conquer โ quicksort conquer step ๐
template<typename _RAIter, typename _Compare>
void
__gnu_parallel::__qsb_conquer (_QSBThreadLocal< _RAIter > ** __tls,
_RAIter __begin, _RAIter __end, _Compare __comp, _ThreadIndex __iam,
_ThreadIndex __num_threads, bool __parent_wait)
Quicksort conquer step. It's giving conquer, not divide. ๐
Parameters:
__tlsโ Array of thread-local storages. ๐ง__beginโ Begin iterator of subsequence. ๐ธ__endโ End iterator of subsequence. ๐ธ__compโ Comparator. ๐__iamโ Number of the thread processing this function. ๐__num_threadsโ Number of threads that are allowed to work on this part. ๐
References: __qsb_conquer(), __qsb_divide(), __qsb_local_sort_with_helping(), __gnu_parallel::_QSBThreadLocal< _RAIter >::_M_elements_leftover, __gnu_parallel::_QSBThreadLocal< _RAIter >::_M_initial, std::max(), and std::min(). โจ
Referenced by: __parallel_sort_qsb(), and __qsb_conquer(). ๐
__gnu_parallel::__qsb_divide โ balanced quicksort divide step โ๏ธ
template<typename _RAIter, typename _Compare>
std::iterator_traits< _RAIter >::difference_type
__gnu_parallel::__qsb_divide (_RAIter __begin, _RAIter __end,
_Compare __comp, _ThreadIndex __num_threads)
Balanced quicksort divide step. Balance is key, bestie. ๐
Parameters:
__beginโ Begin iterator of subsequence. ๐ธ__endโ End iterator of subsequence. ๐ธ__compโ Comparator. ๐__num_threadsโ Number of threads that are allowed to work on this part. ๐
Precondition: (__end-__begin)>=1 ๐จ
You better have at least one element in there, fr fr.
References: __median_of_three_iterators(), and __parallel_partition(). โจ
Referenced by: __qsb_conquer(). ๐
__gnu_parallel::__qsb_local_sort_with_helping โ quicksort step doing load-balanced local sort ๐ง
template<typename _RAIter, typename _Compare>
void
__gnu_parallel::__qsb_local_sort_with_helping (_QSBThreadLocal< _RAIter > ** __tls,
_Compare & __comp, _ThreadIndex __iam, bool __wait)
Quicksort step doing load-balanced local sort. It's helping, it's local, it's balanced. We love. โจ
Parameters:
__tlsโ Array of thread-local storages. ๐ง__compโ Comparator. ๐__iamโ Number of the thread processing this function. ๐
References: __yield(), _GLIBCXX_PARALLEL_ASSERTIONS, __gnu_parallel::_QSBThreadLocal< _RAIter >::_M_elements_leftover, __gnu_parallel::_QSBThreadLocal< _RAIter >::_M_initial, __gnu_parallel::_QSBThreadLocal< _RAIter >::_M_leftover_parts, __gnu_parallel::_QSBThreadLocal< _RAIter >::_M_num_threads, __gnu_parallel::_Settings::get(), std::make_pair(), and __gnu_parallel::_Settings::sort_qsb_base_case_maximal_n. โจ
Referenced by: __qsb_conquer(). ๐
__gnu_parallel::__random_number_pow2 โ generate a random number in [0,2^__logp) ๐ฒ
template<typename _RandomNumberGenerator>
int
__gnu_parallel::__random_number_pow2 (int __logp, _RandomNumberGenerator & __rng) [inline]
Generate a random number in [0,2^__logp). Random but make it powers of two. ๐
Parameters:
__logpโ Logarithm (basis 2) of the upper range__bound. ๐__rngโ Random number generator to use. ๐ฒ
Referenced by: __parallel_random_shuffle_drs_pu(), and __sequential_random_shuffle(). ๐
__gnu_parallel::__rd_log2 โ rounded-down logarithm of __n for base 2 ๐
template<typename _Size>
_Size
__gnu_parallel::__rd_log2 (_Size __n) [inline]
Calculates the rounded-down logarithm of __n for base 2. Math queen. ๐
Parameters:
__nโ Argument. ๐ข
Returns: Returns 0 for any argument <1. ๐ซถ
Referenced by: __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_LoserTreeBase(), __parallel_random_shuffle_drs(), __parallel_sort_qsb(), __round_up_to_pow2(), __sequential_random_shuffle(), multiseq_partition(), and multiseq_selection(). ๐
__gnu_parallel::__round_up_to_pow2 โ round up to the next greater power of 2 ๐ผ
template<typename _Tp>
_Tp
__gnu_parallel::__round_up_to_pow2 (_Tp __x)
Round up to the next greater power of 2. It's giving upward mobility. โจ
Parameters:
__xโ_Integerto round up. ๐ข
References: __rd_log2(). โจ
Referenced by: __parallel_random_shuffle_drs(), __sequential_random_shuffle(), and multiseq_selection(). ๐
__gnu_parallel::__search_template โ parallel std::search ๐
template<typename __RAIter1, typename __RAIter2, typename _Pred>
__RAIter1
__gnu_parallel::__search_template (__RAIter1 __begin1, __RAIter1 __end1,
__RAIter2 __begin2, __RAIter2 __end2, _Pred __pred)
Parallel std::search. It's searching, but make it parallel. ๐โจ
Parameters:
__begin1โ Begin iterator of first sequence. ๐ธ__end1โ End iterator of first sequence. ๐ธ__begin2โ Begin iterator of second sequence. ๐บ__end2โ End iterator of second sequence. ๐บ__predโ Find predicate. ๐
Returns: Place of finding in first sequences. ๐ซถ
References: __calc_borders(), __equally_split(), _GLIBCXX_CALL, std::max(), and std::min(). โจ
__gnu_parallel::__sequential_multiway_merge โ sequential multi-way merging switch ๐
template<bool __stable, bool __sentinels, typename _RAIterIterator, typename _RAIter3, typename _DifferenceTp, typename _Compare>
_RAIter3
__gnu_parallel::__sequential_multiway_merge (_RAIterIterator __seqs_begin,
_RAIterIterator __seqs_end, _RAIter3 __target,
const typename std::iterator_traits< typename std::iterator_traits< _RAIterIterator >::value_type::first_type >::value_type & __sentinel,
_DifferenceTp __length, _Compare __comp)
Sequential multi-way merging switch. The _GLIBCXX_PARALLEL_DECISION is based on the branching factor and runtime settings. It's giving decision energy. ๐
Parameters:
__seqs_beginโ Begin iterator of iterator pair input sequence. ๐__seqs_endโ End iterator of iterator pair input sequence. ๐__targetโ Begin iterator of output sequence. ๐ฏ__compโ Comparator. ๐__lengthโ Maximum length to merge, possibly larger than the number of elements available. ๐__sentinelโ The sequences have__a__sentinelelement. ๐ก๏ธ
Returns: End iterator of output sequence. ๐ซถ
References: __is_sorted(), __merge_advance(), _GLIBCXX_CALL, _GLIBCXX_PARALLEL_LENGTH, and std::min(). โจ
Referenced by: multiway_merge(), multiway_merge_sentinels(), and parallel_multiway_merge(). ๐
__gnu_parallel::__sequential_random_shuffle โ sequential cache-efficient random shuffle ๐ฒ
template<typename _RAIter, typename _RandomNumberGenerator>
void
__gnu_parallel::__sequential_random_shuffle (_RAIter __begin, _RAIter __end,
_RandomNumberGenerator & __rng)
Sequential cache-efficient random shuffle. Cache-friendly and random? We love a multi-talented icon. โจ
Parameters:
__beginโ Begin iterator of sequence. ๐ธ__endโ End iterator of sequence. ๐ธ__rngโ Random number generator to use. ๐ฒ
References: __random_number_pow2(), __rd_log2(), __round_up_to_pow2(), __sequential_random_shuffle(), __gnu_parallel::_Settings::get(), __gnu_parallel::_Settings::L2_cache_size, std::max(), std::min(), std::partial_sum(), and __gnu_parallel::_Settings::TLB_size. โจ
Referenced by: __parallel_random_shuffle_drs(), __parallel_random_shuffle_drs_pu(), and __sequential_random_shuffle(). ๐
__gnu_parallel::__shrink โ combines two ranges into one and halves the number of ranges ๐๏ธ
template<typename _IIter>
void
__gnu_parallel::__shrink (std::vector< _IIter > & __os_starts, size_t & __count_to_two, size_t & __range_length)
Combines two ranges into one and thus halves the number of ranges. Shrink it down, bestie. ๐
Parameters:
__os_startsโ Start positions worked on (oversampled). ๐__count_to_twoโ Counts up to 2. ๐ข__range_lengthโ Current length of a chunk. ๐
References: std::vector< _Tp, _Alloc >::size(). โจ
Referenced by: __shrink_and_double(). ๐
__gnu_parallel::__shrink_and_double โ shrinks and doubles the ranges ๐
template<typename _IIter>
void
__gnu_parallel::__shrink_and_double (std::vector< _IIter > & __os_starts,
size_t & __count_to_two, size_t & __range_length, const bool __make_twice)
Shrinks and doubles the ranges. Shrink, then double. It's giving reversible jacket. ๐ญ
Parameters:
__os_startsโ Start positions worked on (oversampled). ๐__count_to_twoโ Counts up to 2. ๐ข__range_lengthโ Current length of a chunk. ๐__make_twiceโ Whether the__os_startsis allowed to be grown or not. ๐ฑ
References: __shrink(), std::vector< _Tp, _Alloc >::resize(), and std::vector< _Tp, _Alloc >::size(). โจ
Referenced by: list_partition(). ๐
__gnu_parallel::__yield โ yield control to another thread ๐
void
__gnu_parallel::__yield () [inline]
Yield control to another thread, without waiting for the end of the time slice. It's giving generous. ๐ซถ
Referenced by: __for_each_template_random_access_workstealing(), and __qsb_local_sort_with_helping(). ๐
__gnu_parallel::list_partition โ splits a sequence into parts of almost equal size โ๏ธ
template<typename _IIter, typename _FunctorType>
size_t
__gnu_parallel::list_partition (const _IIter __begin, const _IIter __end,
_IIter * __starts, size_t * __lengths, const int __num_parts,
_FunctorType & __f, int __oversampling = 0)
Splits a sequence given by input iterators into parts of almost equal size. The function needs only one pass over the sequence. One pass? Efficient queen. ๐
### ๐ซ Parameters ๐ซ
__beginโ begin iterator of the input sequence, the og starting point bestie ๐ซถ__endโ end iterator of the input sequence, where the vibes stop__startsโ start iterators for the resulting parts, dimension__num_parts+1. and for convenience??__starts [__num_parts]contains the end iterator of the sequence. it's giving thoughtful โจ__lengthsโ length of the resulting parts__num_partsโ number of parts to split the sequence into, the way it just divides everything up ๐__fโ functor to be applied to each element by traversing__it__oversamplingโ oversampling factor. if0, then the partitions will differ in at most$t{thrm{end} - thrm{begin}}$elements. otherwise, the ratio between the longest and the shortest part is bounded by$1/(thrm{oversampling}
### ๐ Returns ๐
Length of the whole sequence. that's the whole return, no notes ๐
### ๐ References ๐
__shrink_and_double(), and std::vector< _Tp, _Alloc >::size().
### ๐ฆ max ๐ฆ
template<typename _Tp> const _Tp & __gnu_parallel::max (const _Tp & __a, const _Tp & __b) [inline]
Equivalent to std::max. literally that's it, no cap ๐ฅ
Referenced by __for_each_template_random_access_workstealing().
### ๐ฆ min ๐ฆ
template<typename _Tp> const _Tp & __gnu_parallel::min (const _Tp & __a, const _Tp & __b) [inline]
Equivalent to std::min. twin of the one above, obsessed ๐
Referenced by __for_each_template_random_access_ed(), __for_each_template_random_access_omp_loop(), and __for_each_template_random_access_workstealing().
### ๐ multiseq_partition ๐
template<typename _RanSeqs, typename _RankType, typename _RankIterator, typename _Compare>
void __gnu_parallel::multiseq_partition (_RanSeqs __begin_seqs, _RanSeqs __end_seqs, _RankType __rank, _RankIterator __begin_offsets, _Compare __comp = std::less< typename std::iterator_traits<typename std::iterator_traits<_RanSeqs>::value_type:: first_type>::value_type>())
Splits several sorted sequences at a certain global __rank, resulting in a splitting point for each sequence. The sequences are passed via a sequence of random-access iterator pairs, none of the sequences may be empty. If there are several equal elements across the split, the ones on the __left side will be chosen from sequences with smaller number. okay so it's got opinions and we respect them ๐
#### Parameters
__begin_seqsโ begin of the sequence of iterator pairs__end_seqsโ end of the sequence of iterator pairs__rankโ the global rank to partition at__begin_offsetsโ a random-access__sequence__beginwhere the__resultwill be stored in. Each element of the sequence is an iterator that points to the first element on the greater part of the respective__sequence.__compโ the ordering functor, defaults tostd::less<_Tp>
#### References
__rd_log2(), _GLIBCXX_CALL, std::distance(), std::priority_queue< _Tp, _Sequence, _Compare >::empty(), std::make_pair(), std::max(), std::min(), std::priority_queue< _Tp, _Sequence, _Compare >::pop(), std::priority_queue< _Tp, _Sequence, _Compare >::push(), and std::priority_queue< _Tp, _Sequence, _Compare >::top().
Referenced by multiway_merge_exact_splitting().
### ๐ธ multiseq_selection ๐ธ
template<typename _Tp, typename _RanSeqs, typename _RankType, typename _Compare>
_Tp __gnu_parallel::multiseq_selection (_RanSeqs __begin_seqs, _RanSeqs __end_seqs, _RankType __rank, _RankType & __offset, _Compare __comp = std::less<_Tp>())
Selects the element at a certain global __rank from several sorted sequences. The sequences are passed via a sequence of random-access iterator pairs, none of the sequences may be empty. same rule as above, don't test it ๐ซถ
#### Parameters
__begin_seqsโ begin of the sequence of iterator pairs__end_seqsโ end of the sequence of iterator pairs__rankโ the global rank to partition at__offsetโ the rank of the selected element in the global subsequence of elements equal to the selected element. If the selected element is unique, this number is0. it's giving the chosen one โจ__compโ the ordering functor, defaults tostd::less
#### References
__rd_log2(), __round_up_to_pow2(), _GLIBCXX_CALL, std::distance(), std::priority_queue< _Tp, _Sequence, _Compare >::empty(), std::make_pair(), std::max(), std::min(), std::priority_queue< _Tp, _Sequence, _Compare >::pop(), std::priority_queue< _Tp, _Sequence, _Compare >::push(), and std::priority_queue< _Tp, _Sequence, _Compare >::top().
### ๐ multiway_merge ๐
template<typename _RAIterPairIterator, typename _RAIterOut, typename _DifferenceTp, typename _Compare>
_RAIterOut __gnu_parallel::multiway_merge (_RAIterPairIterator __seqs_begin, _RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp __length, _Compare __comp, __gnu_parallel::sequential_tag )
Multiway Merge Frontend. Merge the sequences specified by seqs_begin and __seqs_end into __target. __seqs_begin and __seqs_end must point to a sequence of pairs. These pairs must contain an iterator to the beginning of a sequence in their first entry and an iterator the _M_end of the same sequence in their second entry. so it's pairs of (start, end) and honestly? iconic structure ๐
Ties are broken arbitrarily. See stable_multiway_merge for a variant that breaks ties by sequence number but is slower. speed or fairness, bestie, you literally cannot have both ๐ญ
The first entries of the pairs (i.e. the begin iterators) will be moved forward. yes it mutates them, don't be surprised
The output sequence has to provide enough space for all elements that are written to it. do not skip this part, it will not be cute ๐
This function will merge the input sequences:
- not stable
- parallel, depending on the input size and Settings
- using sampling for splitting
- not using sentinels
Example:
int sequences[10][10];
for (int __i = 0; __i < 10; ++__i)
for (int __j = 0; __i < 10; ++__j)
sequences[__i][__j] = __j;
int __out[33];
std::vector<std::pair<int*> > seqs;
for (int __i = 0; __i < 10; ++__i)
{ seqs.push(std::make_pair<int*>(sequences[__i],
sequences[__i] + 10)) }
multiway_merge(seqs.begin(), seqs.end(), __target, std::less<int>(), 33);
#### See also
stable_multiway_merge
#### Precondition
All input sequences must be sorted.
Target must provide enough space to merge out length elements or the number of elements in all sequences, whichever is smaller.
#### Postcondition
[__target, return __value) contains merged __elements from the input sequences.
return __value - __target = min(__length, number of elements in all sequences).
#### Template Parameters
_RAIterPairIteratorโ iterator over sequence of pairs of iterators_RAIterOutโ iterator over target sequence_DifferenceTpโ difference type for the sequence_Compareโ strict weak ordering type to compare elements in sequences
#### Parameters
__seqs_beginโ__beginof sequence__sequence__seqs_endโ_M_endof sequence__sequence__targetโ target sequence to merge to.__compโ strict weak ordering to use for element comparison.__lengthโ Maximum length to merge, possibly larger than the number of elements available.
#### Returns
_M_end iterator of output sequence
#### References
__sequential_multiway_merge(), and _GLIBCXX_CALL.
### ๐ multiway_merge_3_variant ๐
template<template< typename _RAI, typename _Cp > class iterator, typename _RAIterIterator, typename _RAIter3, typename _DifferenceTp, typename _Compare>
_RAIter3 __gnu_parallel::multiway_merge_3_variant (_RAIterIterator __seqs_begin, _RAIterIterator __seqs_end, _RAIter3 __target, _DifferenceTp __length, _Compare __comp)
Highly efficient 3-way merging procedure. Merging is done with the algorithm implementation described by Peter Sanders. Basically, the idea is to minimize the number of necessary comparison after merging an element. The implementation trick that makes this fast is that the order of the sequences is stored in the instruction pointer (translated into labels in C++). ngl that is unhinged in the best way ๐ฅ
This works well for merging up to 4 sequences.
Note that making the merging stable does not come at a performance hit. free stability?? we love to see it โจ
Whether the merging is done guarded or unguarded is selected by the used iterator class.
#### Parameters
__seqs_beginโ Begin iterator of iterator pair input sequence.__seqs_endโ End iterator of iterator pair input sequence.__targetโ Begin iterator of output sequence.__compโ Comparator.__lengthโ Maximum length to merge, less equal than the total number of elements available.
#### Returns
End iterator of output sequence.
#### References
_GLIBCXX_CALL.
### ๐ multiway_merge_4_variant ๐
template<template< typename _RAI, typename _Cp > class iterator, typename _RAIterIterator, typename _RAIter3, typename _DifferenceTp, typename _Compare>
_RAIter3 __gnu_parallel::multiway_merge_4_variant (_RAIterIterator __seqs_begin, _RAIterIterator __seqs_end, _RAIter3 __target, _DifferenceTp __length, _Compare __comp)
Highly efficient 4-way merging procedure. Merging is done with the algorithm implementation described by Peter Sanders. Basically, the idea is to minimize the number of necessary comparison after merging an element. The implementation trick that makes this fast is that the order of the sequences is stored in the instruction pointer (translated into goto labels in C++). four-way edition, same chaotic genius energy ๐
This works well for merging up to 4 sequences.
Note that making the merging stable does not come at a performance hit.
Whether the merging is done guarded or unguarded is selected by the used iterator class.
#### Parameters
__seqs_beginโ Begin iterator of iterator pair input sequence.__seqs_endโ End iterator of iterator pair input sequence.__targetโ Begin iterator of output sequence.__compโ Comparator.__lengthโ Maximum length to merge, less equal than the total number of elements available.
#### Returns
End iterator of output sequence.
#### References
_GLIBCXX_CALL.
### โ๏ธ multiway_merge_exact_splitting โ๏ธ
template<bool __stable, typename _RAIterIterator, typename _Compare, typename _DifferenceType>
void __gnu_parallel::multiway_merge_exact_splitting (_RAIterIterator __seqs_begin, _RAIterIterator __seqs_end, _DifferenceType __length, _DifferenceType __total_length, _Compare __comp, std::vector< std::pair< _DifferenceType, _DifferenceType > > * __pieces)
Exact splitting for parallel multiway-merge routine. None of the passed sequences may be empty. for real for real ๐ซถ
#### References
__equally_split(), _GLIBCXX_PARALLEL_LENGTH, std::vector< _Tp, _Alloc >::begin(), std::vector< _Tp, _Alloc >::end(), multiseq_partition(), and std::vector< _Tp, _Alloc >::resize().
Referenced by __parallel_merge_advance().
### ๐ณ multiway_merge_loser_tree ๐ณ
template<typename _LT, typename _RAIterIterator, typename _RAIter3, typename _DifferenceTp, typename _Compare>
_RAIter3 __gnu_parallel::multiway_merge_loser_tree (_RAIterIterator __seqs_begin, _RAIterIterator __seqs_end, _RAIter3 __target, _DifferenceTp __length, _Compare __comp)
Multi-way merging procedure for a high branching factor, guarded case. This merging variant uses a LoserTree class as selected by _LT. it's called a loser tree and it is honestly the main character here ๐
Stability is selected through the used LoserTree class _LT.
At least one non-empty sequence is required.
Parameters ๐
__seqs_beginโ Begin iterator of iterator pair input sequence. ๐ซถ__seqs_endโ End iterator of iterator pair input sequence. ๐ซถ__targetโ Begin iterator of output sequence. ๐ซถ__compโ Comparator. ๐ซถ__lengthโ Maximum length to merge, less equal than the total number of elements available. ๐ซถ
Returns โจ
End iterator of output sequence. ๐
References ๐ฅ
_GLIBCXX_CALL, and _GLIBCXX_PARALLEL_LENGTH. no cap.
okay bestie, next function coming at you:
template<typename _UnguardedLoserTree, typename _RAIterIterator, typename _RAIter3, typename _DifferenceTp, typename _Compare> _RAIter3 __gnu_parallel::multiway_merge_loser_tree_sentinel (_RAIterIterator __seqs_begin, _RAIterIterator __seqs_end, _RAIter3 __target, const typename std::iterator_traits< typename std::iterator_traits< _RAIterIterator >::value_type::first_type >::value_type & __sentinel, _DifferenceTp __length, _Compare __comp)
Multi-way merging procedure for a high branching factor, requiring sentinels to exist. ๐ก๏ธ
Template Parameters
_UnguardedLoserTreeโ Loser Tree variant to use for the unguarded merging.
Parameters
__seqs_beginโ Begin iterator of iterator pair input sequence.__seqs_endโ End iterator of iterator pair input sequence.__targetโ Begin iterator of output sequence.__compโ Comparator.__lengthโ Maximum length to merge, less equal than the total number of elements available.
Returns
End iterator of output sequence.
References
__is_sorted(), _GLIBCXX_CALL, and multiway_merge_loser_tree_unguarded().
template<typename _LT, typename _RAIterIterator, typename _RAIter3, typename _DifferenceTp, typename _Compare> _RAIter3 __gnu_parallel::multiway_merge_loser_tree_unguarded (_RAIterIterator __seqs_begin, _RAIterIterator __seqs_end, _RAIter3 __target, const typename std::iterator_traits< typename std::iterator_traits< _RAIterIterator >::value_type::first_type >::value_type & __sentinel, _DifferenceTp __length, _Compare __comp)
Multi-way merging procedure for a high branching factor, unguarded case. Merging is done using the LoserTree class _LT. ๐ณ
Stability is selected by the used LoserTrees. ๐
Precondition
No input will run out of elements during the merge. โ ๏ธ
Parameters
__seqs_beginโ Begin iterator of iterator pair input sequence.__seqs_endโ End iterator of iterator pair input sequence.__targetโ Begin iterator of output sequence.__compโ Comparator.__lengthโ Maximum length to merge, less equal than the total number of elements available.
Returns
End iterator of output sequence.
References
_GLIBCXX_CALL.
Referenced by
multiway_merge_loser_tree_sentinel().
template<bool __stable, typename _RAIterIterator, typename _Compare, typename _DifferenceType> void __gnu_parallel::multiway_merge_sampling_splitting (_RAIterIterator __seqs_begin, _RAIterIterator __seqs_end, _DifferenceType __length, _DifferenceType __total_length, _Compare __comp, std::vector< std::pair< _DifferenceType, _DifferenceType > > * __pieces)
Sampling based splitting for parallel multiway-merge routine. ๐ฒ
References
_GLIBCXX_PARALLEL_LENGTH, __gnu_parallel::_Settings::get(), and __gnu_parallel::_Settings::merge_oversampling.
template<typename _RAIterPairIterator, typename _RAIterOut, typename _DifferenceTp, typename _Compare> _RAIterOut __gnu_parallel::multiway_merge_sentinels (_RAIterPairIterator __seqs_begin, _RAIterPairIterator __seqs_end, _RAIterOut __target, _DifferenceTp __length, _Compare __comp, __gnu_parallel::sequential_tag)
Multiway Merge Frontend. Merge the sequences specified by seqs_begin and __seqs_end into __target. __seqs_begin and __seqs_end must point to a sequence of pairs. These pairs must contain an iterator to the beginning of a sequence in their first entry and an iterator the _M_end of the same sequence in their second entry. ๐งฉ
Ties are broken arbitrarily. See stable_multiway_merge for a variant that breaks ties by sequence number but is slower. ๐ข
The first entries of the pairs (i.e. the begin iterators) will be moved forward accordingly. โก๏ธ
The output sequence has to provide enough space for all elements that are written to it. ๐ฆ
This function will merge the input sequences:
- not stable
- parallel, depending on the input size and Settings
- using sampling for splitting
- using sentinels
You have to take care that the element the _M_end iterator points to is readable and contains a value that is greater than any other non-sentinel value in all sequences. ๐จ
Example:
int sequences[10][11];
for (int __i = 0; __i < 10; ++__i)
for (int __j = 0; __i < 11; ++__j)
sequences[__i][__j] = __j; // __last one is sentinel!
int __out[33];
std::vector<std::pair<int*> > seqs;
for (int __i = 0; __i < 10; ++__i)
{ seqs.push(std::make_pair<int*>(sequences[__i],
sequences[__i] + 10)) }
multiway_merge(seqs.begin(), seqs.end(), __target, std::less<int>(), 33);
Precondition
All input sequences must be sorted. ๐
Target must provide enough space to merge out length elements or the number of elements in all sequences, whichever is smaller. ๐
For each __i, __seqs_begin[__i].second must be the end marker of the sequence, but also reference the one more __sentinel element. ๐ก๏ธ
Postcondition
[__target, return __value) contains merged __elements from the input sequences. ๐ฏ
return __value - __target = min(__length, number of elements in all sequences). ๐งฎ
See also
stable_multiway_merge_sentinels
Template Parameters
_RAIterPairIteratorโ iterator over sequence of pairs of iterators_RAIterOutโ iterator over target sequence_DifferenceTpโ difference type for the sequence_Compareโ strict weak ordering type to compare elements in sequences
Parameters
__seqs_beginโ__beginof sequence__sequence__seqs_endโ_M_endof sequence__sequence__targetโ target sequence to merge to.__compโ strict weak ordering to use for element comparison.__lengthโ Maximum length to merge, possibly larger than the number of elements available.
Returns
_M_end iterator of output sequence
References
__sequential_multiway_merge(), and _GLIBCXX_CALL.
template<bool __stable, bool __sentinels, typename _RAIterIterator, typename _RAIter3, typename _DifferenceTp, typename _Splitter, typename _Compare> _RAIter3 __gnu_parallel::parallel_multiway_merge (_RAIterIterator __seqs_begin, _RAIterIterator __seqs_end, _RAIter3 __target, _Splitter __splitter, _DifferenceTp __length, _Compare __comp, _ThreadIndex __num_threads)
Parallel multi-way merge routine. The _GLIBCXX_PARALLEL_DECISION is based on the branching factor and runtime settings. โ๏ธ
Must not be called if the number of sequences is 1. ๐ซ
Template Parameters
_Splitterโ functor to split input (either__exactor sampling based)__stableโ Stable merging incurs a performance penalty.__sentinelโ Ignored.
Parameters
__seqs_beginโ Begin iterator of iterator pair input sequence.__seqs_endโ End iterator of iterator pair input sequence.__targetโ Begin iterator of output sequence.__compโ Comparator.__lengthโ Maximum length to merge, possibly larger than the number of elements available.
Returns
End iterator of output sequence.
References
__is_sorted(), __sequential_multiway_merge(), _GLIBCXX_CALL, _GLIBCXX_PARALLEL_LENGTH, __gnu_parallel::_Settings::get(), std::make_pair(), __gnu_parallel::_Settings::merge_oversampling, and std::min().
Referenced by
__parallel_merge_advance().
template<bool __stable, bool __exact, typename _RAIter, typename _Compare> void __gnu_parallel::parallel_sort_mwms (_RAIter __begin, _RAIter __end, _Compare __comp, _ThreadIndex __num_threads)
PMWMS main call. ๐
Parameters
__beginโ Begin iterator of sequence.__endโ End iterator of sequence.__compโ Comparator.__num_threadsโ Number of threads to use.
References
_GLIBCXX_CALL, __gnu_parallel::_PMWMSSortingData< _RAIter >::_M_num_threads, __gnu_parallel::_PMWMSSortingData< _RAIter >::_M_offsets, __gnu_parallel::_PMWMSSortingData< _RAIter >::_M_pieces, __gnu_parallel::_PMWMSSortingData< _RAIter >::_M_samples, __gnu_parallel::_PMWMSSortingData< _RAIter >::_M_source, __gnu_parallel::_PMWMSSortingData< _RAIter >::_M_starts, __gnu_parallel::_PMWMSSortingData< _RAIter >::_M_temporary, __gnu_parallel::_Settings::get(), parallel_sort_mwms_pu(), and __gnu_parallel::_Settings::sort_mwms_oversampling.
Referenced by
__parallel_sort(), __parallel_sort(), __parallel_sort(), and __parallel_sort().
template<bool __stable, bool __exact, typename _RAIter, typename _Compare> void __gnu_parallel::parallel_sort_mwms_pu (_PMWMSSortingData< _RAIter > * __sd, _Compare & __comp)
PMWMS code executed by each thread. ๐งต
Parameters
__sdโ Pointer to algorithm data.__compโ Comparator.
References
__gnu_parallel::_PMWMSSortingData< _RAIter >::_M_num_threads, __gnu_parallel::_PMWMSSortingData< _RAIter >::_M_pieces, __gnu_parallel::_PMWMSSortingData< _RAIter >::_M_source, __gnu_parallel::_PMWMSSortingData< _RAIter >::_M_starts, __gnu_parallel::_PMWMSSortingData< _RAIter >::_M_temporary, __gnu_parallel::_Settings::get(), std::make_pair(), __gnu_parallel::_Settings::sort_mwms_oversampling, and std::uninitialized_copy().
Referenced by
parallel_sort_mwms().
Variable Documentation ๐
const int __gnu_parallel::_CASable_bits [static]
Number of bits of _CASable. ๐ข
Referenced by __decode2(), and __encode2().
const _CASable __gnu_parallel::_CASable_mask [static]
_CASable with the right half of bits set to 1. ๐ญ
Referenced by __decode2().
Author โ๏ธ
Generated automatically by Doxygen for libstdc++ from the source code. ๐ค
๐ and that's the whole__gnu_parallel(3)page, bestie! source/version:libstdc++ยท__gnu_parallel(3)ยท date: (the footer didn't show one, but it's giving timeless โจ). stay iconic, stay parallel. ๐๐ฆ
๐ฆ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 ยท GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- centos-stream 10: gcc-toolset-15-libstdc++-docs 15.2.1-8.1.el10 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- centos-stream 10: gcc-toolset-16-libstdc++-docs 16.2.1-1.3.el10 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- centos-stream 10: libstdc++-docs 14.4.1-4.el10 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 43: libstdc++-docs 15.2.1-2.fc43 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 43: libstdc++-docs 15.3.1-1.fc43 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 ยท GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms