CUB
|
DeviceMergeSort provides device-wide, parallel operations for computing a merge sort across a sequence of data items residing within device-accessible memory.
Static Public Methods | |
template<typename KeyIteratorT , typename ValueIteratorT , typename OffsetT , typename CompareOpT > | |
static CUB_RUNTIME_FUNCTION cudaError_t | SortPairs (void *d_temp_storage, std::size_t &temp_storage_bytes, KeyIteratorT d_keys, ValueIteratorT d_items, OffsetT num_items, CompareOpT compare_op, cudaStream_t stream=0, bool debug_synchronous=false) |
Sorts items using a merge sorting method. More... | |
template<typename KeyInputIteratorT , typename ValueInputIteratorT , typename KeyIteratorT , typename ValueIteratorT , typename OffsetT , typename CompareOpT > | |
static CUB_RUNTIME_FUNCTION cudaError_t | SortPairsCopy (void *d_temp_storage, std::size_t &temp_storage_bytes, KeyInputIteratorT d_input_keys, ValueInputIteratorT d_input_items, KeyIteratorT d_output_keys, ValueIteratorT d_output_items, OffsetT num_items, CompareOpT compare_op, cudaStream_t stream=0, bool debug_synchronous=false) |
Sorts items using a merge sorting method. More... | |
template<typename KeyIteratorT , typename OffsetT , typename CompareOpT > | |
static CUB_RUNTIME_FUNCTION cudaError_t | SortKeys (void *d_temp_storage, std::size_t &temp_storage_bytes, KeyIteratorT d_keys, OffsetT num_items, CompareOpT compare_op, cudaStream_t stream=0, bool debug_synchronous=false) |
Sorts items using a merge sorting method. More... | |
template<typename KeyInputIteratorT , typename KeyIteratorT , typename OffsetT , typename CompareOpT > | |
static CUB_RUNTIME_FUNCTION cudaError_t | SortKeysCopy (void *d_temp_storage, std::size_t &temp_storage_bytes, KeyInputIteratorT d_input_keys, KeyIteratorT d_output_keys, OffsetT num_items, CompareOpT compare_op, cudaStream_t stream=0, bool debug_synchronous=false) |
Sorts items using a merge sorting method. More... | |
template<typename KeyIteratorT , typename ValueIteratorT , typename OffsetT , typename CompareOpT > | |
static CUB_RUNTIME_FUNCTION cudaError_t | StableSortPairs (void *d_temp_storage, std::size_t &temp_storage_bytes, KeyIteratorT d_keys, ValueIteratorT d_items, OffsetT num_items, CompareOpT compare_op, cudaStream_t stream=0, bool debug_synchronous=false) |
Sorts items using a merge sorting method. More... | |
template<typename KeyIteratorT , typename OffsetT , typename CompareOpT > | |
static CUB_RUNTIME_FUNCTION cudaError_t | StableSortKeys (void *d_temp_storage, std::size_t &temp_storage_bytes, KeyIteratorT d_keys, OffsetT num_items, CompareOpT compare_op, cudaStream_t stream=0, bool debug_synchronous=false) |
Sorts items using a merge sorting method. More... | |
|
inlinestatic |
Sorts items using a merge sorting method.
int
keys with associated vector of int
values. KeyIteratorT | is a model of Random Access Iterator. KeyIteratorT is mutable, and its value_type is a model of LessThan Comparable. This value_type 's ordering relation is a strict weak ordering as defined in the LessThan Comparable requirements. |
ValueIteratorT | is a model of Random Access Iterator, and ValueIteratorT is mutable. |
OffsetT | is an integer type for global offsets. |
CompareOpT | is a type of callable object with the signature bool operator()(KeyT lhs, KeyT rhs) that models the Strict Weak Ordering concept. |
[in] | d_temp_storage | Device-accessible allocation of temporary storage. When nullptr , the required allocation size is written to temp_storage_bytes and no work is done. |
[in,out] | temp_storage_bytes | Reference to size in bytes of d_temp_storage allocation |
[in,out] | d_keys | Pointer to the input sequence of unsorted input keys |
[in,out] | d_items | Pointer to the input sequence of unsorted input values |
[in] | num_items | Number of items to sort |
[in] | compare_op | Comparison function object which returns true if the first argument is ordered before the second |
[in] | stream | **[optional]** CUDA stream to launch kernels within. Default is stream0. |
[in] | debug_synchronous | **[optional]** Whether or not to synchronize the stream after every kernel launch to check for errors. Also causes launch configurations to be printed to the console. Default is false . |
|
inlinestatic |
Sorts items using a merge sorting method.
i
and j
are equivalent: neither one is less than the other. It is not guaranteed that the relative order of these two elements will be preserved by sort.d_input_keys
and d_input_items
are not modified.int
keys with associated vector of int
values. KeyInputIteratorT | is a model of Random Access Iterator. Its value_type is a model of LessThan Comparable. This value_type 's ordering relation is a strict weak ordering as defined in the LessThan Comparable requirements. |
ValueInputIteratorT | is a model of Random Access Iterator. |
KeyIteratorT | is a model of Random Access Iterator. KeyIteratorT is mutable, and its value_type is a model of LessThan Comparable. This value_type 's ordering relation is a strict weak ordering as defined in the LessThan Comparable requirements. |
ValueIteratorT | is a model of Random Access Iterator, and ValueIteratorT is mutable. |
OffsetT | is an integer type for global offsets. |
CompareOpT | is a type of callable object with the signature bool operator()(KeyT lhs, KeyT rhs) that models the Strict Weak Ordering concept. |
[in] | d_temp_storage | Device-accessible allocation of temporary storage. When nullptr , the required allocation size is written to temp_storage_bytes and no work is done. |
[in,out] | temp_storage_bytes | Reference to size in bytes of d_temp_storage allocation |
[in] | d_input_keys | Pointer to the input sequence of unsorted input keys |
[in] | d_input_items | Pointer to the input sequence of unsorted input values |
[out] | d_output_keys | Pointer to the output sequence of sorted input keys |
[out] | d_output_items | Pointer to the output sequence of sorted input values |
[in] | num_items | Number of items to sort |
[in] | compare_op | Comparison function object which returns true if the first argument is ordered before the second |
[in] | stream | **[optional]** CUDA stream to launch kernels within. Default is stream0. |
[in] | debug_synchronous | **[optional]** Whether or not to synchronize the stream after every kernel launch to check for errors. Also causes launch configurations to be printed to the console. Default is false . |
|
inlinestatic |
Sorts items using a merge sorting method.
i
and j
are equivalent: neither one is less than the other. It is not guaranteed that the relative order of these two elements will be preserved by sort.int
keys. KeyIteratorT | is a model of Random Access Iterator. KeyIteratorT is mutable, and its value_type is a model of LessThan Comparable. This value_type 's ordering relation is a strict weak ordering as defined in the LessThan Comparable requirements. |
OffsetT | is an integer type for global offsets. |
CompareOpT | is a type of callable object with the signature bool operator()(KeyT lhs, KeyT rhs) that models the Strict Weak Ordering concept. |
[in] | d_temp_storage | Device-accessible allocation of temporary storage. When nullptr , the required allocation size is written to temp_storage_bytes and no work is done. |
[in,out] | temp_storage_bytes | Reference to size in bytes of d_temp_storage allocation |
[in,out] | d_keys | Pointer to the input sequence of unsorted input keys |
[in] | num_items | Number of items to sort |
[in] | compare_op | Comparison function object which returns true if the first argument is ordered before the second |
[in] | stream | **[optional]** CUDA stream to launch kernels within. Default is stream0. |
[in] | debug_synchronous | **[optional]** Whether or not to synchronize the stream after every kernel launch to check for errors. Also causes launch configurations to be printed to the console. Default is false . |
|
inlinestatic |
Sorts items using a merge sorting method.
i
and j
are equivalent: neither one is less than the other. It is not guaranteed that the relative order of these two elements will be preserved by sort.int
keys. KeyInputIteratorT | is a model of Random Access Iterator. Its value_type is a model of LessThan Comparable. This value_type 's ordering relation is a strict weak ordering as defined in the LessThan Comparable requirements. |
KeyIteratorT | is a model of Random Access Iterator. KeyIteratorT is mutable, and its value_type is a model of LessThan Comparable. This value_type 's ordering relation is a strict weak ordering as defined in the LessThan Comparable requirements. |
OffsetT | is an integer type for global offsets. |
CompareOpT | is a type of callable object with the signature bool operator()(KeyT lhs, KeyT rhs) that models the Strict Weak Ordering concept. |
[in] | d_temp_storage | Device-accessible allocation of temporary storage. When nullptr , the required allocation size is written to temp_storage_bytes and no work is done. |
[in,out] | temp_storage_bytes | Reference to size in bytes of d_temp_storage allocation |
[in] | d_input_keys | Pointer to the input sequence of unsorted input keys |
[out] | d_output_keys | Pointer to the output sequence of sorted input keys |
[in] | num_items | Number of items to sort |
[in] | compare_op | Comparison function object which returns true if the first argument is ordered before the second |
[in] | stream | **[optional]** CUDA stream to launch kernels within. Default is stream0. |
[in] | debug_synchronous | **[optional]** Whether or not to synchronize the stream after every kernel launch to check for errors. Also causes launch configurations to be printed to the console. Default is false . |
|
inlinestatic |
Sorts items using a merge sorting method.
int
keys with associated vector of int
values. KeyIteratorT | is a model of Random Access Iterator. KeyIteratorT is mutable, and its value_type is a model of LessThan Comparable. This value_type 's ordering relation is a strict weak ordering as defined in the LessThan Comparable requirements. |
ValueIteratorT | is a model of Random Access Iterator, and ValueIteratorT is mutable. |
OffsetT | is an integer type for global offsets. |
CompareOpT | is a type of callable object with the signature bool operator()(KeyT lhs, KeyT rhs) that models the Strict Weak Ordering concept. |
[in] | d_temp_storage | Device-accessible allocation of temporary storage. When nullptr , the required allocation size is written to temp_storage_bytes and no work is done. |
[in,out] | temp_storage_bytes | Reference to size in bytes of d_temp_storage allocation |
[in,out] | d_keys | Pointer to the input sequence of unsorted input keys |
[in,out] | d_items | Pointer to the input sequence of unsorted input values |
[in] | num_items | Number of items to sort |
[in] | compare_op | Comparison function object which returns true if the first argument is ordered before the second |
[in] | stream | **[optional]** CUDA stream to launch kernels within. Default is stream0. |
[in] | debug_synchronous | **[optional]** Whether or not to synchronize the stream after every kernel launch to check for errors. Also causes launch configurations to be printed to the console. Default is false . |
|
inlinestatic |
Sorts items using a merge sorting method.
x
and y
are elements such that x
precedes y
, and if the two elements are equivalent (neither x < y
nor y < x
) then a postcondition of stable_sort is that x
still precedes y
.int
keys. KeyIteratorT | is a model of Random Access Iterator. KeyIteratorT is mutable, and its value_type is a model of LessThan Comparable. This value_type 's ordering relation is a strict weak ordering as defined in the LessThan Comparable requirements. |
OffsetT | is an integer type for global offsets. |
CompareOpT | is a type of callable object with the signature bool operator()(KeyT lhs, KeyT rhs) that models the Strict Weak Ordering concept. |
[in] | d_temp_storage | Device-accessible allocation of temporary storage. When nullptr , the required allocation size is written to temp_storage_bytes and no work is done. |
[in,out] | temp_storage_bytes | Reference to size in bytes of d_temp_storage allocation |
[in,out] | d_keys | Pointer to the input sequence of unsorted input keys |
[in] | num_items | Number of items to sort |
[in] | compare_op | Comparison function object which returns true if the first argument is ordered before the second |
[in] | stream | **[optional]** CUDA stream to launch kernels within. Default is stream0. |
[in] | debug_synchronous | **[optional]** Whether or not to synchronize the stream after every kernel launch to check for errors. Also causes launch configurations to be printed to the console. Default is false . |