Skip to content

Fix NVRTC 13.3 warning bug in CCCL and CCCL.C#9171

Open
NaderAlAwar wants to merge 2 commits into
NVIDIA:mainfrom
NaderAlAwar:nvrtc-13.3-warning-fix
Open

Fix NVRTC 13.3 warning bug in CCCL and CCCL.C#9171
NaderAlAwar wants to merge 2 commits into
NVIDIA:mainfrom
NaderAlAwar:nvrtc-13.3-warning-fix

Conversation

@NaderAlAwar
Copy link
Copy Markdown
Contributor

Description

closes #9170

The fix is rather invasive because it requires us to add another macro to separate nv_diagnostic push from nv_diag_suppress. Not sure there is another way to fix this

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@NaderAlAwar NaderAlAwar requested review from a team as code owners May 29, 2026 00:51
@NaderAlAwar NaderAlAwar requested a review from leofang May 29, 2026 00:51
@github-project-automation github-project-automation Bot moved this to Todo in CCCL May 29, 2026
@NaderAlAwar NaderAlAwar requested review from andralex and davebayer May 29, 2026 00:51
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL May 29, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 856317e8-d58c-49e8-97b1-ca399b001362

📥 Commits

Reviewing files that changed from the base of the PR and between b25a34c and 39830e7.

📒 Files selected for processing (2)
  • c/parallel/test/test_util.h
  • libcudacxx/include/cuda/std/__memory/allocator_traits.h
✅ Files skipped from review due to trivial changes (1)
  • libcudacxx/include/cuda/std/__memory/allocator_traits.h
🚧 Files skipped from review as they are similar to previous changes (1)
  • c/parallel/test/test_util.h

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Reduced compiler/diagnostic noise by improving suppression of deprecation warnings for legacy CUDA vector APIs across the standard library, device algorithms, tests, and compilation utilities.
    • Ensured the NVRTC/CUDA compilation flow includes an extra define to silence specific vector deprecation diagnostics.

important:

Walkthrough

Adds a standalone diagnostic suppression macro (_CCCL_SUPPRESS_DEPRECATED_DIAG), uses it across headers/tests to avoid NVRTC 13.3 vector deprecation warnings, and adds a compile-time define __NV_NO_VECTOR_DEPRECATION_DIAG to NVRTC/C++ compile paths.

Changes

NVRTC 13.3 deprecated vector type warning suppression

