Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
acc726e
update coding-conventions (prints black version)
nrnhines Jun 8, 2026
80a93a4
build: make format-pr more robust
nrnhines Jun 4, 2026
cd41f7c
Merge branch 'master' into hines/black-format
nrnhines Jun 8, 2026
d53a3c1
Add NRN_ENABLE_GPU and NRN_GPU_BACKEND CMake options (GPU adoption st…
grok-assistant Jun 19, 2026
270919a
GPU adoption step 1b: document CMAKE_CUDA_ARCHITECTURES in options.rst
grok-assistant Jun 19, 2026
1ef4465
GPU adoption step 2: fix ringtest GPU MPI ctest NVHPC loader issue
grok-assistant Jun 19, 2026
bed18a4
GPU adoption step 3: propagate OpenACC compile+link to libnrniv
grok-assistant Jun 19, 2026
4d94ca7
GPU adoption step 4: add neuron::gpu offload scaffold
grok-assistant Jun 20, 2026
92286d9
GPU adoption step 5: device_token lifecycle and NrnThread GPU fields
grok-assistant Jun 20, 2026
3101e4f
GPU adoption step 6: default NMODL_NEURON_CODEGEN for GPU builds
grok-assistant Jun 20, 2026
847b565
GPU adoption step 7: enable solve_interleaved GPU dispatch scaffolding
grok-assistant Jun 20, 2026
688144b
GPU adoption step 8: NMODL NEURON OpenACC codegen visitor
grok-assistant Jun 20, 2026
233d517
Fix step 8 file headers: drop Blue Brain copyright, EOF newlines
grok-assistant Jun 20, 2026
47ed2db
GPU adoption step 9: SOA and InterleaveInfo device upload (MVP)
grok-assistant Jun 20, 2026
7a1dc70
GPU adoption step 10: native psolve dispatch scaffolding
grok-assistant Jun 20, 2026
95c2820
GPU adoption step 11: host-side network event stages (Phase B1)
grok-assistant Jun 20, 2026
3a6955d
GPU adoption step 12: end-to-end native psolve scaffolding (G4 subset)
grok-assistant Jun 20, 2026
0ba3ace
GPU adoption step 13: ringtest native GPU benchmark harness
grok-assistant Jun 20, 2026
0100ec7
GPU adoption step 14: MPI multi-GPU device assignment
grok-assistant Jun 20, 2026
94e689d
GPU adoption step 15: Python GPU API consolidation + MKL guard
grok-assistant Jun 20, 2026
2663a5c
GPU adoption step 16: test stabilization (ringtest spk2, backend_help…
grok-assistant Jun 21, 2026
0dd2d05
GPU adoption PR 7b: OpenACC setup_tree_matrix in treeset.cpp
grok-assistant Jun 21, 2026
a225a10
GPU adoption PR 11b+16: net_send GPU buffer + gap/VecPlay sync
grok-assistant Jun 21, 2026
a6c488e
Fix GPU test failures: upload parent index, hybrid host/device sync
grok-assistant Jun 21, 2026
8795cd5
Fix native GPU fast_imem sync for pointer modtests
grok-assistant Jun 21, 2026
41ce001
Enable GPU axial matrix assembly and GPU solve_interleaved on native …
grok-assistant Jun 21, 2026
b6bad25
Run GPU post-solve voltage update and fast_imem on device
grok-assistant Jun 21, 2026
574b22a
Upload padded Memb_list shells for native GPU mechanism path
grok-assistant Jun 21, 2026
e0037c4
Add batch GPU download API for Vector.record and graph flush
grok-assistant Jun 21, 2026
e2eddbf
Expand G4 native GPU modtests to full _py_gpu parity (PR 19)
nrnhines Jun 21, 2026
ff48b5e
Reject native GPU when CVode is active (Phase B boundary)
nrnhines Jun 21, 2026
b5fdf7a
Stabilize GPU ctest harness for pytest modtests (Phase B)
nrnhines Jun 21, 2026
e800b0f
Document native GPU threading and spike/NET_RECEIVE policy (Phase B)
nrnhines Jun 21, 2026
8fe50fa
Add native GPU fixed-step Sphinx scope contract (PR6 / Phase B)
nrnhines Jun 21, 2026
2087fb1
Add native GPU adoption dev journal and Phase B closure (PR7)
nrnhines Jun 21, 2026
ad49cf6
Fix PR7 commit hash in dev journal appendix
nrnhines Jun 21, 2026
91050a5
Clarify native GPU timestep diagram: GPU mech currents and post_solve…
nrnhines Jun 21, 2026
3df065e
Document sparse13/DAE as unsupported on native GPU matrix solve
nrnhines Jun 21, 2026
db7156d
Refine native GPU docs: tree solve, subphase table, ODE-only diagram
nrnhines Jun 21, 2026
d0dcb77
Clarify native GPU diagram preconditions and gap transfer phases
nrnhines Jun 21, 2026
91a7db6
Merge branch 'master' into hines-grok/feature/neuron-core-gpu-adoption
nrnhines Jun 21, 2026
88b4366
Merge remote-tracking branch 'origin/hines/black-format' into hines-g…
nrnhines Jun 21, 2026
e6ddbae
ninja format-pr
nrnhines Jun 21, 2026
352bb6b
Fix CPU-only builds when NRN_ENABLE_GPU=OFF
nrnhines Jun 22, 2026
35f0822
Fix NVHPC warnings in native GPU build sources
nrnhines Jun 22, 2026
a34dc84
Fix CPU builds: declare hoc_register_net_send_buffering for NMODL cod…
Jun 22, 2026
fc81dcb
Enable NRN_ENABLE_GPU in NVHPC CI for native GPU pre-merge proof
Jun 22, 2026
4053d97
Fix NVHPC build: use routine seq in solve_interleaved2_loop_body
Jun 23, 2026
8fe0e92
Require cell permute type 2 when native GPU is enabled
Jun 24, 2026
39dd87d
Fix native GPU with gap junctions via CPU fixed-step fallback
nrnhines Jun 24, 2026
9874a5b
Document native GPU gap junction CPU fixed-step fallback
nrnhines Jun 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/nvhpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
run: |
rm -fr ${NRN_INSTALL_DIR}
source "${VENV_DIR}/bin/activate"
export NRN_CONFIG=(-DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_MPI=ON -DCORENRN_ENABLE_GPU=ON -DCMAKE_CXX_COMPILER=nvc++ -DNRN_ENABLE_INTERVIEWS=OFF -DNRN_ENABLE_RX3D=OFF -DNRN_ENABLE_DOCS=OFF -DNRN_ENABLE_TESTS=ON -DCMAKE_C_COMPILER=nvc -DCMAKE_CUDA_COMPILER=nvcc -DCMAKE_INSTALL_PREFIX="${NRN_INSTALL_DIR}" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DNMODL_ENABLE_FLEX_BISON_LINES=OFF -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -G Ninja -DCMAKE_BUILD_TYPE=Debug)
export NRN_CONFIG=(-DNRN_ENABLE_CORENEURON=ON -DNRN_ENABLE_MPI=ON -DCORENRN_ENABLE_GPU=ON -DNRN_ENABLE_GPU=ON -DNRN_GPU_BACKEND=OpenACC -DCMAKE_CUDA_ARCHITECTURES=75 -DCMAKE_CXX_COMPILER=nvc++ -DNRN_ENABLE_INTERVIEWS=OFF -DNRN_ENABLE_RX3D=OFF -DNRN_ENABLE_DOCS=OFF -DNRN_ENABLE_TESTS=ON -DCMAKE_C_COMPILER=nvc -DCMAKE_CUDA_COMPILER=nvcc -DCMAKE_INSTALL_PREFIX="${NRN_INSTALL_DIR}" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DNMODL_ENABLE_FLEX_BISON_LINES=OFF -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -G Ninja -DCMAKE_BUILD_TYPE=Debug)
cmake -B ${NRN_BUILD_DIR} "${NRN_CONFIG[@]}"

- name: "Build NEURON"
Expand All @@ -102,7 +102,10 @@ jobs:
CTEST_PARALLEL_LEVEL: 20
run: |
source "${VENV_DIR}/bin/activate"
ctest --output-on-failure --test-dir ${NRN_BUILD_DIR}
# Phase B native GPU pre-merge proof (docs/dev/gpu-testing.rst).
# Full ctest -R gpu (~96 tests) is follow-up for this PR.
ctest --output-on-failure --test-dir ${NRN_BUILD_DIR} \
-R 'testneuron_gpu|_py_gpu_native|external_ringtest::neuron_gpu'

- name: "Install NEURON"
run: |
Expand Down
74 changes: 66 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ option(NRN_ENABLE_MUSIC "Enable MUSIC support" ${NRN_ENABLE_MUSIC_DEFAULT})
option(NRN_ENABLE_RX3D "Enable rx3d support" ${NRN_ENABLE_RX3D_DEFAULT})
option(NRN_ENABLE_NMODL "Enable NMODL code-generator support" ${NRN_ENABLE_NMODL_DEFAULT})
option(NRN_ENABLE_CORENEURON "Enable CoreNEURON support" ${NRN_ENABLE_CORENEURON_DEFAULT})
option(NRN_ENABLE_GPU "Enable NEURON native GPU support" ${NRN_ENABLE_GPU_DEFAULT})
set(NRN_GPU_BACKEND
"${NRN_GPU_BACKEND_DEFAULT}"
CACHE STRING "GPU backend for NEURON native GPU (OpenACC only in Phase A-B)")
set_property(CACHE NRN_GPU_BACKEND PROPERTY STRINGS OpenACC)
option(NRN_ENABLE_BACKTRACE "Enable pretty-printed backtraces" ${NRN_ENABLE_BACKTRACE_DEFAULT})
option(NRN_ENABLE_TESTS "Enable unit tests" ${NRN_ENABLE_TESTS_DEFAULT})
option(NRN_ENABLE_MATH_OPT "Enable extra math optimisations (to enable SIMD)"
Expand Down Expand Up @@ -673,6 +678,24 @@ else()
set(NRN_CODEGENERATOR_TARGET nocmodl)
endif()

# =============================================================================
# NEURON native GPU (Phase A: option scaffolding; execution still via CoreNEURON)
# =============================================================================
if(NRN_ENABLE_GPU)
if(NOT NRN_GPU_BACKEND STREQUAL "OpenACC")
message(
FATAL_ERROR
"NRN_GPU_BACKEND=${NRN_GPU_BACKEND} is not supported. Only OpenACC is supported in Phase A-B."
)
endif()
if(NOT NRN_ENABLE_CORENEURON)
message(
FATAL_ERROR
"NRN_ENABLE_GPU=ON requires NRN_ENABLE_CORENEURON=ON during the Phase A transition. "
"Native GPU execution without CoreNEURON is not yet implemented.")
endif()
endif()

# =============================================================================
# Enable CoreNEURON support
# =============================================================================
Expand Down Expand Up @@ -703,6 +726,7 @@ if(NRN_ENABLE_CORENEURON)
# CoreNEURON exports this list of flags as a property; turn it into a variable in this scope. If
# CoreNEURON is installed externally then this is exported into coreneuron-config.cmake.
get_property(CORENRN_LIB_LINK_FLAGS GLOBAL PROPERTY CORENRN_LIB_LINK_FLAGS)
get_property(CORENRN_ACC_COMP_FLAGS GLOBAL PROPERTY CORENRN_ACC_COMP_FLAGS)
get_property(CORENRN_NEURON_LINK_FLAGS GLOBAL PROPERTY CORENRN_NEURON_LINK_FLAGS)
get_property(CORENRN_ENABLE_SHARED GLOBAL PROPERTY CORENRN_ENABLE_SHARED)

Expand Down Expand Up @@ -752,6 +776,7 @@ endif()
# =============================================================================
add_subdirectory(src/sparse13)
add_subdirectory(src/gnu)
add_subdirectory(src/neuron)
add_subdirectory(src/nrniv)

if(NRN_ENABLE_PYTHON)
Expand Down Expand Up @@ -802,6 +827,14 @@ endif()
if(NRN_ENABLE_CORENEURON)
list(APPEND NRN_RUN_FROM_BUILD_DIR_ENV "CORENRNHOME=${PROJECT_BINARY_DIR}")
endif()
if(NRN_ENABLE_GPU AND CORENRN_ENABLE_GPU)
if(NOT CUDAToolkit_FOUND)
find_package(CUDAToolkit 9.0 QUIET)
endif()
if(CUDAToolkit_FOUND)
prepend_to_var(LD_LIBRARY_PATH "${CUDAToolkit_LIBRARY_DIR}")
endif()
endif()
if(NRN_ENABLE_PYTHON)
prepend_to_var(PYTHONPATH "${PROJECT_BINARY_DIR}/lib/python:${PROJECT_SOURCE_DIR}/test/rxd")
endif()
Expand Down Expand Up @@ -949,21 +982,42 @@ add_custom_target(
COMMAND ${PROJECT_SOURCE_DIR}/external/coding-conventions/bin/format
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})

# Prepare a shell script to format only files modified with respect to master branch
# Prepare a shell script to format only files modified with respect to master/main branch that still
# exist on disk (filters out deleted files).
file(
WRITE ${CMAKE_CURRENT_BINARY_DIR}/format-pr.sh
"\
#!bash\n\
set -e\n\
cmd='cd ${PROJECT_SOURCE_DIR} && external/coding-conventions/bin/format `git diff --name-only master`'\n\
echo $cmd\n\
cd ${PROJECT_SOURCE_DIR} && external/coding-conventions/bin/format `git diff --name-only master`\n\
"#!/bin/bash
set -euo pipefail

# Try 'main' first, then fall back to 'master'
for base in main master; do
if git rev-parse --verify \"\$base\" >/dev/null 2>&1; then
BASE_BRANCH=\"\$base\"
break
fi
done

if [ -z \"\${BASE_BRANCH:-}\" ]; then
echo \"Error: Neither 'main' nor 'master' branch found.\" >&2
exit 1
fi

echo \"Formatting changes vs '\$BASE_BRANCH' (existing files only)...\" >&2

# Get changed files, but only pass files that still exist
git diff --name-only \"\$BASE_BRANCH\" | \\
while read -r file; do
if [ -e \"\$file\" ]; then
printf '%s\\n' \"\$file\"
fi
done | \\
xargs --no-run-if-empty external/coding-conventions/bin/format \"\$@\"
")

add_custom_target(
format-pr
COMMAND bash ${CMAKE_CURRENT_BINARY_DIR}/format-pr.sh
COMMENT "Format only files modified with respect to master branch."
COMMENT "Format only files modified with respect to main/master (existing files only)"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})

# =============================================================================
Expand Down Expand Up @@ -1313,6 +1367,10 @@ if(NRN_ENABLE_CORENEURON)
message(STATUS " PATH | ${CORENEURON_DIR}")
message(STATUS " LINK FLAGS | ${CORENRN_LIB_LINK_FLAGS}")
endif()
message(STATUS "NEURON GPU | ${NRN_ENABLE_GPU}")
if(NRN_ENABLE_GPU)
message(STATUS " Backend | ${NRN_GPU_BACKEND}")
endif()
message(STATUS "NMODL codegen | ${NRN_ENABLE_NMODL}")
if(NRN_UNIVERSAL2_BUILD)
message(STATUS "CMAKE_OSX_ARCH| ${CMAKE_OSX_ARCHITECTURES}")
Expand Down
20 changes: 17 additions & 3 deletions bin/nrnivmodl.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ UserLDFLAGS=""
UserCOREFLAGS=()
UserNMODLBIN=""
UserNMODLFLAGS=""
ForceNOCMODL=false

# - options come first but can be in any order.
while [ "$1" ] ; do
Expand All @@ -72,11 +73,14 @@ while [ "$1" ] ; do
shift
shift;;
-nmodl)
echo "[NMODL][warning] Code generation with NMODL is pre-alpha, lacks features and is intended only for development use"
@NRN_ENABLE_GPU_FALSE@echo "[NMODL][warning] Code generation with NMODL is pre-alpha, lacks features and is intended only for development use"
UserNMODLBIN="$2"
UserNMODLFLAGS="--neuron $UserNMODLFLAGS"
shift
shift;;
-nocmodl)
ForceNOCMODL=true
shift;;
-nmodlflags)
echo "[NMODL][warning] If sympy is enabled, NMODL needs to be found in PYTHONPATH"
UserNMODLFLAGS="$UserNMODLFLAGS $2"
Expand All @@ -88,8 +92,9 @@ while [ "$1" ] ; do
echo " -coreneuron Compile MOD files for CoreNEURON using nrnivmodl-core."
echo " -incflags \"include flags\" Extra include flags and paths when MOD (C++) files are compiled."
echo " -loadflags \"link flags\" Extra link flags, paths, and libraries when MOD (C++) files are linked."
echo " -nmodl /path/to/nmodl Path to the new NMODL transpiler for MOD files (pre-alpha, development use only)."
echo " -nmodlflags \"CLI flags\" Additional CLI flags for new NMODL transpiler"
echo " -nmodl /path/to/nmodl Path to the NMODL transpiler for MOD files."
echo " -nmodlflags \"CLI flags\" Additional CLI flags for NMODL transpiler"
echo " -nocmodl Force NOCMODL codegen (not supported with NRN_ENABLE_GPU builds)"
echo " -h, --help Show this help message and exit."
echo "If no MOD files or directories provided then MOD files from current directory are used."
exit 0;;
Expand All @@ -101,6 +106,15 @@ while [ "$1" ] ; do
esac
done

@NRN_ENABLE_GPU_TRUE@if [ "$ForceNOCMODL" = true ]; then
@NRN_ENABLE_GPU_TRUE@ echo "ERROR: -nocmodl is not supported with NRN_ENABLE_GPU builds. Use NMODL (default) instead."
@NRN_ENABLE_GPU_TRUE@ exit 1
@NRN_ENABLE_GPU_TRUE@fi
@NRN_ENABLE_GPU_TRUE@if [ -n "$UserNMODLBIN" ] && echo "$UserNMODLBIN" | grep -q nocmodl; then
@NRN_ENABLE_GPU_TRUE@ echo "ERROR: NOCMODL cannot be used with NRN_ENABLE_GPU builds. Use NMODL (default) instead."
@NRN_ENABLE_GPU_TRUE@ exit 1
@NRN_ENABLE_GPU_TRUE@fi

echo "$PWD"

# Mod file paths may contain spaces which make variable lists of those
Expand Down
4 changes: 4 additions & 0 deletions cmake/BuildOptionDefaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ set(NRN_ENABLE_MUSIC_DEFAULT OFF)
set(NRN_ENABLE_RX3D_DEFAULT ON)
set(NRN_ENABLE_NMODL_DEFAULT OFF)
set(NRN_ENABLE_CORENEURON_DEFAULT OFF)
set(NRN_ENABLE_GPU_DEFAULT OFF)
set(NRN_GPU_BACKEND_DEFAULT "OpenACC")
set(NRN_ENABLE_BACKTRACE_DEFAULT OFF)
set(NRN_ENABLE_TESTS_DEFAULT OFF)
set(NRN_ENABLE_MODEL_TESTS_DEFAULT "")
Expand Down Expand Up @@ -61,6 +63,8 @@ set(NRN_OPTION_NAME_LIST
NRN_ENABLE_MPI
NRN_ENABLE_RX3D
NRN_ENABLE_CORENEURON
NRN_ENABLE_GPU
NRN_GPU_BACKEND
NRN_ENABLE_TESTS
NRN_ENABLE_MODEL_TESTS
NRN_ENABLE_PYTHON_DYNAMIC
Expand Down
8 changes: 8 additions & 0 deletions cmake/ConfigFileSetting.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ else()
set(CORENEURON_ENABLED_FALSE "")
endif()

if(NRN_ENABLE_GPU)
set(NRN_ENABLE_GPU_TRUE "")
set(NRN_ENABLE_GPU_FALSE "#")
else()
set(NRN_ENABLE_GPU_TRUE "#")
set(NRN_ENABLE_GPU_FALSE "")
endif()

# ~~~
# A variable that doesn't start out as #undef but as #define needs an
# explicit @...@ replacement in the .h.in files.
Expand Down
33 changes: 30 additions & 3 deletions cmake/NeuronTestHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ function(nrn_add_test_group)
endforeach()
# Construct the names of the important output files
set(special "${nrnivmodl_directory}/${CMAKE_HOST_SYSTEM_PROCESSOR}/special")
set(nrnmech_lib
"${nrnivmodl_directory}/${CMAKE_HOST_SYSTEM_PROCESSOR}/${CMAKE_SHARED_LIBRARY_PREFIX}nrnmech${CMAKE_SHARED_LIBRARY_SUFFIX}"
)
# Add the custom command to generate the binaries. Get nrnivmodl from the build directory. At
# the moment it seems that `nrnivmodl` is generated at configure time, so there is no target
# to depend on and it should always be available, but it will try and link against libnrniv.so
Expand All @@ -217,6 +220,11 @@ function(nrn_add_test_group)
# be a wrapper that invokes CMake?
set(output_binaries "${special}")
list(APPEND nrnivmodl_dependencies nrniv_lib)
# Re-run nrnivmodl when libnrniv.so changes so test special does not retain stale NVHPC
# pgcudafat object paths from a prior libnrniv link line.
list(
APPEND nrnivmodl_dependencies
"${CMAKE_BINARY_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}nrniv${CMAKE_SHARED_LIBRARY_SUFFIX}")
if(NRN_ENABLE_CORENEURON AND NRN_ADD_TEST_GROUP_CORENEURON)
list(APPEND output_binaries "${special}-core")
if((NOT coreneuron_FOUND) AND (NOT DEFINED CORENEURON_BUILTIN_MODFILES))
Expand All @@ -229,6 +237,8 @@ function(nrn_add_test_group)
add_custom_command(
OUTPUT ${output_binaries}
DEPENDS ${nrnivmodl_dependencies} ${modfile_build_paths}
# Force libnrnmech relink when libnrniv.so changes (NVHPC embeds transient pgcudafat paths).
COMMAND ${CMAKE_COMMAND} -E rm -f ${nrnmech_lib} ${special}
COMMAND ${nrnivmodl_command}
COMMENT "Building special[-core] for test group ${NRN_ADD_TEST_GROUP_NAME}"
WORKING_DIRECTORY "${nrnivmodl_directory}")
Expand Down Expand Up @@ -281,7 +291,11 @@ function(nrn_add_test)
else()
set(feature_mod_compatibility_enabled OFF)
endif()
set(feature_gpu_enabled ${CORENRN_ENABLE_GPU})
if(NRN_ENABLE_GPU OR (NRN_ENABLE_CORENEURON AND CORENRN_ENABLE_GPU))
set(feature_gpu_enabled ON)
else()
set(feature_gpu_enabled OFF)
endif()
# Check REQUIRES
set(requires_coreneuron OFF)
foreach(required_feature ${NRN_ADD_TEST_REQUIRES})
Expand Down Expand Up @@ -339,6 +353,13 @@ function(nrn_add_test)
if(DEFINED NRN_ADD_TEST_SIM_DIRECTORY)
set(sim_directory "${NRN_ADD_TEST_SIM_DIRECTORY}")
endif()
# NVHPC may leave transient fat-object files in $TMPDIR when special runs with -gpu under MPI. Use
# a per-test TMPDIR under the build tree (see external_ringtest GPU ctest notes).
if("gpu" IN_LIST NRN_ADD_TEST_REQUIRES AND (CORENRN_ENABLE_GPU OR NRN_ENABLE_GPU))
set(gpu_tmpdir "${PROJECT_BINARY_DIR}/test/tmp/${NRN_ADD_TEST_GROUP}/${NRN_ADD_TEST_NAME}")
file(MAKE_DIRECTORY "${gpu_tmpdir}")
list(APPEND extra_environment "TMPDIR=${gpu_tmpdir}")
endif()
# Finally a working directory for this specific test within the group
set(working_directory "${PROJECT_BINARY_DIR}/test/${NRN_ADD_TEST_GROUP}/${NRN_ADD_TEST_NAME}")
file(MAKE_DIRECTORY "${working_directory}")
Expand Down Expand Up @@ -405,9 +426,15 @@ function(nrn_add_test)
if(NOT "PATH" IN_LIST test_env_var_names)
message(FATAL_ERROR "Expected to find PATH in ${test_env_var_names} but didn't")
endif()
set(_nrn_test_mech_dir "${nrnivmodl_directory}/${CMAKE_HOST_SYSTEM_PROCESSOR}")
# PATH will already be set in test_env
list(TRANSFORM test_env REPLACE "^PATH="
"PATH=${nrnivmodl_directory}/${CMAKE_HOST_SYSTEM_PROCESSOR}:")
list(TRANSFORM test_env REPLACE "^PATH=" "PATH=${_nrn_test_mech_dir}:")
# pytest/python3 launches do not search PATH for dlopen(libnrnmech.so).
if("LD_LIBRARY_PATH" IN_LIST test_env_var_names)
list(TRANSFORM test_env REPLACE "^LD_LIBRARY_PATH=" "LD_LIBRARY_PATH=${_nrn_test_mech_dir}:")
else()
list(APPEND test_env "LD_LIBRARY_PATH=${_nrn_test_mech_dir}")
endif()
endif()
list(TRANSFORM test_env REPLACE "^PYTHONPATH="
"PYTHONPATH=${CMAKE_SOURCE_DIR}/docs/nmodl/python_scripts:")
Expand Down
1 change: 1 addition & 0 deletions cmake/coreneuron/OpenAccHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ if(CORENRN_ENABLE_GPU)
# something like `-acc -lcorenrnmech ...`. CORENRN_NEURON_LINK_FLAGS only contains flags that need
# to be used when linking the NEURON Python module to make sure it is able to dynamically load
# libcorenrnmech.so.
set_property(GLOBAL PROPERTY CORENRN_ACC_COMP_FLAGS "${NVHPC_ACC_COMP_FLAGS}")
set_property(GLOBAL PROPERTY CORENRN_LIB_LINK_FLAGS "${NVHPC_ACC_COMP_FLAGS}")
if(CORENRN_ENABLE_SHARED)
# Because of
Expand Down
Loading
Loading