1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-30 12:43:52 +00:00

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

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.
This commit is contained in:
Peter Heywood 2023-03-09 20:01:17 +00:00 committed by GitHub
parent 484fa22cf3
commit fc9cea6d76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,11 +159,19 @@ template <typename T, typename C> class is_direct_constructible {
static auto test(int, std::true_type) -> decltype(
// NVCC warns about narrowing conversions here
#ifdef __CUDACC__
#ifdef __NVCC_DIAG_PRAGMA_SUPPORT__
#pragma nv_diag_suppress 2361
#else
#pragma diag_suppress 2361
#endif
#endif
TT{std::declval<CC>()}
#ifdef __CUDACC__
#ifdef __NVCC_DIAG_PRAGMA_SUPPORT__
#pragma nv_diag_default 2361
#else
#pragma diag_default 2361
#endif
#endif
,
std::is_move_assignable<TT>());