NVIDIA / NVIDIA/cccl

[FEA]: Optimize `cub::DeviceSelect::Flagged`

Open
#326 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.

CUB Select currently has a common implementation for flagged and if variants. The implementation unconditionally loads items and then applies a predicate or loads flags. This approach could be improved for the case of the flagged variant.

### Describe the solution you'd like

If all flags (of a warp, for example) are not set, we could skip loading the items. Results described in this [paper](https://link.springer.com/chapter/10.1007/978-3-031-12597-3_12) rely on this optimization and illustrate significant speedups compared to CUB.

### 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.