From fc9cea6d76fc6fd3adb999c34bfc9ff85f80bfae Mon Sep 17 00:00:00 2001 From: Peter Heywood Date: Thu, 9 Mar 2023 20:01:17 +0000 Subject: [PATCH] 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. --- include/CLI/TypeTools.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/CLI/TypeTools.hpp b/include/CLI/TypeTools.hpp index 14a668f8..80104716 100644 --- a/include/CLI/TypeTools.hpp +++ b/include/CLI/TypeTools.hpp @@ -159,11 +159,19 @@ template 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()} #ifdef __CUDACC__ +#ifdef __NVCC_DIAG_PRAGMA_SUPPORT__ +#pragma nv_diag_default 2361 +#else #pragma diag_default 2361 +#endif #endif , std::is_move_assignable());