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

Commit d88353b

Browse files
committed
fixups for llvm
1 parent 02abf78 commit d88353b

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

CMake/OpenAccHelper.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,17 @@ if(CORENRN_ENABLE_GPU)
7070
string(APPEND NVHPC_ACC_COMP_FLAGS " -mp=gpu -Minfo=mp")
7171
string(APPEND NVHPC_ACC_LINK_FLAGS " -mp=gpu")
7272
endif()
73+
set(NVHPC_ACC_COMP_FLAGS)
74+
set(NVHPC_ACC_LINK_FLAGS)
7375
# avoid PGI adding standard compliant "-A" flags
74-
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION --c++14)
76+
# set(CMAKE_CXX14_STANDARD_COMPILE_OPTION --c++14)
7577
string(APPEND CMAKE_EXE_LINKER_FLAGS " ${NVHPC_ACC_LINK_FLAGS}")
7678
# Use `-Mautoinline` option to compile .cpp files generated from .mod files only. This is
7779
# especially needed when we compile with -O0 or -O1 optimisation level where we get link errors.
7880
# Use of `-Mautoinline` ensure that the necessary functions like `net_receive_kernel` are inlined
7981
# for OpenACC code generation.
8082
set(NVHPC_CXX_INLINE_FLAGS "-Mautoinline")
83+
set(NVHPC_CXX_INLINE_FLAGS)
8184
endif()
8285

8386
# =============================================================================

CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ if(CORENRN_ENABLE_GPU)
129129
# CUDA_RESOLVE_DEVICE_SYMBOLS OFF)
130130

131131
# Fail hard and early if we don't have the PGI/NVHPC compiler.
132-
if(NOT CORENRN_HAVE_NVHPC_COMPILER)
133-
message(
134-
FATAL_ERROR
135-
"GPU support is available via OpenACC using PGI/NVIDIA compilers."
136-
" Use NVIDIA HPC SDK with -DCMAKE_C_COMPILER=nvc -DCMAKE_CUDA_COMPILER=nvcc -DCMAKE_CXX_COMPILER=nvc++"
137-
)
138-
endif()
132+
# if(NOT CORENRN_HAVE_NVHPC_COMPILER)
133+
# message(
134+
# FATAL_ERROR
135+
# "GPU support is available via OpenACC using PGI/NVIDIA compilers."
136+
# " Use NVIDIA HPC SDK with -DCMAKE_C_COMPILER=nvc -DCMAKE_CUDA_COMPILER=nvcc -DCMAKE_CXX_COMPILER=nvc++"
137+
# )
138+
# endif()
139139

140140
# Set some sensible default CUDA architectures.
141141
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)

coreneuron/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ if(CORENRN_ENABLE_MPI AND NOT CORENRN_ENABLE_MPI_DYNAMIC)
198198
target_link_libraries(coreneuron ${MPI_CXX_LIBRARIES})
199199
endif()
200200

201+
target_link_libraries(coreneuron CUDA::cudart)
202+
201203
# this is where we handle dynamic mpi library build
202204
if(CORENRN_ENABLE_MPI AND CORENRN_ENABLE_MPI_DYNAMIC)
203205
# ~~~

coreneuron/permute/cellorder.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ static void triang_interleaved2(NrnThread* nt, int icore, int ncycle, int* strid
490490
bool has_subtrees_to_compute = true;
491491

492492
// clang-format off
493+
// OL211207: check if we need an OpenMP directive here.
493494
nrn_pragma_acc(loop seq)
494495
for (; has_subtrees_to_compute; ) { // ncycle loop
495496
#if !defined(_OPENACC)
@@ -538,6 +539,7 @@ static void bksub_interleaved2(NrnThread* nt,
538539
#if !defined(_OPENACC)
539540
for (int i = root; i < lastroot; i += 1) {
540541
#else
542+
// OL211207: check if we need an OpenMP directive here.
541543
nrn_pragma_acc(loop seq)
542544
for (int i = root; i < lastroot; i += warpsize) {
543545
#endif
@@ -660,7 +662,7 @@ void solve_interleaved1(int ith) {
660662
lastnode [0:ncell],
661663
cellsize [0:ncell]) if (nt->compute_gpu)
662664
async(nt->stream_id))
663-
nrn_pragma_omp(target teams distribute parallel for simd if(nt->compute_gpu))
665+
// nrn_pragma_omp(target teams distribute parallel for simd if(nt->compute_gpu))
664666
for (int icell = 0; icell < ncell; ++icell) {
665667
int icellsize = cellsize[icell];
666668
triang_interleaved(nt, icell, icellsize, nstride, stride, lastnode);

0 commit comments

Comments
 (0)