NVIDIA / NVIDIA/cccl

[EPIC] Consolidate kernels between Thrust and CUB

Open
#26 2 comments 2 reactions 1 assignee Claimed by @elstehle View on GitHub
cub thrust
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

Below is a list of tasks in prioritized order. We should start with algorithms that already exist in CUB. This will allow delivering CUB optimizations into Thrust sooner.
### Document procedure
- [x] https://github.com/NVIDIA/cccl/issues/1585

### Replace Thrust Algorithms with CUB
- [x] #1210
- [x] https://github.com/NVIDIA/cccl/issues/1263
- [x] https://github.com/NVIDIA/cccl/issues/1383
- [x] https://github.com/NVIDIA/cccl/issues/1397
- [x] https://github.com/NVIDIA/cccl/issues/1625
- [x] https://github.com/NVIDIA/cccl/issues/1626
- [ ] https://github.com/NVIDIA/cccl/issues/5401
- [ ] Make sure that thrust calls to cub algorithms use the `Device*` interface (i.e., to make sure we use the index type that is optimized for the cub algorithm) - or alternatively go via `Dispatch*` interface but make sure to use the right offset type

### Port Thrust Algorithms into CUB
- [x] https://github.com/NVIDIA/cccl/issues/1231
- [x] https://github.com/NVIDIA/cccl/issues/1763
- [ ] #11053

A few notes:
- `thrust::partition_copy` and `thrust::stable_partition_copy` require taking two separate/distinct output iterators: one for the selected and one for the rejected items. `DevicePartition`, however, currently only supports a single output iterator, where the selected items are written to the beginning in order and the rejected items are written to the end in reverse order, respectively. Supporting the these two thrust algorithms requires extending `AgentSelectIf`, implementing overloads for methods like `ScatterTwoPhase` that are concerned with writing rejected items to the output iterators.
- Partition and copy doesn't have stencil overload in CUB. We might experiment with using `::Flagged` version along with a transform iterator.
- While porting `thrust::reduce_by_key` we need to decide on accumulator type.

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.