Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVCC warning supression pragma fix for CUDA >= 11.5 #851

Merged
merged 1 commit into from
Mar 9, 2023
Merged

NVCC warning supression pragma fix for CUDA >= 11.5 #851

merged 1 commit into from
Mar 9, 2023

Conversation

ptheywood
Copy link
Contributor

CUDA 11.5 deprecated (and CUDA 12.0 removed) diagnostic pragmas such as diag_suppress and diag_default.

Replacement pragmas were prefixed with nv_, i.e. nv_diag_suppress

__NVCC_DIAG_PRAGMA_SUPPORT__ is defined if the prefixed versions are available.

Closes #757


This is not currently covered by any CI, as tests.yml's cuda-build uses CUDA 10.2. To cover all 3 variants of warnigns would require CUDA < 11.5, CUDA >= 11.5 && CUDA <= 11.8 and CUDA >= 12.0.

When building with -DCLI11_CUDA_TESTS=ON, using CUDA 11.5 to 11.8 inclusive this patch prevents the repeated emission of:

CLI11/include/CLI/TypeTools.hpp(162): warning #20236-D: pragma "diag_suppress" is deprecated, use "nv_diag_suppress" instead

CLI11/include/CLI/TypeTools.hpp(166): warning #20236-D: pragma "diag_default" is deprecated, use "nv_diag_default" instead

When using CUDA 12.0+, it prevents the repeated emission of:

CLI11/include/CLI/TypeTools.hpp(164): warning #2361-D: invalid narrowing conversion from "int" to "unsigned long"
          TT{std::declval<CC>()}
             ^
          detected during:
            instantiation of "CLI::detail::is_direct_constructible<T, C>::test [with T=std::vector<std::string, std::allocator<std::string>>, C=int]" based on template arguments <std::vector<std::string, std::allocator<std::string>>, int> at line 176
            instantiation of class "CLI::detail::is_direct_constructible<T, C> [with T=std::vector<std::string, std::allocator<std::string>>, C=int]" at line 674 of CLI11/include/CLI/Option.hpp
            instantiation of "void CLI::Option::results(T &) const [with T=std::vector<std::string, std::allocator<std::string>>]" at line 703 of CLI11/include/CLI/Option.hpp
            instantiation of "T CLI::Option::as<T>() const [with T=std::vector<std::string, std::allocator<std::string>>]" at line 1017 of CLI11/include/CLI/impl/App_inl.hpp

CUDA 11.5 deprecated (and CUDA 12.0 removed) diagnostic pragmas such as diag_suppress and diag_default.

Replacement pragmas were previxed with nv_, i.e. nv_diag_suppress

__NVCC_DIAG_PRAGMA_SUPPORT__ is defined if the prefixed versions are available.
@codecov
Copy link

codecov bot commented Mar 9, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (484fa22) 99.45% compared to head (3905ebb) 99.45%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #851   +/-   ##
=======================================
  Coverage   99.45%   99.45%           
=======================================
  Files          18       18           
  Lines        4071     4071           
=======================================
  Hits         4049     4049           
  Misses         22       22           
Impacted Files Coverage Δ
include/CLI/TypeTools.hpp 100.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@henryiii henryiii merged commit fc9cea6 into CLIUtils:main Mar 9, 2023
@henryiii
Copy link
Collaborator

henryiii commented Mar 9, 2023

Thanks!

@github-actions github-actions bot added needs changelog Hasn't been added to the changelog yet needs README Needs to be mentioned in the README labels Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs changelog Hasn't been added to the changelog yet needs README Needs to be mentioned in the README
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nvcc compiler warnings with CUDA 11.7
2 participants