Enable __float128 in cuda::std::copysign and cuda::std::signbit#9991
Enable __float128 in cuda::std::copysign and cuda::std::signbit#9991temujinkz wants to merge 1 commit into
__float128 in cuda::std::copysign and cuda::std::signbit#9991Conversation
Signed-off-by: temujinkz <ttalkenov@gmail.com>
📝 WalkthroughSummary by CodeRabbit
WalkthroughChangesFloat128 math support
Assessment against linked issues
Suggested reviewers: Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
libcudacxx/include/cuda/std/__cmath/copysign.h (1)
77-95: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winsuggestion: Keep the preprocessor annotations identical to their controlling condition.
Line 80 uses
#if defined(_CCCL_BUILTIN_COPYSIGNF128), but Lines 88 and 93 annotate a negated form. Repeatdefined(_CCCL_BUILTIN_COPYSIGNF128)verbatim in both comments.Based on learnings, annotated
#elseand#endifbranches must repeat the exact condition text from the corresponding#if.Source: Learnings
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 317e6c30-970e-4f59-b80c-0f98030a808d
📒 Files selected for processing (3)
libcudacxx/include/cuda/std/__cmath/copysign.hlibcudacxx/test/libcudacxx/std/numerics/c.math/fp_manip/copysign.pass.cpplibcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/signbit.pass.cpp
Adds
__float128support tocuda::std::copysignand test coverage for bothcopysignandsignbit. Doing these two together since thesignbittest generates its negative values throughcopysign.copysignfollows the same pattern asfabsin #9895: route to__builtin_copysignf128when available, to__nv_fp128_copysignin device code otherwise, and keep the existing storage mask path as the constexpr fallback.signbitneeded no implementation change, the generic sign mask path already handles binary128.No
__float128capable host here (macOS arm64), so locally I could only compile and run both tests with float128 disabled to check for regressions. CI is the gate for the new paths.Fixes #9961, fixes #9967