Fix Clang Cuda flags
authorRoland Schulz <roland.schulz@intel.com>
Mon, 11 May 2020 19:20:55 +0000 (12:20 -0700)
committerRoland Schulz <roland.schulz@intel.com>
Mon, 11 May 2020 19:24:00 +0000 (12:24 -0700)
- Add -fcuda-flush-denormals-to-zero to match nvcc flags
- Fix flag reporting. Was broken by 8ff984a32037947
  which didn't make the change consistent for clang cuda.

cmake/gmxManageClangCudaConfig.cmake
cmake/gmxManageGPU.cmake

index a2b0927d977382991b0e168d37184a0a7ada9ce1..c68dce68534aee8fff3660ed3eafd0681444a45c 100644 (file)
@@ -80,7 +80,7 @@ if (GMX_CUDA_TARGET_SM)
 endif()
 
 # default flags
-list(APPEND _CUDA_CLANG_FLAGS "-x cuda" "-ffast-math")
+list(APPEND _CUDA_CLANG_FLAGS "-x cuda" "-ffast-math" "-fcuda-flush-denormals-to-zero")
 # Workaround for clang>=9 (Bug 45533). No CUDA file uses OpenMP.
 list(APPEND _CUDA_CLANG_FLAGS "-fno-openmp")
 # CUDA toolkit
index 203c8939a39974298a24494e9d1b44e847d58dcb..66f206130833b9c89982b2b946557a6e8df4c419 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2016,2017,2018,2019,2020, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -186,7 +186,8 @@ macro(get_cuda_compiler_info COMPILER_INFO DEVICE_COMPILER_FLAGS HOST_COMPILER_F
         # CXX compiler is the CUDA compiler
         set(${COMPILER_INFO} "${CMAKE_CXX_COMPILER}  ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
         # there are some extra flags
-        set(${COMPILER_FLAGS} "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${_build_type}} ${GMX_CUDA_CLANG_FLAGS}")
+        set(${HOST_COMPILER_FLAGS} BUILD_CXXFLAGS)
+        set(${DEVICE_COMPILER_FLAGS} "${GMX_CUDA_CLANG_FLAGS}")
     endif()
 endmacro ()