Layer / File(s) Summary
Diagnostic suppression macro infrastructure
libcudacxx/include/cuda/std/__cccl/diagnostic.h
Defines _CCCL_SUPPRESS_DEPRECATED_DIAG and adjusts NVRTC branch to emit a standalone nv_diag_suppress pragma when supported.
Build config: add compile-time define
c/parallel/src/util/build_utils.h, c/parallel/test/test_util.h, python/cuda_cccl/cuda/compute/_cpp_compile.py, python/cuda_cccl/cuda/coop/_experimental/_nvrtc.py
Add -D__NV_NO_VECTOR_DEPRECATION_DIAG to NVRTC/C++ compile invocations used by build utilities and Python helpers.
libcudacxx functional header suppressions
libcudacxx/include/cuda/std/__functional/*
Insert _CCCL_SUPPRESS_DEPRECATED_DIAG in functional adapter headers to control deprecated-adapter diagnostics.
libcudacxx iterator headers suppressions and back_insert change
libcudacxx/include/cuda/std/__iterator/*
Insert suppression markers in iterator headers; __back_insert_iterator replaced by back_insert_iterator with associated type/operator adjustments in this PR.
libcudacxx memory header suppressions
libcudacxx/include/cuda/std/__memory/*
Insert suppression markers around Allocator pointer/const_pointer, is_always_equal, and rebind deprecation regions.
libcudacxx type/utility header suppressions
libcudacxx/include/cuda/__type_traits/*, libcudacxx/include/cuda/std/__utility/declval.h, libcudacxx/include/cuda/std/__tuple_dir/vector_types.h
Insert suppression markers around type traits and tuple/vector specializations.
CUB library header suppressions
cub/cub/util_type.cuh, cub/test/test_util.h
Add suppression markers in AlignBytes specializations and vector overload instantiations.
CUB test suppression updates
cub/test/catch2_test_*.cu, cub/test/catch2_test_*.cuh
Add suppression markers in multiple CUB test translation units around deprecated-interface tests.
libcudacxx test suppression updates
libcudacxx/test/libcudacxx/**
Add suppression markers in stream_ref, tuple/vector, numeric_limits C++23 deprecation regions, and FP trait tests.
Thrust and CUDAX header suppressions
thrust/*, cudax/include/cuda/experimental/__execution/queries.cuh
Insert suppression markers in Thrust iterator/type-trait headers and CUDAX experimental query header.

Assessment against linked issues

Objective Addressed Explanation
Fix NVRTC 13.3 emitting deprecated vector type warnings when diagnostic suppression is applied [#9170]
Workaround NVRTC 13.3 regression where nv_diag_suppress in same macro expansion as nv_diagnostic push is ignored [#9170]
Apply suppression across CUB util_type.cuh and affected headers/tests [#9170]

Out-of-scope changes

Code Change Explanation
Rename internal iterator and adjust public types/operators (libcudacxx/include/cuda/std/__iterator/back_insert_iterator.h) This modifies an iterator class formerly with __ prefix and public associated types/operators; not required by linked issue and appears unrelated to diagnostic suppression.

Suggested labels

libcu++

Suggested reviewers

  • davebayer

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
c/parallel/test/test_util.h (1)

92-95: ⚡ Quick win

suggestion: Line 92/Line 95 should avoid a mutable options table + hardcoded count; use const char* const options[] = {...}; and static_cast<int>(::std::size(options)) in nvrtcCompileProgram to keep the count correct when flags change.

As per coding guidelines: "All variables that are not modified must use const qualifier".


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 03f3afc6-6d24-440a-80f8-fc477b0e2e32

📥 Commits

Reviewing files that changed from the base of the PR and between d083f97 and b25a34c.

📒 Files selected for processing (58)
  • c/parallel/src/util/build_utils.h
  • c/parallel/test/test_util.h
  • cub/cub/util_type.cuh
  • cub/test/catch2_test_device_adjacent_difference_substract_right.cu
  • cub/test/catch2_test_device_histogram.cu
  • cub/test/catch2_test_device_reduce.cu
  • cub/test/catch2_test_device_reduce.cuh
  • cub/test/catch2_test_device_reduce_fp_inf.cu
  • cub/test/catch2_test_device_select_unique.cu
  • cub/test/catch2_test_device_select_unique_by_key.cu
  • cub/test/catch2_test_iterator.cu
  • cub/test/test_util.h
  • cudax/include/cuda/experimental/__execution/queries.cuh
  • libcudacxx/include/cuda/__driver/driver_api.h
  • libcudacxx/include/cuda/__type_traits/scalar_type.h
  • libcudacxx/include/cuda/__type_traits/vector_size.h
  • libcudacxx/include/cuda/std/__cccl/diagnostic.h
  • libcudacxx/include/cuda/std/__functional/binary_function.h
  • libcudacxx/include/cuda/std/__functional/binary_negate.h
  • libcudacxx/include/cuda/std/__functional/binder1st.h
  • libcudacxx/include/cuda/std/__functional/binder2nd.h
  • libcudacxx/include/cuda/std/__functional/mem_fun_ref.h
  • libcudacxx/include/cuda/std/__functional/pointer_to_binary_function.h
  • libcudacxx/include/cuda/std/__functional/pointer_to_unary_function.h
  • libcudacxx/include/cuda/std/__functional/unary_function.h
  • libcudacxx/include/cuda/std/__functional/unary_negate.h
  • libcudacxx/include/cuda/std/__iterator/back_insert_iterator.h
  • libcudacxx/include/cuda/std/__iterator/front_insert_iterator.h
  • libcudacxx/include/cuda/std/__iterator/insert_iterator.h
  • libcudacxx/include/cuda/std/__iterator/istream_iterator.h
  • libcudacxx/include/cuda/std/__iterator/istreambuf_iterator.h
  • libcudacxx/include/cuda/std/__iterator/ostream_iterator.h
  • libcudacxx/include/cuda/std/__iterator/ostreambuf_iterator.h
  • libcudacxx/include/cuda/std/__iterator/reverse_iterator.h
  • libcudacxx/include/cuda/std/__memory/allocator.h
  • libcudacxx/include/cuda/std/__memory/allocator_traits.h
  • libcudacxx/include/cuda/std/__tuple_dir/vector_types.h
  • libcudacxx/include/cuda/std/__utility/declval.h
  • libcudacxx/test/libcudacxx/cuda/stream_ref/stream_ref.ready.pass.cpp
  • libcudacxx/test/libcudacxx/cuda/stream_ref/stream_ref.wait.pass.cpp
  • libcudacxx/test/libcudacxx/cuda/utilities/tuple/vector_types_tuple_element.pass.cpp
  • libcudacxx/test/libcudacxx/cuda/utilities/tuple/vector_types_tuple_size.pass.cpp
  • libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits.members/const_data_members.pass.cpp
  • libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits.members/has_denorm.pass.cpp
  • libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits.members/has_denorm_loss.pass.cpp
  • libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/numeric.limits/default.pass.cpp
  • libcudacxx/test/libcudacxx/std/language.support/support.limits/limits/round.style/check_values.pass.cpp
  • libcudacxx/test/libcudacxx/std/numerics/c.math/fp_manip/copysign.pass.cpp
  • libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/fpclassify.pass.cpp
  • libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isfinite.pass.cpp
  • libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isinf.pass.cpp
  • libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnan.pass.cpp
  • libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/isnormal.pass.cpp
  • libcudacxx/test/libcudacxx/std/numerics/c.math/fp_traits/signbit.pass.cpp
  • python/cuda_cccl/cuda/compute/_cpp_compile.py
  • python/cuda_cccl/cuda/coop/_experimental/_nvrtc.py
  • thrust/thrust/iterator/iterator_traits.h
  • thrust/thrust/type_traits/is_trivially_relocatable.h

// NVRTC 13.3 does not honor nv_diag_suppress when it is emitted in the same macro expansion as
// nv_diagnostic push. Keep the suppression in a separate source-level macro invocation.
// See https://github.com/NVIDIA/cccl/issues/9170 and nvbug 6239043.
# define _CCCL_SUPPRESS_DEPRECATED_DIAG _Pragma("nv_diag_suppress 1444,20199")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if nv_diag_suppress is used elsewhere with comma-separated warning numbers
rg -nP 'nv_diag_suppress\s+\d+\s*,\s*\d+' --type=cpp --type=c

Repository: NVIDIA/cccl

Length of output: 189


🌐 Web query:

Does NVIDIA NVRTC nv_diag_suppress pragma support comma-separated warning numbers in a single pragma directive?

💡 Result:

No, the #pragma nv_diag_suppress directive does not support comma-separated warning numbers in a single pragma [1]. While NVIDIA's command-line compiler options (such as --diag-suppress) explicitly support comma-separated lists of diagnostic message numbers [2][3], the pragma-based diagnostic control is designed to take a single argument per directive [1]. To suppress multiple warnings using pragmas, you must issue a separate #pragma nv_diag_suppress directive for each warning number [1]. In practice, many developers use macros to automate this, such as those found in the NVIDIA/cccl library, which iterate over a list of warning numbers and generate the necessary sequence of individual pragmas [4].

Citations:


critical: Fix NVRTC diagnostic suppression—nv_diag_suppress can’t take comma-separated warning numbers

Line 126 uses a single directive (_Pragma("nv_diag_suppress 1444,20199")), but #pragma nv_diag_suppress only accepts one diagnostic number per directive. This can silently fail to suppress warning 20199 (and/or 1444), breaking the intended NVRTC 13.3 behavior. Emit separate _Pragma("nv_diag_suppress 1444") and _Pragma("nv_diag_suppress 20199") directives in the NVRTC branch.

@NaderAlAwar
Copy link
Copy Markdown
Contributor Author

pre-commit.ci autofix

@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot Bot commented May 29, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@NaderAlAwar
Copy link
Copy Markdown
Contributor Author

/ok to test 39830e7

@github-actions
Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 4h 20m: Pass: 100%/483 | Total: 22d 05h | Max: 4h 19m | Hits: 26%/5331004

See results here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

NVRTC 13.3 emits deprecated vector type warnings even with diagnostic suppression

1 participant