cuda::std::simd Optimize Arithmetic Floating-point Operations#8775
Open
fbusato wants to merge 8 commits intoNVIDIA:mainfrom
Open
cuda::std::simd Optimize Arithmetic Floating-point Operations#8775fbusato wants to merge 8 commits intoNVIDIA:mainfrom
cuda::std::simd Optimize Arithmetic Floating-point Operations#8775fbusato wants to merge 8 commits intoNVIDIA:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
cuda::std::simd Optimize basic vector operationscuda::std::simd Optimize Arithmentic Floating-point Operations
This comment has been minimized.
This comment has been minimized.
Jacobfaib
reviewed
May 1, 2026
| # define _CCCL_HAS_SIMD_F32X2() 0 | ||
| #endif // _CCCL_CUDA_COMPILER(NVCC, >=, 12, 8) || (__cccl_ptx_isa >= 860ULL) | ||
|
|
||
| #if _CCCL_HAS_SIMD_F32X2() |
Contributor
There was a problem hiding this comment.
Does the entire file need to be gated behind this? I notice that only a few functions specifically need it, and for those you can just add an extra #else clause that does the naive algorithm.
This saves downstream users also needing to gate their code behind _CCCL_HAS_SIMD_F32X2() as the symbols always exist.
Contributor
Author
There was a problem hiding this comment.
This is intentional. Users should never use this file
| endif() | ||
|
|
||
| set(simd_codegen_cuda_archs 80 90) | ||
| if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.9) |
Contributor
There was a problem hiding this comment.
Don't assume nvcc here. Can also be clang-cuda
Contributor
Author
There was a problem hiding this comment.
I don't think checking the SASS code for clang-cuda is critical
Contributor
Author
There was a problem hiding this comment.
I followed atomic_codegen. I defer it to @wmaxey
This comment has been minimized.
This comment has been minimized.
cuda::std::simd Optimize Arithmentic Floating-point Operationscuda::std::simd Optimize Arithmetic Floating-point Operations
Contributor
😬 CI Workflow Results🟥 Finished in 1h 08m: Pass: 98%/110 | Total: 19h 00m | Max: 43m 45s | Hits: 98%/307133See results here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces the following optimizations and checks:
HADD2,HMUL2,HFMAfor Half and Bfloat16: There are no single-element variants, so here we only check that all operators relying on them generate the expected number of instructions of that type.F32x2Blackwell SM100: Ensure that the following operations are mapped toF32x2instructions:+-(-)++--