[FEA]: Optimize `cub::DeviceUniqueByKey` by conditionally loading values
- 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.
Similar to https://github.com/NVIDIA/cccl/issues/326, CUB UniqueByKey unconditionally loads all values before figuring out which keys are are actually needed.
### Describe the solution you'd like
If all values are not set, we should skip them. An early implementation where I only load after we figure out which values to keep lead to regressions in a few cases, notably for smaller input sizes.
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.