From affbc25e30b4b6c572b1dae49fab140c6c1c18fd Mon Sep 17 00:00:00 2001 From: Olli Lupton Date: Fri, 10 Dec 2021 08:49:08 +0100 Subject: [PATCH] Disable CUDA complation of partial piv and nrnran123. --- CMake/MakefileBuildOptions.cmake | 1 + CMake/OpenAccHelper.cmake | 12 ++++++------ CMakeLists.txt | 6 +++--- coreneuron/CMakeLists.txt | 9 +++++---- extra/nrnivmodl_core_makefile.in | 6 +++--- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/CMake/MakefileBuildOptions.cmake b/CMake/MakefileBuildOptions.cmake index 0ebc7bea9..09ce3330b 100644 --- a/CMake/MakefileBuildOptions.cmake +++ b/CMake/MakefileBuildOptions.cmake @@ -80,6 +80,7 @@ string(TOUPPER "${CMAKE_BUILD_TYPE}" _BUILD_TYPE) set(CORENRN_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${_BUILD_TYPE}} ${CXX14_STD_FLAGS} ${NVHPC_ACC_COMP_FLAGS} ${NVHPC_CXX_INLINE_FLAGS}" ) +set(CORENRN_LD_FLAGS "${NVHPC_ACC_LINK_FLAGS}") # ============================================================================= # nmodl/mod2c related options : TODO diff --git a/CMake/OpenAccHelper.cmake b/CMake/OpenAccHelper.cmake index 36db9b11c..5c11a417b 100644 --- a/CMake/OpenAccHelper.cmake +++ b/CMake/OpenAccHelper.cmake @@ -39,12 +39,12 @@ if(CORENRN_ENABLE_GPU) # ${CMAKE_CUDA_COMPILER_VERSION} find_package(CUDAToolkit 9.0 REQUIRED) # Be a bit paranoid - if(NOT ${CMAKE_CUDA_COMPILER_VERSION} STREQUAL ${CUDAToolkit_VERSION}) - message( - FATAL_ERROR - "CUDA compiler (${CMAKE_CUDA_COMPILER_VERSION}) and toolkit (${CUDAToolkit_VERSION}) versions are not the same!" - ) - endif() + # if(NOT ${CMAKE_CUDA_COMPILER_VERSION} STREQUAL ${CUDAToolkit_VERSION}) + # message( + # FATAL_ERROR + # "CUDA compiler (${CMAKE_CUDA_COMPILER_VERSION}) and toolkit (${CUDAToolkit_VERSION}) versions are not the same!" + # ) + # endif() set(CORENRN_CUDA_VERSION_SHORT "${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}") endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 0cda6a845..855d24c29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,9 +186,9 @@ if(CORENRN_ENABLE_GPU) # 3057 : Warning on ignoring __host__ annotation in some functions # 3085 : Warning on redeclaring a __host__ function as __host__ __device__ # ~~~ - set(CMAKE_CUDA_FLAGS - "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr -Xcudafe --diag_suppress=3057,--diag_suppress=3085" - ) + # set(CMAKE_CUDA_FLAGS + # "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr -Xcudafe --diag_suppress=3057,--diag_suppress=3085" + # ) endif() # ============================================================================= diff --git a/coreneuron/CMakeLists.txt b/coreneuron/CMakeLists.txt index 4bed1cf35..77c71295d 100644 --- a/coreneuron/CMakeLists.txt +++ b/coreneuron/CMakeLists.txt @@ -32,6 +32,7 @@ file( "utils/*/*.c" "utils/*/*.cpp") file(GLOB_RECURSE CORENEURON_CUDA_FILES "*.cu") +list(REMOVE_ITEM CORENEURON_CUDA_FILES "${CMAKE_CURRENT_SOURCE_DIR}/utils/randoms/nrnran123.cu") set(SCOPMATH_CODE_FILES "sim/scopmath/abort.cpp" "sim/scopmath/crout_thread.cpp" "sim/scopmath/newton_thread.cpp" "sim/scopmath/sparse_thread.cpp" "sim/scopmath/ssimplic_thread.cpp") @@ -129,16 +130,16 @@ if(CORENRN_ENABLE_GPU) # CMake options based on the LANGUAGE property # (https://cmake.org/cmake/help/latest/policy/CMP0119.html), so using a single .cu file and # setting LANGUAGE=CXX in non-GPU builds does not work. - list(REMOVE_ITEM CORENEURON_CODE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/utils/randoms/nrnran123.cpp") + #list(REMOVE_ITEM CORENEURON_CODE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/utils/randoms/nrnran123.cpp") list(APPEND CORENEURON_CODE_FILES ${CORENEURON_CUDA_FILES}) # Eigen-3.5+ provides better GPU support. However, some functions cannot be called directly from # within an OpenACC region. Therefore, we need to wrap them in a special API (decorate them with # __device__ & acc routine tokens), which allows us to eventually call them from OpenACC. Calling # these functions from CUDA kernels presents no issue ... - if(CORENRN_ENABLE_NMODL AND EXISTS ${CORENRN_MOD2CPP_INCLUDE}/partial_piv_lu/partial_piv_lu.cu) - list(APPEND CORENEURON_CODE_FILES ${CORENRN_MOD2CPP_INCLUDE}/partial_piv_lu/partial_piv_lu.cu) - endif() + # if(CORENRN_ENABLE_NMODL AND EXISTS ${CORENRN_MOD2CPP_INCLUDE}/partial_piv_lu/partial_piv_lu.cu) + # list(APPEND CORENEURON_CODE_FILES ${CORENRN_MOD2CPP_INCLUDE}/partial_piv_lu/partial_piv_lu.cu) + # endif() endif() # ============================================================================= diff --git a/extra/nrnivmodl_core_makefile.in b/extra/nrnivmodl_core_makefile.in index cf303d5d2..f51571ae8 100644 --- a/extra/nrnivmodl_core_makefile.in +++ b/extra/nrnivmodl_core_makefile.in @@ -71,10 +71,10 @@ ifeq ($(wildcard $(CORENRN_PERLEXE)),) CORENRN_PERLEXE=perl endif -CXXFLAGS = @CORENRN_CXX_FLAGS@ -lcaliper -qcuda +CXXFLAGS = @CORENRN_CXX_FLAGS@ CXX_COMPILE_CMD = $(CXX) $(CXXFLAGS) @CMAKE_CXX_COMPILE_OPTIONS_PIC@ @CORENRN_COMMON_COMPILE_DEFS@ $(INCLUDES) -CXX_LINK_EXE_CMD = $(CXX) $(CXXFLAGS) @CMAKE_EXE_LINKER_FLAGS@ -CXX_SHARED_LIB_CMD = $(CXX) $(CXXFLAGS) @CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS@ @CMAKE_SHARED_LIBRARY_CXX_FLAGS@ @CMAKE_SHARED_LINKER_FLAGS@ +CXX_LINK_EXE_CMD = $(CXX) $(CXXFLAGS) @CORENRN_LD_FLAGS@ @CMAKE_EXE_LINKER_FLAGS@ +CXX_SHARED_LIB_CMD = $(CXX) $(CXXFLAGS) @CORENRN_LD_FLAGS@ @CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS@ @CMAKE_SHARED_LIBRARY_CXX_FLAGS@ @CMAKE_SHARED_LINKER_FLAGS@ # ISPC compilation and link commands ISPC = @CMAKE_ISPC_COMPILER@