NVIDIA / cccl

CUDA Core Compute Libraries
https://nvidia.github.io/cccl/
Other
1.25k stars 160 forks source link

variadic template implementation of thrust::tuple #695

Closed andrewcorrigan closed 11 months ago

andrewcorrigan commented 10 years ago

thrust::tuple does not use variadic templates. A variadic template implementation of thrust::tuple would not just make the internal implementation more elegant, there are serious practical issues with the current thrust::tuple implementation:

  1. Only tuples of size 10 may be used. Nested tuples are often an inconvenient workaround and are not always feasible.
  2. Compilation speed is poor, which could otherwise be significantly improved by using variadic templates. [1]
  3. Compiler error diagnostics are often unreadable due to thrust::null_type everywhere.

In consideration of the fact that C++11 support in nvcc is still in the release candidate, undocumented, and requires host compiler support, I don't expect C++03 support to be dropped anytime soon. Instead, can a user-supplied compile-time macro (e.g. THRUST_USE_CXX11) or auto-detection of __cplusplus >= 201103L please be considered to switch to an alternate implementation?

[1] http://www.jot.fm/issues/issue_2008_02/article2.pdf

alliepiper commented 2 years ago

We're slowly progressing on this -- We'll be adding a libcu++ dependency in the near future, which will enable us to start using their variadic tuple implementation.

jrhemstad commented 11 months ago

Closed by https://github.com/NVIDIA/cccl/pull/262