Skip to content

Commit fc9cea6

Browse files
authored
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.
1 parent 484fa22 commit fc9cea6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/CLI/TypeTools.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,19 @@ template <typename T, typename C> class is_direct_constructible {
159159
static auto test(int, std::true_type) -> decltype(
160160
// NVCC warns about narrowing conversions here
161161
#ifdef __CUDACC__
162+
#ifdef __NVCC_DIAG_PRAGMA_SUPPORT__
163+
#pragma nv_diag_suppress 2361
164+
#else
162165
#pragma diag_suppress 2361
166+
#endif
163167
#endif
164168
TT{std::declval<CC>()}
165169
#ifdef __CUDACC__
170+
#ifdef __NVCC_DIAG_PRAGMA_SUPPORT__
171+
#pragma nv_diag_default 2361
172+
#else
166173
#pragma diag_default 2361
174+
#endif
167175
#endif
168176
,
169177
std::is_move_assignable<TT>());

0 commit comments

Comments
 (0)