NVIDIA / NVIDIA/cccl

[EPIC] Clarify support for CCCL headers with host-only translation units

Open
#1,374 1 comment 1 reaction 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

General CCCL

### Is your feature request related to a problem? Please describe.

As a user of CCCL code, there are certain headers and features that I'd like to be able to use independent of compiling with `nvcc`. In other words, I'd like to know which headers and functionality can be used with only a host compiler (i.e., no `nvcc`).

I'd expect CCCL to clearly document guarantees which headers/features should work in host-only TUs. Furthermore, I'd expect CCCL to thoroughly test these guarantees as part of its CI testing.

### Describe the solution you'd like

### Tasks
- [ ] Document guarantees about host-only support for `libcudacxx` headers
- [ ] https://github.com/NVIDIA/cccl/issues/1658
- [ ] Document guarantees about ABI consistency for `cuda::` types between host and device TUs
- [ ] Document guarantees about host-only support for `Thrust` headers
- [x] Document (lack of) guarantees about ABI consistency for `thrust::` types between host and device TUs
- [x] Ensure CI testing for supported `thrust` headers in host-only TUs (https://github.com/NVIDIA/cccl/pull/1722)
- [ ] Document (lack of) guarantees about host-only support for `CUB` headers

### Additional context

Off the top of my head, here's a quick summary of the status quo:
- Every `cuda/` header should be able to be included in a host-only TU and compile succesfully. The ABI should always be consistent between host and device TUs.
- No `cub/` header supports inclusion in host-only TUs and this will never change
- No `thrust/` header is supported in host-only TUs when `THRUST_DEVICE_SYSTEM=CUDA`. Likewise, `thrust::` types are not guaranteed to have a consistent ABI between host and device TUs
- `thrust/` headers are supported in host-only TUs when `THRUST_DEVICE_SYSTEM={CPP, OMP, TBB}`

Related:
- https://github.com/NVIDIA/cccl/issues/1262

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.