From 9c01f22d07fe8984fcf20434de8ff8d30b885db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=27Griwes=27=20Dominiak?= Date: Thu, 8 Jan 2026 16:06:37 -0800 Subject: [PATCH 1/3] libcu++: silence msvc+nvcc12.9 warning plaguing c.parallel. --- ci/matrix.yaml | 6 ++++++ libcudacxx/include/cuda/std/__complex/roots.h | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/ci/matrix.yaml b/ci/matrix.yaml index 78851db1c6ed..528ffa346889 100644 --- a/ci/matrix.yaml +++ b/ci/matrix.yaml @@ -21,6 +21,12 @@ workflows: # args: '--preset libcudacxx-cpp20 --lit-tests "cuda/utility/basic_any.pass.cpp"' } # override: + - {jobs: ['test'], project: 'cccl_c_parallel', ctk: '12.X', cxx: 'gcc13', gpu: ['rtx2080']} + - {jobs: ['test'], project: 'cccl_c_parallel', ctk: '13.X', cxx: 'gcc13', gpu: ['rtx2080', 'l4', 'h100']} + - {jobs: ['test'], project: 'libcudacxx', std: 'max', cxx: ['gcc', 'clang', 'msvc'], gpu: 'rtx2080'} + - {jobs: ['nvrtc'], project: 'libcudacxx', std: 'all', gpu: 'rtx2080', sm: 'gpu'} + - {jobs: ['build'], std: 'minmax', ctk: '12.X', cxx: ['gcc7', 'gcc', 'clang14', 'clang19', 'msvc2019', 'msvc' ]} + - {jobs: ['build'], std: 'minmax', ctk: '13.0', cxx: ['gcc11', 'gcc', 'clang15', 'clang', 'msvc2019', 'msvc' ]} pull_request: # Old CTK: Oldest/newest supported host compilers: diff --git a/libcudacxx/include/cuda/std/__complex/roots.h b/libcudacxx/include/cuda/std/__complex/roots.h index 703d5e0c0685..76f62d669bde 100644 --- a/libcudacxx/include/cuda/std/__complex/roots.h +++ b/libcudacxx/include/cuda/std/__complex/roots.h @@ -76,6 +76,13 @@ template // pre-check to see if we over/underflow: _Tp __x_abs_sq = ::cuda::std::fma(__re, __re, __im * __im); + // NVCC 12.9 seems to be eliminating some parentheses which makes MSVC unhappy. + _CCCL_DIAG_PUSH +#if _CCCL_CUDACC_BELOW(13, 0) + _CCCL_DIAG_SUPPRESS_MSVC(4554) // warning C4554: '<<': check operator precedence for possible error; use parentheses + // to clarify precedence +#endif + // Get some bounds where __re +- |__x| won't overflow. // Doesn't need to be too exact, enough to cover extremal cases. // overflow bound = sqrt(MAX_FLOAT / 2) @@ -87,6 +94,8 @@ template (static_cast<__uint_t>((static_cast<__uint_t>(-__max_exponent + __mant_nbits) >> 1) + __exp_bias) << __mant_nbits) | __fp_explicit_bit_mask_of_v<_Tp>; + _CCCL_DIAG_POP + _Tp __overflow_bound = ::cuda::std::__fp_from_storage<_Tp>(__overflow_bound_exp); _Tp __underflow_bound = ::cuda::std::__fp_from_storage<_Tp>(__underflow_bound_exp); From 0c5898e840a2c5cf532a245b6d6d164cf437d72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=27Griwes=27=20Dominiak?= Date: Thu, 8 Jan 2026 23:06:54 -0800 Subject: [PATCH 2/3] Undo matrix override. --- ci/matrix.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ci/matrix.yaml b/ci/matrix.yaml index c15e5ade16ae..b13942929cb2 100644 --- a/ci/matrix.yaml +++ b/ci/matrix.yaml @@ -21,12 +21,6 @@ workflows: # args: '--preset libcudacxx --lit-tests "cuda/utility/basic_any.pass.cpp"' } # override: - - {jobs: ['test'], project: 'cccl_c_parallel', ctk: '12.X', cxx: 'gcc13', gpu: ['rtx2080']} - - {jobs: ['test'], project: 'cccl_c_parallel', ctk: '13.X', cxx: 'gcc13', gpu: ['rtx2080', 'l4', 'h100']} - - {jobs: ['test'], project: 'libcudacxx', std: 'max', cxx: ['gcc', 'clang', 'msvc'], gpu: 'rtx2080'} - - {jobs: ['nvrtc'], project: 'libcudacxx', std: 'all', gpu: 'rtx2080', sm: 'gpu'} - - {jobs: ['build'], std: 'minmax', ctk: '12.X', cxx: ['gcc7', 'gcc', 'clang14', 'clang19', 'msvc2019', 'msvc' ]} - - {jobs: ['build'], std: 'minmax', ctk: '13.0', cxx: ['gcc11', 'gcc', 'clang15', 'clang', 'msvc2019', 'msvc' ]} pull_request: # Old CTK: Oldest/newest supported host compilers: From d32b4066af812cc21a2f5d0f2dad6b0c8b25641d Mon Sep 17 00:00:00 2001 From: David Bayer <48736217+davebayer@users.noreply.github.com> Date: Fri, 9 Jan 2026 09:02:43 +0100 Subject: [PATCH 3/3] Apply suggestion from @davebayer --- libcudacxx/include/cuda/std/__complex/roots.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcudacxx/include/cuda/std/__complex/roots.h b/libcudacxx/include/cuda/std/__complex/roots.h index 76f62d669bde..37a4f012ee79 100644 --- a/libcudacxx/include/cuda/std/__complex/roots.h +++ b/libcudacxx/include/cuda/std/__complex/roots.h @@ -78,10 +78,10 @@ template // NVCC 12.9 seems to be eliminating some parentheses which makes MSVC unhappy. _CCCL_DIAG_PUSH -#if _CCCL_CUDACC_BELOW(13, 0) +#if _CCCL_CUDA_COMPILER(NVCC, <, 13, 0) _CCCL_DIAG_SUPPRESS_MSVC(4554) // warning C4554: '<<': check operator precedence for possible error; use parentheses // to clarify precedence -#endif +#endif // _CCCL_CUDA_COMPILER(NVCC, <, 13, 0) // Get some bounds where __re +- |__x| won't overflow. // Doesn't need to be too exact, enough to cover extremal cases.