# Do any special handling needed for .cpp files that use
# CUDA runtime headers
if (GMX_GPU_CUDA AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- # CUDA header cuda_runtime_api.h in at least CUDA 10.1 uses 0
- # where nullptr would be preferable. GROMACS can't fix these, so
- # must suppress them.
- GMX_TEST_CXXFLAG(CXXFLAGS_NO_ZERO_AS_NULL_POINTER_CONSTANT "-Wno-zero-as-null-pointer-constant" NVCC_CLANG_SUPPRESSIONS_CXXFLAGS)
-
foreach(_compile_flag ${NVCC_CLANG_SUPPRESSIONS_CXXFLAGS})
set(GMX_CUDA_CLANG_FLAGS "${GMX_CUDA_CLANG_FLAGS} ${_compile_flag}")
endforeach()
# Some false positives exist produced by GoogleTest implementation
gmx_target_warning_suppression(${NAME} "-Wno-zero-as-null-pointer-constant" HAS_WARNING_NO_ZERO_AS_NULL_POINTER_CONSTANT)
gmx_target_warning_suppression(${NAME} "-Wno-gnu-zero-variadic-macro-arguments" HAS_WARNING_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS)
+ if(GMX_GPU_CUDA)
+ # CUDA headers target C, so use old-style casts that clang
+ # warns about when it is the host compiler
+ gmx_target_warning_suppression(${NAME} "-Wno-old-style-cast" HAS_NO_OLD_STYLE_CAST)
+ endif()
endif()
endif()
endfunction ()
# Some false positives exist produced by GoogleTest implementation
gmx_target_warning_suppression(${EXENAME} "-Wno-zero-as-null-pointer-constant" HAS_WARNING_NO_ZERO_AS_NULL_POINTER_CONSTANT)
gmx_target_warning_suppression(${EXENAME} "-Wno-gnu-zero-variadic-macro-arguments" HAS_WARNING_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS)
+ if(GMX_GPU_CUDA)
+ # CUDA headers target C, so use old-style casts that clang
+ # warns about when it is the host compiler
+ gmx_target_warning_suppression(${EXENAME} "-Wno-old-style-cast" HAS_NO_OLD_STYLE_CAST)
+ endif()
endif()
endif()
endfunction()