NVIDIA / NVIDIA/cccl

[THEME] Universal 64-bit index type support in Thrust/CUB algorithms

Open
#47 2 comments 4 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

# Summary

Users expect Thrust/CUB algorithms to work with input sequences larger than `INT_MAX`. However, for historical reasons, many Thrust/CUB algorithms are hard-coded to use `int` as the index/offset type. As a result, those algorithms will fail (often silently) when provided inputs whose extent is larger than `std::numeric_limits::max()`.

In order to provide a delightful and consistent user experience, every Thrust/CUB should be able to work with inputs larger than `INT_MAX`. However, we likely want different solutions in Thrust vs CUB.

# Intended Outcome

### Thrust

- All Thrust algorithms should work with large inputs by default.
- Users should be able to opt-in to explicitly specify the offset type to avoid any compile/run-time overhead

### CUB

- CUB algorithms need not work with large inputs by default, but should _enable_ users to work with large inputs

### Depends On
- [ ] https://github.com/NVIDIA/cccl/issues/24

# Tasks
- [ ] https://github.com/NVIDIA/cccl/issues/49
- [ ] https://github.com/NVIDIA/cccl/issues/50
# Related Info

https://github.com/NVIDIA/cub/issues/212 was the previous tracking issue in CUB that has a lot of good discussion about what we want a solution to look like in Thrust vs CUB.

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.