Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 of 8 tasks
jrhemstad opened this issue Feb 13, 2024 · 1 comment
Open
3 of 8 tasks
Labels
feature request New feature or request.

Comments

@jrhemstad
Copy link
Collaborator

jrhemstad commented Feb 13, 2024

Is this a duplicate?

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

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:

@jrhemstad jrhemstad added the feature request New feature or request. label Feb 13, 2024
@github-project-automation github-project-automation bot moved this to Todo in CCCL Feb 13, 2024
@jrhemstad jrhemstad changed the title [EPIC] Host-only functionality and testing [EPIC] Clarify support for CCCL headers with host-only translation units Feb 13, 2024
@bernhardmgruber
Copy link
Contributor

Here is the wording in the current documentation of libcu++:

  • std:: / <*>: This is your host compiler's Standard Library that works in __host__ code only, although you
    can use the --expt-relaxed-constexpr flag to use any constexpr functions in __device__ code.
    libcu++ does not replace or interfere with host compiler's Standard Library.
  • cuda::std:: / <cuda/std/*>: Conforming implementations of facilities from the Standard Library that work in
    __host__ __device__ code.
  • cuda:: / <cuda/*>: Conforming extensions to the Standard Library that work in __host__ __device__ code.
  • cuda::device / <cuda/device/*>: Conforming extensions to the Standard Library that work only in
    __device__ code.
  • cuda::ptx: C++ convenience wrappers for inline PTX (only usable in __device__ code).

I discussed with @wmaxey that "works in __host__ code" implies that it can be compiled by a non-CUDA compiler like g++. We should add a corresponding clarifying comment to the documentation of libcu++.

jerry060599 added a commit to jerry060599/KittenGpuLBVH that referenced this issue Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request.
Projects
Status: Todo
Development

No branches or pull requests

2 participants