NEURON
cvodestb.cpp
Go to the documentation of this file.
1 /*
2 # =============================================================================
3 # Copyright (c) 2016 - 2021 Blue Brain Project/EPFL
4 #
5 # See top-level LICENSE file for details.
6 # =============================================================================.
7 */
8 
10 #include "coreneuron/nrnconf.h"
12 // solver CVode stub to allow cvode as dll for mswindows version.
13 
16 
18 
19 namespace coreneuron {
20 
21 // for fixed step thread
22 // check thresholds and deliver all (including binqueue) events
23 // up to t+dt/2
25  if (net_cvode_instance) {
28  }
29 }
30 
31 // deliver events (but not binqueue) up to nt->_t
33  double tsav = nt->_t;
34  if (net_cvode_instance) {
36  }
37  nt->_t = tsav;
38 
39  /*before executing on gpu, we have to update the NetReceiveBuffer_t on GPU */
41 
42  for (auto& net_buf_receive: corenrn.get_net_buf_receive()) {
43  (*net_buf_receive.first)(nt);
44  }
45 }
46 
48  if (net_cvode_instance) {
50  }
51 }
52 
54  if (net_cvode_instance) {
56  }
57 
58 #ifdef CORENEURON_ENABLE_GPU
59  /* weight vectors could be updated (from INITIAL block of NET_RECEIVE, update those on GPU's */
60  for (int ith = 0; ith < nrn_nthread; ++ith) {
61  NrnThread* nt = nrn_threads + ith;
62  double* weights = nt->weights;
63  int n_weight = nt->n_weight;
64  if (n_weight && nt->compute_gpu) {
65  nrn_pragma_acc(update device(weights [0:n_weight]))
66  nrn_pragma_omp(target update to(weights [0:n_weight]))
67  }
68  }
69 #endif
70 }
71 
72 void nrn_play_init() {
73  for (int ith = 0; ith < nrn_nthread; ++ith) {
74  NrnThread* nt = nrn_threads + ith;
75  for (int i = 0; i < nt->n_vecplay; ++i) {
76  ((PlayRecord*) nt->_vecplay[i])->play_init();
77  }
78  }
79 }
80 
82  for (int i = 0; i < nt->n_vecplay; ++i) {
83  ((PlayRecord*) nt->_vecplay[i])->continuous(nt->_t);
84  }
85 }
86 
87 } // namespace coreneuron
void deliver_events(double til, NrnThread *)
Definition: netcvode.cpp:331
void check_thresh(NrnThread *)
Definition: netcvode.cpp:525
void deliver_net_events(NrnThread *)
Definition: netcvode.cpp:631
#define weights
Definition: md1redef.h:42
#define i
Definition: md1redef.h:19
nrn_pragma_acc(routine seq) nrn_pragma_omp(declare target) philox4x32_ctr_t coreneuron_random123_philox4x32_helper(coreneuron nrn_pragma_omp(end declare target) namespace coreneuron
Provide a helper function in global namespace that is declared target for OpenMP offloading to functi...
Definition: nrnran123.h:66
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
NrnThread * nrn_threads
Definition: multicore.cpp:56
void clear_event_queue()
Definition: cvodestb.cpp:47
void init_net_events()
Definition: cvodestb.cpp:53
int nrn_nthread
Definition: multicore.cpp:55
void update(NrnThread *_nt)
void fixed_play_continuous(NrnThread *nt)
Definition: cvodestb.cpp:81
CoreNeuron corenrn
Definition: multicore.cpp:53
void deliver_net_events(NrnThread *nt)
Definition: cvodestb.cpp:24
void nrn_deliver_events(NrnThread *nt)
Definition: cvodestb.cpp:32
nrn_pragma_acc(routine seq) int vector_capacity(void *v)
Definition: ivocvect.cpp:30
void update_net_receive_buffer(NrnThread *nt)
void nrn_play_init()
Definition: cvodestb.cpp:72
NetCvode * net_cvode_instance
Definition: netcvode.cpp:35