Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
Disable CUDA complation of partial piv and nrnran123.
Browse files Browse the repository at this point in the history
  • Loading branch information
olupton committed Dec 10, 2021
1 parent 89a1e20 commit b468870
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
1 change: 1 addition & 0 deletions CMake/MakefileBuildOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions CMake/OpenAccHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "XLClang")
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

# =============================================================================
Expand Down
9 changes: 5 additions & 4 deletions coreneuron/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -129,16 +130,16 @@ if(CORENRN_ENABLE_GPU)
# CMake <v3.20 does not pass explicit -x <lang> 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()

# =============================================================================
Expand Down
6 changes: 3 additions & 3 deletions extra/nrnivmodl_core_makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@
Expand Down

0 comments on commit b468870

Please sign in to comment.