From: Roland Schulz Date: Mon, 11 May 2020 19:20:55 +0000 (-0700) Subject: Fix Clang Cuda flags X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=3c325b04a6ba328429cd4cd35f6864816d424017;p=alexxy%2Fgromacs.git Fix Clang Cuda flags - 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. --- diff --git a/cmake/gmxManageClangCudaConfig.cmake b/cmake/gmxManageClangCudaConfig.cmake index a2b0927d97..c68dce6853 100644 --- a/cmake/gmxManageClangCudaConfig.cmake +++ b/cmake/gmxManageClangCudaConfig.cmake @@ -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 diff --git a/cmake/gmxManageGPU.cmake b/cmake/gmxManageGPU.cmake index 203c8939a3..66f2061308 100644 --- a/cmake/gmxManageGPU.cmake +++ b/cmake/gmxManageGPU.cmake @@ -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 ()