|
Template Numerical Library version\ main:4904c12
|
CUDA merge sort using CUB's DeviceMergeSort. More...
#include <TNL/Algorithms/Sorting/CUBMergeSort.h>
Static Public Member Functions | |
| template<typename Array> | |
| static void | sort (Array &array) |
| Sort array in ascending order. | |
| template<typename Array, typename Compare> | |
| static void | sort (Array &array, const Compare &compare) |
| Sort array using custom comparison function. | |
CUDA merge sort using CUB's DeviceMergeSort.
This class provides a wrapper for merge sort implementation from NVIDIA's CUB library. It uses the cub::DeviceMergeSort::SortKeys algorithm which performs a merge sort on device-resident data.
Merge sort differs from radix sort in several key aspects:
|
inlinestatic |
Sort array in ascending order.
| Array | is a type of container to be sorted. It must be TNL::Containers::Array or TNL::Containers::ArrayView with TNL::Devices::Cuda device type. |
| array | The array to sort (will be modified in-place). |
|
inlinestatic |
Sort array using custom comparison function.
| array | The array to sort (will be modified in-place). |
| compare | Comparison function object that returns true if the first argument should be ordered before the second. |