Properly disable nvcc warning messages in user code.

This commit is contained in:
Benoit Steiner 2016-02-03 14:10:06 -08:00
parent af8436b196
commit 5d82e47ef6
3 changed files with 12 additions and 3 deletions

View File

@ -44,6 +44,10 @@
#elif defined __NVCC__
#pragma diag_suppress code_is_unreachable
#pragma diag_suppress initialization_not_reachable
#pragma diag_suppress 2651
#pragma diag_suppress 2653
#endif
#endif // not EIGEN_WARNINGS_DISABLED

View File

@ -9,8 +9,13 @@
#elif defined __clang__
#pragma clang diagnostic pop
#elif defined __NVCC__
#pragma diag_default code_is_unreachable
#pragma diag_default initialization_not_reachable
// Don't reenable the diagnostic messages, as it turns out these messages need
// to be disabled at the point of the template instantiation (i.e the user code)
// otherwise they'll be triggeredby nvcc.
// #pragma diag_default code_is_unreachable
// #pragma diag_default initialization_not_reachable
// #pragma diag_default 2651
// #pragma diag_default 2653
#endif
#endif

View File

@ -158,7 +158,7 @@ if(CUDA_FOUND)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CUDA_NVCC_FLAGS "-ccbin /usr/bin/clang" CACHE STRING "nvcc flags" FORCE)
endif()
set(CUDA_NVCC_FLAGS "-std=c++11 --relaxed-constexpr -arch compute_30 -Xcudafe \"--diag_suppress 2651 --diag_suppress 2653\"")
set(CUDA_NVCC_FLAGS "-std=c++11 --relaxed-constexpr -arch compute_30 -Xcudafe \"--display_error_number\"")
cuda_include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CUDA_TOOLKIT_ROOT_DIR}/include")
set(EIGEN_ADD_TEST_FILENAME_EXTENSION "cu")