cub::StableOddEvenSort

Defined in cub/thread/thread_sort.cuh

template<typename KeyT, typename ValueT, typename CompareOp, int ITEMS_PER_THREAD>
void cub::StableOddEvenSort(KeyT (&keys)[ITEMS_PER_THREAD], ValueT (&items)[ITEMS_PER_THREAD], CompareOp compare_op)

Sorts data using odd-even sort method.

The sorting method is stable. Further details can be found in: A. Nico Habermann. Parallel neighbor sort (or the glory of the induction principle). Technical Report AD-759 248, Carnegie Mellon University, 1972.

Template Parameters
  • KeyT – Key type

  • ValueT – Value type. If cub::NullType is used as ValueT, only keys are sorted.

  • CompareOp – functor type having member bool operator()(KeyT lhs, KeyT rhs)

  • ITEMS_PER_THREAD – The number of items per thread

Parameters
  • keys[inout] Keys to sort

  • items[inout] Values to sort

  • compare_op[in] Comparison function object which returns true if the first argument is ordered before the second