Skip to content

Use forward declarations of extended floating point types instead of including the headers#5846

Merged
miscco merged 4 commits intoNVIDIA:mainfrom
miscco:forward_declare_cuda_fp_types
Sep 10, 2025
Merged

Use forward declarations of extended floating point types instead of including the headers#5846
miscco merged 4 commits intoNVIDIA:mainfrom
miscco:forward_declare_cuda_fp_types

Conversation

@miscco
Copy link
Contributor

@miscco miscco commented Sep 10, 2025

The cuda floating point headers carry a lot of weight.

We only really need those for cmath and complex, so try and get away with only forward declaring the types if available for in other places

@miscco miscco requested a review from a team as a code owner September 10, 2025 10:48
@miscco miscco requested a review from davebayer September 10, 2025 10:48
@github-project-automation github-project-automation bot moved this to Todo in CCCL Sep 10, 2025
@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Sep 10, 2025
Comment on lines +80 to +83
struct __nv_fp8_e8m0;
struct __nv_fp8x2_e8m0;
struct __nv_fp8x4_e8m0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be guarded by _CCCL_HAS_NVFP8_E8M0(). Maybe we can move the forward declarations lower and guard all of them by their corresponding _CCCL_HAS_NVFPX macro

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the header that sets all the _CCCL_HAS_NVFPX macros

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the CTK check, so we should be fine

@github-project-automation github-project-automation bot moved this from In Review to In Progress in CCCL Sep 10, 2025
@miscco miscco requested review from a team as code owners September 10, 2025 11:19
@github-project-automation github-project-automation bot moved this from In Progress to In Review in CCCL Sep 10, 2025
…including the headers

The cuda floating point headers carry a lot of weight.

We only really need those for `cmath` and `complex`, so try and get away with only forward declaring the types if available for in other places
@miscco miscco force-pushed the forward_declare_cuda_fp_types branch from d1d9245 to c6c9edd Compare September 10, 2025 15:13
@github-actions
Copy link
Contributor

🥳 CI Workflow Results

🟩 Finished in 3h 36m: Pass: 100%/229 | Total: 8d 12h | Max: 3h 35m | Hits: 44%/348747

See results here.

@miscco miscco merged commit 0b700f3 into NVIDIA:main Sep 10, 2025
239 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Sep 10, 2025
@miscco miscco deleted the forward_declare_cuda_fp_types branch September 10, 2025 19:21
miscco added a commit that referenced this pull request Sep 23, 2025
…including the headers (#5846)

* Use forward declarations of extended floating point types instead of including the headers

The cuda floating point headers carry a lot of weight.

We only really need those for `cmath` and `complex`, so try and get away with only forward declaring the types if available for in other places

* Also do not include the full headers when we only need forward declarations for CUB / thrust

* Guard availability of `__nv_fp8_e8m0` on CTK version

* Include header for floating_point tests
miscco added a commit that referenced this pull request Sep 23, 2025
…including the headers (#5846)

* Use forward declarations of extended floating point types instead of including the headers

The cuda floating point headers carry a lot of weight.

We only really need those for `cmath` and `complex`, so try and get away with only forward declaring the types if available for in other places

* Also do not include the full headers when we only need forward declarations for CUB / thrust

* Guard availability of `__nv_fp8_e8m0` on CTK version

* Include header for floating_point tests
miscco added a commit that referenced this pull request Sep 24, 2025
…pes instead of including the headers (#5846) (#5978)

* Use forward declarations of extended floating point types instead of including the headers (#5846)

* Use forward declarations of extended floating point types instead of including the headers

The cuda floating point headers carry a lot of weight.

We only really need those for `cmath` and `complex`, so try and get away with only forward declaring the types if available for in other places

* Also do not include the full headers when we only need forward declarations for CUB / thrust

* Guard availability of `__nv_fp8_e8m0` on CTK version

* Include header for floating_point tests

* Fix python builds?
pciolkosz pushed a commit to pciolkosz/cccl that referenced this pull request Sep 24, 2025
…including the headers (NVIDIA#5846)

* Use forward declarations of extended floating point types instead of including the headers

The cuda floating point headers carry a lot of weight.

We only really need those for `cmath` and `complex`, so try and get away with only forward declaring the types if available for in other places

* Also do not include the full headers when we only need forward declarations for CUB / thrust

* Guard availability of `__nv_fp8_e8m0` on CTK version

* Include header for floating_point tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants