Suppress warnings from clang with nvcc more widely
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 21 Oct 2020 12:45:57 +0000 (14:45 +0200)
committerArtem Zhmurov <zhmurov@gmail.com>
Thu, 22 Oct 2020 06:02:44 +0000 (06:02 +0000)
The original fix wasn't applied widely enough, probably because of
caching of compiler flags when I tested more recent CUDA versions.
This now fixes the issue of !644 more widely.

cmake/gmxManageNvccConfig.cmake

index 3326d039c27e5d9ba11746d95da646734853ad0e..3a91ee3305ac59b2790697c0fd263d8ba2a6780c 100644 (file)
@@ -166,13 +166,12 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
     # 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)
-    if (CUDA_VERSION VERSION_LESS 11.0)
-        # CUDA header crt/math_functions.h before CUDA 11.0 used
-        # throw() specifications that are deprecated in more recent
-        # C++ versions. GROMACS can't fix these, so must suppress
-        # them.
-        GMX_TEST_CXXFLAG(CXXFLAGS_NO_DEPRECATED_DYNAMIC_EXCEPTION_SPEC "-Wno-deprecated-dynamic-exception-spec" NVCC_CLANG_SUPPRESSIONS_CXXFLAGS)
-    endif()
+
+    # CUDA header crt/math_functions.h in at least CUDA 10.x and 11.1
+    # used throw() specifications that are deprecated in more recent
+    # C++ versions. GROMACS can't fix these, so must suppress them.
+    GMX_TEST_CXXFLAG(CXXFLAGS_NO_DEPRECATED_DYNAMIC_EXCEPTION_SPEC "-Wno-deprecated-dynamic-exception-spec" NVCC_CLANG_SUPPRESSIONS_CXXFLAGS)
+
     # Add these flags to those used for the host compiler. The
     # "-Xcompiler" prefix directs nvcc to only use them for host
     # compilation, which is all that is needed in this case.