- The SortEnactor provides a convenient wrapper around the fastest CUDA sorting library available, allowing to perform both key-only and key-value pair sorting of arrays with the following data-types:
- uint8
- uint16
- uint32
- uint64
- (uint8,uint32)
- (uint16,uint32)
- (uint32,uint32)
- (uint64,uint32)
- The way most parallel sorting algorithms work require having a set of ping-pong buffers that are exchanged at every pass through the data. In order to do this, and communicate where the sorted data lies after its work, SortEnactor employs an auxiliary class, SortBuffers. The following example shows their combined usage.
{
cuda::SortBuffers<uint32*,uint32*> sort_buffers;
cuda::SortEnactor sort_enactor;
sort_enactor.sort( n, sort_buffers );
uint32* d_sorted_keys = sort_buffers.current_keys();
uint32* d_sorted_data = sort_buffers.current_values();
...
}