cub::DispatchSegmentedSort#

template<SortOrder Order, typename KeyT, typename ValueT, typename OffsetT, typename BeginOffsetIteratorT, typename EndOffsetIteratorT, typename PolicyHub = detail::segmented_sort::policy_hub<KeyT, ValueT>, typename KernelSource = detail::segmented_sort::DeviceSegmentedSortKernelSource<typename PolicyHub::MaxPolicy, Order, KeyT, ValueT, BeginOffsetIteratorT, EndOffsetIteratorT, OffsetT>, typename PartitionPolicyHub = detail::three_way_partition::policy_hub<cub::detail::it_value_t<THRUST_NS_QUALIFIER::counting_iterator<cub::detail::segmented_sort::local_segment_index_t>>, detail::three_way_partition::per_partition_offset_t>, typename PartitionKernelSource = detail::three_way_partition::DeviceThreeWayPartitionKernelSource<typename PartitionPolicyHub::MaxPolicy, THRUST_NS_QUALIFIER::counting_iterator<cub::detail::segmented_sort::local_segment_index_t>, cub::detail::segmented_sort::local_segment_index_t*, cub::detail::segmented_sort::local_segment_index_t*, ::cuda::std::reverse_iterator<cub::detail::segmented_sort::local_segment_index_t*>, cub::detail::segmented_sort::local_segment_index_t*, detail::three_way_partition::ScanTileStateT, cub::detail::segmented_sort::LargeSegmentsSelectorT<OffsetT, BeginOffsetIteratorT, EndOffsetIteratorT>, cub::detail::segmented_sort::SmallSegmentsSelectorT<OffsetT, BeginOffsetIteratorT, EndOffsetIteratorT>, detail::three_way_partition::per_partition_offset_t, detail::three_way_partition::streaming_context_t<cub::detail::segmented_sort::global_segment_offset_t>, detail::choose_signed_offset<cub::detail::segmented_sort::global_segment_offset_t>::type>, typename KernelLauncherFactory = CUB_DETAIL_DEFAULT_KERNEL_LAUNCHER_FACTORY>
struct DispatchSegmentedSort#

Public Types

using local_segment_index_t = detail::segmented_sort::local_segment_index_t#
using global_segment_offset_t = detail::segmented_sort::global_segment_offset_t#

Public Functions

template<typename ActivePolicyT>
inline cudaError_t Invoke(
ActivePolicyT policy = {},
)#

Public Members

void *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.

size_t &temp_storage_bytes#

Reference to size in bytes of d_temp_storage allocation.

DoubleBuffer<KeyT> &d_keys#

Double-buffer whose current buffer contains the unsorted input keys and, upon return, is updated to point to the sorted output keys.

DoubleBuffer<ValueT> &d_values#

Double-buffer whose current buffer contains the unsorted input values and, upon return, is updated to point to the sorted output values.

::cuda::std::int64_t num_items#

Number of items to sort.

global_segment_offset_t num_segments#

The number of segments that comprise the sorting data.

BeginOffsetIteratorT d_begin_offsets#

Random-access input iterator to the sequence of beginning offsets of length num_segments, such that d_begin_offsets[i] is the first element of the ith data segment in d_keys_* and d_values_*

EndOffsetIteratorT d_end_offsets#

Random-access input iterator to the sequence of ending offsets of length num_segments, such that d_end_offsets[i]-1 is the last element of the ith data segment in d_keys_* and d_values_*.

If d_end_offsets[i]-1 <= d_begin_offsets[i], the ith is considered empty.

bool is_overwrite_okay#

Whether is okay to overwrite source buffers.

cudaStream_t stream#

CUDA stream to launch kernels within.

KernelSource kernel_source#
PartitionKernelSource partition_kernel_source#
KernelLauncherFactory launcher_factory#
PartitionPolicyHub::MaxPolicy partition_max_policy#

Public Static Functions

template<typename MaxPolicyT = typename PolicyHub::MaxPolicy, typename PartitionMaxPolicyT = typename PartitionPolicyHub::MaxPolicy>
static inline cudaError_t Dispatch(
void *d_temp_storage,
size_t &temp_storage_bytes,
DoubleBuffer<KeyT> &d_keys,
DoubleBuffer<ValueT> &d_values,
::cuda::std::int64_t num_items,
global_segment_offset_t num_segments,
BeginOffsetIteratorT d_begin_offsets,
EndOffsetIteratorT d_end_offsets,
bool is_overwrite_okay,
cudaStream_t stream,
KernelSource kernel_source = {},
PartitionKernelSource partition_kernel_source = {},
KernelLauncherFactory launcher_factory = {},
MaxPolicyT max_policy = {},
PartitionMaxPolicyT partition_max_policy = {},
)#

Public Static Attributes

static constexpr int KEYS_ONLY = ::cuda::std::is_same_v<ValueT, NullType>#
static constexpr size_t num_selected_groups = 2#