Skip to content

Commit

Permalink
Add missing variables in INITIAL block (#14)
Browse files Browse the repository at this point in the history
When calling functions or procedures in the INITIAL block, we need to define
additional variables in `nrn_init` so the compilation succeeds.
  • Loading branch information
JCGoran authored May 6, 2024
1 parent d171027 commit ed7a740
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cnexp_scalar/neuron/leonhard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ namespace neuron {
auto inst = make_instance_leonhard(_lmr);
auto node_data = make_node_data_leonhard(*_nt, *_ml_arg);
auto nodecount = _ml_arg->nodecount;
auto* const _ml = &_lmr;
auto* _thread = _ml_arg->_thread;
for (int id = 0; id < nodecount; id++) {
auto& _ppvar = _ml_arg->pdata[id];
inst.x[id] = 42.0;
}
}
Expand All @@ -189,6 +192,8 @@ namespace neuron {
auto inst = make_instance_leonhard(_lmr);
auto node_data = make_node_data_leonhard(*_nt, *_ml_arg);
auto nodecount = _ml_arg->nodecount;
auto* const _ml = &_lmr;
auto* _thread = _ml_arg->_thread;
for (int id = 0; id < nodecount; id++) {
inst.x[id] = inst.x[id] + (1.0 - exp(_nt->_dt * ( -1.0))) * ( -(0.0) / ( -1.0) - inst.x[id]);
}
Expand Down
1 change: 1 addition & 0 deletions func_proc/coreneuron/func_proc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ namespace coreneuron {
#if NRN_PRCELLSTATE
inst->v_unused[id] = v;
#endif
set_a_x_test_func_proc(id, pnodecount, inst, data, indexes, thread, nt, v);
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions func_proc/neuron/func_proc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,11 @@ namespace neuron {
auto inst = make_instance_test_func_proc(_lmr);
auto node_data = make_node_data_test_func_proc(*_nt, *_ml_arg);
auto nodecount = _ml_arg->nodecount;
auto* const _ml = &_lmr;
auto* _thread = _ml_arg->_thread;
for (int id = 0; id < nodecount; id++) {
auto& _ppvar = _ml_arg->pdata[id];
set_a_x_test_func_proc(_ml, inst, id, _ppvar, _thread, _nt);
}
}

Expand Down
3 changes: 3 additions & 0 deletions func_proc_pnt/neuron/func_proc_pnt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,10 @@ namespace neuron {
auto inst = make_instance_test_func_proc_pnt(_lmr);
auto node_data = make_node_data_test_func_proc_pnt(*_nt, *_ml_arg);
auto nodecount = _ml_arg->nodecount;
auto* const _ml = &_lmr;
auto* _thread = _ml_arg->_thread;
for (int id = 0; id < nodecount; id++) {
auto& _ppvar = _ml_arg->pdata[id];
}
}

Expand Down
5 changes: 5 additions & 0 deletions global_breakpoint/neuron/leonhard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ namespace neuron {
auto inst = make_instance_leonhard(_lmr);
auto node_data = make_node_data_leonhard(*_nt, *_ml_arg);
auto nodecount = _ml_arg->nodecount;
auto* const _ml = &_lmr;
auto* _thread = _ml_arg->_thread;
for (int id = 0; id < nodecount; id++) {
auto& _ppvar = _ml_arg->pdata[id];
inst.x[id] = 42.0;
}
}
Expand All @@ -190,6 +193,8 @@ namespace neuron {
auto inst = make_instance_leonhard(_lmr);
auto node_data = make_node_data_leonhard(*_nt, *_ml_arg);
auto nodecount = _ml_arg->nodecount;
auto* const _ml = &_lmr;
auto* _thread = _ml_arg->_thread;
for (int id = 0; id < nodecount; id++) {
inst.x[id] = inst.global->c;
}
Expand Down
7 changes: 7 additions & 0 deletions nonspecific_current/neuron/leonhard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ namespace neuron {
auto inst = make_instance_leonhard(_lmr);
auto node_data = make_node_data_leonhard(*_nt, *_ml_arg);
auto nodecount = _ml_arg->nodecount;
auto* const _ml = &_lmr;
auto* _thread = _ml_arg->_thread;
for (int id = 0; id < nodecount; id++) {
auto& _ppvar = _ml_arg->pdata[id];
}
}

Expand All @@ -193,6 +196,8 @@ namespace neuron {
auto inst = make_instance_leonhard(_lmr);
auto node_data = make_node_data_leonhard(*_nt, *_ml_arg);
auto nodecount = _ml_arg->nodecount;
auto* const _ml = &_lmr;
auto* _thread = _ml_arg->_thread;
for (int id = 0; id < nodecount; id++) {
int node_id = node_data.nodeindices[id];
double v = node_data.node_voltages[node_id];
Expand All @@ -212,6 +217,8 @@ namespace neuron {
auto inst = make_instance_leonhard(_lmr);
auto node_data = make_node_data_leonhard(*_nt, *_ml_arg);
auto nodecount = _ml_arg->nodecount;
auto* const _ml = &_lmr;
auto* _thread = _ml_arg->_thread;
for (int id = 0; id < nodecount; id++) {
}
}
Expand Down
5 changes: 5 additions & 0 deletions parameter/neuron/neuron_variables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ namespace neuron {
auto inst = make_instance_NeuronVariables(_lmr);
auto node_data = make_node_data_NeuronVariables(*_nt, *_ml_arg);
auto nodecount = _ml_arg->nodecount;
auto* const _ml = &_lmr;
auto* _thread = _ml_arg->_thread;
for (int id = 0; id < nodecount; id++) {
auto& _ppvar = _ml_arg->pdata[id];
}
}

Expand All @@ -187,6 +190,8 @@ namespace neuron {
auto inst = make_instance_NeuronVariables(_lmr);
auto node_data = make_node_data_NeuronVariables(*_nt, *_ml_arg);
auto nodecount = _ml_arg->nodecount;
auto* const _ml = &_lmr;
auto* _thread = _ml_arg->_thread;
for (int id = 0; id < nodecount; id++) {
inst.range_celsius[id] = *(inst.celsius);
}
Expand Down
3 changes: 3 additions & 0 deletions parameter/neuron/test_parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ namespace neuron {
auto inst = make_instance_test_parameter(_lmr);
auto node_data = make_node_data_test_parameter(*_nt, *_ml_arg);
auto nodecount = _ml_arg->nodecount;
auto* const _ml = &_lmr;
auto* _thread = _ml_arg->_thread;
for (int id = 0; id < nodecount; id++) {
auto& _ppvar = _ml_arg->pdata[id];
}
}

Expand Down
3 changes: 3 additions & 0 deletions point_process/neuron/test_pp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ namespace neuron {
auto inst = make_instance_test_pp(_lmr);
auto node_data = make_node_data_test_pp(*_nt, *_ml_arg);
auto nodecount = _ml_arg->nodecount;
auto* const _ml = &_lmr;
auto* _thread = _ml_arg->_thread;
for (int id = 0; id < nodecount; id++) {
auto& _ppvar = _ml_arg->pdata[id];
}
}

Expand Down

0 comments on commit ed7a740

Please sign in to comment.