From 3949a042b4d1e5e39152416104514ba72d2f2ee2 Mon Sep 17 00:00:00 2001 From: Olli Lupton Date: Mon, 17 Jan 2022 10:13:49 +0100 Subject: [PATCH] Fix warnings. --- coreneuron/gpu/nrn_acc_manager.cpp | 6 ++++++ coreneuron/utils/vrecord.cpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/coreneuron/gpu/nrn_acc_manager.cpp b/coreneuron/gpu/nrn_acc_manager.cpp index d5e723527..7fe0498cb 100644 --- a/coreneuron/gpu/nrn_acc_manager.cpp +++ b/coreneuron/gpu/nrn_acc_manager.cpp @@ -76,6 +76,8 @@ void cnrn_target_set_default_device(int device_num) { #endif } +#ifdef CORENEURON_ENABLE_GPU + static Memb_list* copy_ml_to_device(const Memb_list* ml, int type) { // As we never run code for artificial cell inside GPU we don't copy it. int is_art = corenrn.get_is_artificial()[type]; @@ -259,6 +261,8 @@ static void delete_ml_from_device(Memb_list* ml, int type) { cnrn_target_delete(ml); } +#endif + /* note: threads here are corresponding to global nrn_threads array */ void setup_nrnthreads_on_device(NrnThread* threads, int nthreads) { #ifdef CORENEURON_ENABLE_GPU @@ -891,6 +895,7 @@ void update_nrnthreads_on_host(NrnThread* threads, int nthreads) { * from GPU to CPU. */ void update_weights_from_gpu(NrnThread* threads, int nthreads) { +#ifdef CORENEURON_ENABLE_GPU for (int i = 0; i < nthreads; i++) { NrnThread* nt = threads + i; size_t n_weight = nt->n_weight; @@ -900,6 +905,7 @@ void update_weights_from_gpu(NrnThread* threads, int nthreads) { nrn_pragma_omp(target update from(weights [0:n_weight])) } } +#endif } /** Cleanup device memory that is being tracked by the OpenACC runtime. diff --git a/coreneuron/utils/vrecord.cpp b/coreneuron/utils/vrecord.cpp index a972e754a..8add5c014 100644 --- a/coreneuron/utils/vrecord.cpp +++ b/coreneuron/utils/vrecord.cpp @@ -104,7 +104,9 @@ void VecPlayContinuous::deliver(double tt, NetCvode* ns) { } void VecPlayContinuous::continuous(double tt) { +#ifdef CORENEURON_ENABLE_GPU NrnThread* nt = nrn_threads + ith_; +#endif // clang-format off nrn_pragma_acc(kernels present(this) if(nt->compute_gpu))