)
set(_flags "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}")
- separate_arguments(_flags)
+
+ # Make sure some CUDA warning flags don't get deduplicated
+ string(REGEX REPLACE "(-Xcudafe --diag_suppress=[^ ]+)" "\"SHELL:\\1\"" _flags ${_flags})
+
+ separate_arguments(_flags UNIX_COMMAND ${_flags})
+
target_compile_options(${_library}_${_build_lowercase} PUBLIC ${_flags})
target_compile_definitions(${_library}_${_build_lowercase}
)
set(_flags "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}")
- separate_arguments(_flags)
+
+ # Make sure some CUDA warning flags don't get deduplicated
+ string(REGEX REPLACE "(-Xcudafe --diag_suppress=[^ ]+)" "\"SHELL:\\1\"" _flags ${_flags})
+
+ separate_arguments(_flags UNIX_COMMAND ${_flags})
target_compile_options(${_target} PUBLIC ${_flags})
if(NOT "${_flag_stripped}" STREQUAL "")
string(REGEX REPLACE "^-" "" _flag_name "${_flag_stripped}")
- string(REGEX REPLACE "\[-+,\]" "_" _flag_name "${_flag_name}")
+ string(REGEX REPLACE "\[-+,= \]" "_" _flag_name "${_flag_name}")
CHECK_CXX_COMPILER_FLAG("${_flag_sanitized}" DEAL_II_HAVE_FLAG_${_flag_name})
target_include_directories(${_target} SYSTEM PRIVATE ${DEAL_II_INCLUDE_DIRS})
set(_flags "${DEAL_II_CXX_FLAGS} ${DEAL_II_CXX_FLAGS_${_build}}")
- separate_arguments(_flags)
+
+ # Make sure some CUDA warning flags don't get deduplicated
+ string(REGEX REPLACE "(-Xcudafe --diag_suppress=[^ ]+)" "\"SHELL:\\1\"" _flags ${_flags})
+
+ separate_arguments(_flags UNIX_COMMAND ${_flags})
+
target_compile_options(${_target} PUBLIC ${_flags})
target_compile_definitions(${_target}
message(STATUS "Configured to use CUDA installation at ${CUDA_TOOLKIT_ROOT_DIR}")
endif()
+enable_if_supported(_cuda_flags "-Xcudafe --diag_suppress=unsigned_compare_with_zero")
+enable_if_supported(_cuda_flags "-Xcudafe --diag_suppress=integer_sign_change")
+enable_if_supported(_cuda_flags "-Xcudafe --diag_suppress=20208") # long double treated as double
+enable_if_supported(_cuda_flags "-Xcudafe --diag_suppress=1301") # non-template friend
+enable_if_supported(_cuda_flags "-Wno-non-template-friend")
+enable_if_supported(_cuda_flags "-Xcudafe --diag_suppress=loop_not_reachable")
+
process_feature(CUDA
LIBRARIES REQUIRED CUDA_LIBRARIES CUDA_cusparse_LIBRARY CUDA_cusolver_LIBRARY
INCLUDE_DIRS REQUIRED CUDA_INCLUDE_DIRS
+ CXX_FLAGS OPTIONAL _cuda_flags
CLEAR
CUDA_cublas_device_LIBRARY
CUDA_cublas_LIBRARY