From e14e8c4ab362e914bc996f01e4c96769c2a048c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Szil=C3=A1rd=20P=C3=A1ll?= Date: Mon, 12 Feb 2018 14:26:46 +0100 Subject: [PATCH] Remove single/multi compilation unit switching logic The reason for needing the single compilation unit support for the nonbonded kernels has now eliminated with the removal of the CUDA texture reference support, so all switching logic and consistency checks are now removed. The CMake cache variable and include statements that allow using multiple compilation units is still kept for now. Change-Id: I9f6e6491805aba7202cbe65865fbceb173e20cce --- cmake/gmxManageGPU.cmake | 25 +------------------------ src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu | 8 -------- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/cmake/gmxManageGPU.cmake b/cmake/gmxManageGPU.cmake index 4e10e93eec..66156c227d 100644 --- a/cmake/gmxManageGPU.cmake +++ b/cmake/gmxManageGPU.cmake @@ -298,30 +298,7 @@ macro(gmx_gpu_setup) endif() #GMX_CLANG_CUDA endif() # GMX_GPU - if (GMX_CLANG_CUDA) - set (_GMX_CUDA_NB_SINGLE_COMPILATION_UNIT_DEFAULT FALSE) - else() - set (_GMX_CUDA_NB_SINGLE_COMPILATION_UNIT_DEFAULT TRUE) - endif() - cmake_dependent_option(GMX_CUDA_NB_SINGLE_COMPILATION_UNIT - "Whether to compile the CUDA non-bonded module using a single compilation unit." ${_GMX_CUDA_NB_SINGLE_COMPILATION_UNIT_DEFAULT} - "GMX_GPU" ON) + option(GMX_CUDA_NB_SINGLE_COMPILATION_UNIT "Whether to compile the CUDA non-bonded module using a single compilation unit." OFF) mark_as_advanced(GMX_CUDA_NB_SINGLE_COMPILATION_UNIT) - if (GMX_GPU AND NOT GMX_CLANG_CUDA) - # We need to use single compilation unit for kernels: - # when compiling with nvcc for CC 2.x devices where buggy kernel code is generated - gmx_check_if_changed(_gmx_cuda_target_changed GMX_CUDA_TARGET_SM GMX_CUDA_TARGET_COMPUTE CUDA_NVCC_FLAGS) - - if(_gmx_cuda_target_changed OR NOT GMX_GPU_DETECTION_DONE) - if((NOT GMX_CUDA_TARGET_SM AND NOT GMX_CUDA_TARGET_COMPUTE) OR - (GMX_CUDA_TARGET_SM MATCHES "2[01]" OR GMX_CUDA_TARGET_COMPUTE MATCHES "2[01]")) - message(STATUS "Enabling single compilation unit for the CUDA non-bonded module. Multiple compilation units are not compatible with CC 2.x devices, to enable the feature specify only CC >=3.0 target architectures in GMX_CUDA_TARGET_SM/GMX_CUDA_TARGET_COMPUTE.") - set_property(CACHE GMX_CUDA_NB_SINGLE_COMPILATION_UNIT PROPERTY VALUE ON) - else() - message(STATUS "Enabling multiple compilation units for the CUDA non-bonded module.") - set_property(CACHE GMX_CUDA_NB_SINGLE_COMPILATION_UNIT PROPERTY VALUE OFF) - endif() - endif() - endif() endmacro() diff --git a/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu index 3ae70cae21..7010ae6dc2 100644 --- a/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu +++ b/src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu @@ -105,14 +105,6 @@ #include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_VF_noprune.cu" #include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_VF_prune.cu" #include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_pruneonly.cu" -#else -/* Prevent compilation in multiple compilation unit mode for CC 2.x. Although we have - * build-time checks to prevent this, the user could manually tweaks nvcc flags - * which would lead to buggy kernels getting compiled. - */ -#if GMX_PTX_ARCH > 0 && GMX_PTX_ARCH <= 210 && !defined(__clang__) -#error Due to an CUDA nvcc compiler bug, the CUDA non-bonded module can not be compiled with multiple compilation units for CC 2.x devices. If you have changed the nvcc flags manually, either use the GMX_CUDA_TARGET_* variables instead or set GMX_CUDA_NB_SINGLE_COMPILATION_UNIT=ON CMake option. -#endif #endif /* GMX_CUDA_NB_SINGLE_COMPILATION_UNIT */ -- 2.11.4.GIT