NVIDIA / NVIDIA/cccl

[FEA]: Add efficient unstable thread sort

Open
#1,551 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

### Is this a duplicate?

- [X] I confirmed there appear to be no [duplicate issues](https://github.com/NVIDIA/cccl/issues) for this request and that I agree to the [Code of Conduct](CODE_OF_CONDUCT.md)

### Area

CUB

### Is your feature request related to a problem? Please describe.

The thread sort currently only has a stable method, the odd-even transpose sorting network, which has a complexity O(N^2).

### Describe the solution you'd like

Other sorting networks such as Batcher's odd-even mergesort and Parberry's pairwise sort scale much better, with a complexity O(N log^2(N)), so for instance at 16 items/thread they would be 2x faster, at 64 items/thread 4x faster.

The block merge sort has stable and unstable APIs which could select the appropriate thread sort accordingly.

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.