MCPcopy Create free account
hub / github.com/dmlc/xgboost / StableSort

Function StableSort

src/common/algorithm.h:43–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41
42template <typename Iter, typename Comp>
43void StableSort(Context const *ctx, Iter begin, Iter end, Comp &&comp) {
44 if (ctx->Threads() > 1) {
45#if defined(GCC_HAS_PARALLEL)
46 __gnu_parallel::stable_sort(begin, end, comp,
47 __gnu_parallel::default_parallel_tag(ctx->Threads()));
48#else
49 // the only stable sort is radix sort for msvc ppl.
50 std::stable_sort(begin, end, comp);
51#endif // GLIBC VERSION
52 } else {
53 std::stable_sort(begin, end, comp);
54 }
55}
56
57template <typename Iter, typename Comp>
58void Sort(Context const *ctx, Iter begin, Iter end, Comp comp) {

Callers 5

data.ccFile · 0.85
ArgSortFunction · 0.85
QuantileFunction · 0.85
WeightedQuantileFunction · 0.85
TESTFunction · 0.85

Calls 1

ThreadsMethod · 0.80

Tested by 1

TESTFunction · 0.68