diff --git a/at_time/neuron/example.cpp b/at_time/neuron/example.cpp index e45b17f7..88c187fb 100644 --- a/at_time/neuron/example.cpp +++ b/at_time/neuron/example.cpp @@ -173,8 +173,8 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_f(void); - static double _npy_f(Prop*); + static void _hoc_f(); + static double _npy_f(Prop* _prop); /* connect user functions to hoc names */ @@ -187,7 +187,7 @@ namespace neuron { {"f", _npy_f}, {nullptr, nullptr} }; - static void _hoc_f(void) { + static void _hoc_f() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/builtin_functions/neuron/compile_only.cpp b/builtin_functions/neuron/compile_only.cpp index 630a207f..56b1670c 100644 --- a/builtin_functions/neuron/compile_only.cpp +++ b/builtin_functions/neuron/compile_only.cpp @@ -173,8 +173,8 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_call_nrn_ghk(void); - static double _npy_call_nrn_ghk(Prop*); + static void _hoc_call_nrn_ghk(); + static double _npy_call_nrn_ghk(Prop* _prop); /* connect user functions to hoc names */ @@ -187,7 +187,7 @@ namespace neuron { {"call_nrn_ghk", _npy_call_nrn_ghk}, {nullptr, nullptr} }; - static void _hoc_call_nrn_ghk(void) { + static void _hoc_call_nrn_ghk() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/constant/neuron/constant.cpp b/constant/neuron/constant.cpp index a694b9a2..1e77ba1a 100644 --- a/constant/neuron/constant.cpp +++ b/constant/neuron/constant.cpp @@ -178,8 +178,8 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_foo(void); - static double _npy_foo(Prop*); + static void _hoc_foo(); + static double _npy_foo(Prop* _prop); /* connect user functions to hoc names */ @@ -192,7 +192,7 @@ namespace neuron { {"foo", _npy_foo}, {nullptr, nullptr} }; - static void _hoc_foo(void) { + static void _hoc_foo() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/external/neuron/dst.cpp b/external/neuron/dst.cpp index a7283a87..1370e6f9 100644 --- a/external/neuron/dst.cpp +++ b/external/neuron/dst.cpp @@ -177,10 +177,10 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_get_gbl(void); - static double _npy_get_gbl(Prop*); - static void _hoc_get_param(void); - static double _npy_get_param(Prop*); + static void _hoc_get_gbl(); + static double _npy_get_gbl(Prop* _prop); + static void _hoc_get_param(); + static double _npy_get_param(Prop* _prop); /* connect user functions to hoc names */ @@ -195,7 +195,7 @@ namespace neuron { {"get_param", _npy_get_param}, {nullptr, nullptr} }; - static void _hoc_get_gbl(void) { + static void _hoc_get_gbl() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -226,7 +226,7 @@ namespace neuron { _r = get_gbl_dst(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static void _hoc_get_param(void) { + static void _hoc_get_param() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/function/neuron/artificial_functions.cpp b/function/neuron/artificial_functions.cpp index 320e4063..dd0d01b5 100644 --- a/function/neuron/artificial_functions.cpp +++ b/function/neuron/artificial_functions.cpp @@ -214,8 +214,8 @@ namespace neuron { /* declaration of user functions */ - static double _hoc_x_plus_a(void*); - static double _hoc_identity(void*); + static double _hoc_x_plus_a(void * _vptr); + static double _hoc_identity(void * _vptr); /* connect user functions to hoc names */ @@ -230,7 +230,7 @@ namespace neuron { {"identity", _hoc_identity}, {nullptr, nullptr} }; - static double _hoc_x_plus_a(void* _vptr) { + static double _hoc_x_plus_a(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; @@ -249,7 +249,7 @@ namespace neuron { _r = x_plus_a_art_functions(_lmc, inst, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static double _hoc_identity(void* _vptr) { + static double _hoc_identity(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/function/neuron/compile_only.cpp b/function/neuron/compile_only.cpp index c444937c..298a86ae 100644 --- a/function/neuron/compile_only.cpp +++ b/function/neuron/compile_only.cpp @@ -186,12 +186,12 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_func(void); - static double _npy_func(Prop*); - static void _hoc_func_with_v(void); - static double _npy_func_with_v(Prop*); - static void _hoc_func_with_other(void); - static double _npy_func_with_other(Prop*); + static void _hoc_func(); + static double _npy_func(Prop* _prop); + static void _hoc_func_with_v(); + static double _npy_func_with_v(Prop* _prop); + static void _hoc_func_with_other(); + static double _npy_func_with_other(Prop* _prop); /* connect user functions to hoc names */ @@ -208,7 +208,7 @@ namespace neuron { {"func_with_other", _npy_func_with_other}, {nullptr, nullptr} }; - static void _hoc_func(void) { + static void _hoc_func() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -241,7 +241,7 @@ namespace neuron { func_func_in_breakpoint(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static void _hoc_func_with_v(void) { + static void _hoc_func_with_v() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -274,7 +274,7 @@ namespace neuron { func_with_v_func_in_breakpoint(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_func_with_other(void) { + static void _hoc_func_with_other() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/function/neuron/functions.cpp b/function/neuron/functions.cpp index a4e805a5..735f8832 100644 --- a/function/neuron/functions.cpp +++ b/function/neuron/functions.cpp @@ -178,12 +178,12 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_x_plus_a(void); - static double _npy_x_plus_a(Prop*); - static void _hoc_v_plus_a(void); - static double _npy_v_plus_a(Prop*); - static void _hoc_identity(void); - static double _npy_identity(Prop*); + static void _hoc_x_plus_a(); + static double _npy_x_plus_a(Prop* _prop); + static void _hoc_v_plus_a(); + static double _npy_v_plus_a(Prop* _prop); + static void _hoc_identity(); + static double _npy_identity(Prop* _prop); /* connect user functions to hoc names */ @@ -200,7 +200,7 @@ namespace neuron { {"identity", _npy_identity}, {nullptr, nullptr} }; - static void _hoc_x_plus_a(void) { + static void _hoc_x_plus_a() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -234,7 +234,7 @@ namespace neuron { _r = x_plus_a_functions(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_v_plus_a(void) { + static void _hoc_v_plus_a() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -265,7 +265,7 @@ namespace neuron { _r = v_plus_a_functions(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_identity(void) { + static void _hoc_identity() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/function/neuron/localize_arguments.cpp b/function/neuron/localize_arguments.cpp index e701e5ff..0561e5a5 100644 --- a/function/neuron/localize_arguments.cpp +++ b/function/neuron/localize_arguments.cpp @@ -222,20 +222,20 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_id_v(void); - static double _npy_id_v(Prop*); - static void _hoc_id_nai(void); - static double _npy_id_nai(Prop*); - static void _hoc_id_ina(void); - static double _npy_id_ina(Prop*); - static void _hoc_id_x(void); - static double _npy_id_x(Prop*); - static void _hoc_id_g(void); - static double _npy_id_g(Prop*); - static void _hoc_id_s(void); - static double _npy_id_s(Prop*); - static void _hoc_id_p(void); - static double _npy_id_p(Prop*); + static void _hoc_id_v(); + static double _npy_id_v(Prop* _prop); + static void _hoc_id_nai(); + static double _npy_id_nai(Prop* _prop); + static void _hoc_id_ina(); + static double _npy_id_ina(Prop* _prop); + static void _hoc_id_x(); + static double _npy_id_x(Prop* _prop); + static void _hoc_id_g(); + static double _npy_id_g(Prop* _prop); + static void _hoc_id_s(); + static double _npy_id_s(Prop* _prop); + static void _hoc_id_p(); + static double _npy_id_p(Prop* _prop); /* connect user functions to hoc names */ @@ -260,7 +260,7 @@ namespace neuron { {"id_p", _npy_id_p}, {nullptr, nullptr} }; - static void _hoc_id_v(void) { + static void _hoc_id_v() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -291,7 +291,7 @@ namespace neuron { _r = id_v_localize_arguments(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_id_nai(void) { + static void _hoc_id_nai() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -322,7 +322,7 @@ namespace neuron { _r = id_nai_localize_arguments(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_id_ina(void) { + static void _hoc_id_ina() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -353,7 +353,7 @@ namespace neuron { _r = id_ina_localize_arguments(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_id_x(void) { + static void _hoc_id_x() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -384,7 +384,7 @@ namespace neuron { _r = id_x_localize_arguments(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_id_g(void) { + static void _hoc_id_g() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -415,7 +415,7 @@ namespace neuron { _r = id_g_localize_arguments(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_id_s(void) { + static void _hoc_id_s() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -446,7 +446,7 @@ namespace neuron { _r = id_s_localize_arguments(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_id_p(void) { + static void _hoc_id_p() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/function/neuron/non_threadsafe.cpp b/function/neuron/non_threadsafe.cpp index 9de6899e..273ec792 100644 --- a/function/neuron/non_threadsafe.cpp +++ b/function/neuron/non_threadsafe.cpp @@ -191,12 +191,12 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_x_plus_a(void); - static double _npy_x_plus_a(Prop*); - static void _hoc_v_plus_a(void); - static double _npy_v_plus_a(Prop*); - static void _hoc_identity(void); - static double _npy_identity(Prop*); + static void _hoc_x_plus_a(); + static double _npy_x_plus_a(Prop* _prop); + static void _hoc_v_plus_a(); + static double _npy_v_plus_a(Prop* _prop); + static void _hoc_identity(); + static double _npy_identity(Prop* _prop); /* connect user functions to hoc names */ @@ -213,7 +213,7 @@ namespace neuron { {"identity", _npy_identity}, {nullptr, nullptr} }; - static void _hoc_x_plus_a(void) { + static void _hoc_x_plus_a() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -247,7 +247,7 @@ namespace neuron { _r = x_plus_a_non_threadsafe(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_v_plus_a(void) { + static void _hoc_v_plus_a() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -278,7 +278,7 @@ namespace neuron { _r = v_plus_a_non_threadsafe(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_identity(void) { + static void _hoc_identity() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/function/neuron/point_functions.cpp b/function/neuron/point_functions.cpp index cfbec74e..e2b57663 100644 --- a/function/neuron/point_functions.cpp +++ b/function/neuron/point_functions.cpp @@ -202,9 +202,9 @@ namespace neuron { /* declaration of user functions */ - static double _hoc_x_plus_a(void*); - static double _hoc_v_plus_a(void*); - static double _hoc_identity(void*); + static double _hoc_x_plus_a(void * _vptr); + static double _hoc_v_plus_a(void * _vptr); + static double _hoc_identity(void * _vptr); /* connect user functions to hoc names */ @@ -220,7 +220,7 @@ namespace neuron { {"identity", _hoc_identity}, {nullptr, nullptr} }; - static double _hoc_x_plus_a(void* _vptr) { + static double _hoc_x_plus_a(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; @@ -240,7 +240,7 @@ namespace neuron { _r = x_plus_a_point_functions(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static double _hoc_v_plus_a(void* _vptr) { + static double _hoc_v_plus_a(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; @@ -260,7 +260,7 @@ namespace neuron { _r = v_plus_a_point_functions(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static double _hoc_identity(void* _vptr) { + static double _hoc_identity(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/function/neuron/point_non_threadsafe.cpp b/function/neuron/point_non_threadsafe.cpp index 1810e906..0efcc373 100644 --- a/function/neuron/point_non_threadsafe.cpp +++ b/function/neuron/point_non_threadsafe.cpp @@ -215,9 +215,9 @@ namespace neuron { /* declaration of user functions */ - static double _hoc_x_plus_a(void*); - static double _hoc_v_plus_a(void*); - static double _hoc_identity(void*); + static double _hoc_x_plus_a(void * _vptr); + static double _hoc_v_plus_a(void * _vptr); + static double _hoc_identity(void * _vptr); /* connect user functions to hoc names */ @@ -233,7 +233,7 @@ namespace neuron { {"identity", _hoc_identity}, {nullptr, nullptr} }; - static double _hoc_x_plus_a(void* _vptr) { + static double _hoc_x_plus_a(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; @@ -253,7 +253,7 @@ namespace neuron { _r = x_plus_a_point_non_threadsafe(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static double _hoc_v_plus_a(void* _vptr) { + static double _hoc_v_plus_a(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; @@ -273,7 +273,7 @@ namespace neuron { _r = v_plus_a_point_non_threadsafe(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static double _hoc_identity(void* _vptr) { + static double _hoc_identity(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/function/neuron/recursion.cpp b/function/neuron/recursion.cpp index 4b6517b3..e0359d6d 100644 --- a/function/neuron/recursion.cpp +++ b/function/neuron/recursion.cpp @@ -173,8 +173,8 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_fibonacci(void); - static double _npy_fibonacci(Prop*); + static void _hoc_fibonacci(); + static double _npy_fibonacci(Prop* _prop); /* connect user functions to hoc names */ @@ -187,7 +187,7 @@ namespace neuron { {"fibonacci", _npy_fibonacci}, {nullptr, nullptr} }; - static void _hoc_fibonacci(void) { + static void _hoc_fibonacci() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/function_table/coreneuron/art_function_table.cpp b/function_table/coreneuron/art_function_table.cpp new file mode 100644 index 00000000..481291b4 --- /dev/null +++ b/function_table/coreneuron/art_function_table.cpp @@ -0,0 +1,307 @@ +/********************************************************* +Model Name : art_function_table +Filename : art_function_table.mod +NMODL Version : 7.7.0 +Vectorized : true +Threadsafe : true +Created : DATE +Simulator : CoreNEURON +Backend : C++ (api-compatibility) +NMODL Compiler : VERSION +*********************************************************/ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace coreneuron { + #ifndef NRN_PRCELLSTATE + #define NRN_PRCELLSTATE 0 + #endif + + + /** channel information */ + static const char *mechanism_info[] = { + "7.7.0", + "art_function_table", + 0, + 0, + 0, + 0 + }; + + + /** all global variables */ + struct art_function_table_Store { + int point_type{}; + int reset{}; + int mech_type{}; + void* _ptable_cnst1{}; + void* _ptable_cnst2{}; + void* _ptable_tau1{}; + void* _ptable_tau2{}; + }; + static_assert(std::is_trivially_copy_constructible_v); + static_assert(std::is_trivially_move_constructible_v); + static_assert(std::is_trivially_copy_assignable_v); + static_assert(std::is_trivially_move_assignable_v); + static_assert(std::is_trivially_destructible_v); + art_function_table_Store art_function_table_global; + + + /** all mechanism instance variables and global variables */ + struct art_function_table_Instance { + double* v_unused{}; + const double* node_area{}; + void** point_process{}; + art_function_table_Store* global{&art_function_table_global}; + }; + + + /** connect global (scalar) variables to hoc -- */ + static DoubScal hoc_scalar_double[] = { + {nullptr, nullptr} + }; + + + /** connect global (array) variables to hoc -- */ + static DoubVec hoc_vector_double[] = { + {nullptr, nullptr, 0} + }; + + + static inline int first_pointer_var_index() { + return -1; + } + + + static inline int first_random_var_index() { + return -1; + } + + + static inline int float_variables_size() { + return 1; + } + + + static inline int int_variables_size() { + return 2; + } + + + static inline int get_mech_type() { + return art_function_table_global.mech_type; + } + + + static inline Memb_list* get_memb_list(NrnThread* nt) { + if (!nt->_ml_list) { + return nullptr; + } + return nt->_ml_list[get_mech_type()]; + } + + + static inline void* mem_alloc(size_t num, size_t size, size_t alignment = 64) { + size_t aligned_size = ((num*size + alignment - 1) / alignment) * alignment; + void* ptr = aligned_alloc(alignment, aligned_size); + memset(ptr, 0, aligned_size); + return ptr; + } + + + static inline void mem_free(void* ptr) { + free(ptr); + } + + + static inline void coreneuron_abort() { + abort(); + } + + // Allocate instance structure + static void nrn_private_constructor_art_function_table(NrnThread* nt, Memb_list* ml, int type) { + assert(!ml->instance); + assert(!ml->global_variables); + assert(ml->global_variables_size == 0); + auto* const inst = new art_function_table_Instance{}; + assert(inst->global == &art_function_table_global); + ml->instance = inst; + ml->global_variables = inst->global; + ml->global_variables_size = sizeof(art_function_table_Store); + } + + // Deallocate the instance structure + static void nrn_private_destructor_art_function_table(NrnThread* nt, Memb_list* ml, int type) { + auto* const inst = static_cast(ml->instance); + assert(inst); + assert(inst->global); + assert(inst->global == &art_function_table_global); + assert(inst->global == ml->global_variables); + assert(ml->global_variables_size == sizeof(art_function_table_Store)); + delete inst; + ml->instance = nullptr; + ml->global_variables = nullptr; + ml->global_variables_size = 0; + } + + /** initialize mechanism instance variables */ + static inline void setup_instance(NrnThread* nt, Memb_list* ml) { + auto* const inst = static_cast(ml->instance); + assert(inst); + assert(inst->global); + assert(inst->global == &art_function_table_global); + assert(inst->global == ml->global_variables); + assert(ml->global_variables_size == sizeof(art_function_table_Store)); + int pnodecount = ml->_nodecount_padded; + Datum* indexes = ml->pdata; + inst->v_unused = ml->data+0*pnodecount; + inst->node_area = nt->_data; + inst->point_process = nt->_vdata; + } + + + + static void nrn_alloc_art_function_table(double* data, Datum* indexes, int type) { + // do nothing + } + + + void nrn_constructor_art_function_table(NrnThread* nt, Memb_list* ml, int type) { + #ifndef CORENEURON_BUILD + int nodecount = ml->nodecount; + int pnodecount = ml->_nodecount_padded; + const int* node_index = ml->nodeindices; + double* data = ml->data; + const double* voltage = nt->_actual_v; + Datum* indexes = ml->pdata; + ThreadDatum* thread = ml->_thread; + auto* const inst = static_cast(ml->instance); + + #endif + } + + + void nrn_destructor_art_function_table(NrnThread* nt, Memb_list* ml, int type) { + #ifndef CORENEURON_BUILD + int nodecount = ml->nodecount; + int pnodecount = ml->_nodecount_padded; + const int* node_index = ml->nodeindices; + double* data = ml->data; + const double* voltage = nt->_actual_v; + Datum* indexes = ml->pdata; + ThreadDatum* thread = ml->_thread; + auto* const inst = static_cast(ml->instance); + + #endif + } + + + inline double use_tau2_art_function_table(int id, int pnodecount, art_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v, double _lv, double _lx); + + + inline double use_tau2_art_function_table(int id, int pnodecount, art_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v, double _lv, double _lx) { + double ret_use_tau2 = 0.0; + printf("0: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_art_function_table(id, pnodecount, inst, data, indexes, thread, nt, v, _lv, _lx)); + printf("1: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_art_function_table(id, pnodecount, inst, data, indexes, thread, nt, v, _lv, _lx)); + printf("2: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_art_function_table(id, pnodecount, inst, data, indexes, thread, nt, v, _lv, _lx)); + printf("3: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_art_function_table(id, pnodecount, inst, data, indexes, thread, nt, v, _lv, _lx)); + ret_use_tau2 = tau2_art_function_table(id, pnodecount, inst, data, indexes, thread, nt, v, _lv, _lx); + return ret_use_tau2; + } + double cnst1_art_function_table(int id, int pnodecount, art_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v, double v) { + double _arg[1]; + _arg[0] = v; + return hoc_func_table(inst->global->_ptable_cnst1, 1, _arg); + } + double table_cnst1_art_function_table(int id, int pnodecount, art_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v) { + hoc_spec_table(&inst->global->_ptable_cnst1, 1); + return 0.; + } + double cnst2_art_function_table(int id, int pnodecount, art_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v, double v, double x) { + double _arg[2]; + _arg[0] = v; + _arg[1] = x; + return hoc_func_table(inst->global->_ptable_cnst2, 2, _arg); + } + double table_cnst2_art_function_table(int id, int pnodecount, art_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v) { + hoc_spec_table(&inst->global->_ptable_cnst2, 2); + return 0.; + } + double tau1_art_function_table(int id, int pnodecount, art_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v, double v) { + double _arg[1]; + _arg[0] = v; + return hoc_func_table(inst->global->_ptable_tau1, 1, _arg); + } + double table_tau1_art_function_table(int id, int pnodecount, art_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v) { + hoc_spec_table(&inst->global->_ptable_tau1, 1); + return 0.; + } + double tau2_art_function_table(int id, int pnodecount, art_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v, double v, double x) { + double _arg[2]; + _arg[0] = v; + _arg[1] = x; + return hoc_func_table(inst->global->_ptable_tau2, 2, _arg); + } + double table_tau2_art_function_table(int id, int pnodecount, art_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v) { + hoc_spec_table(&inst->global->_ptable_tau2, 2); + return 0.; + } + + + /** initialize channel */ + void nrn_init_art_function_table(NrnThread* nt, Memb_list* ml, int type) { + int nodecount = ml->nodecount; + int pnodecount = ml->_nodecount_padded; + const int* node_index = ml->nodeindices; + double* data = ml->data; + const double* voltage = nt->_actual_v; + Datum* indexes = ml->pdata; + ThreadDatum* thread = ml->_thread; + + setup_instance(nt, ml); + auto* const inst = static_cast(ml->instance); + + if (_nrn_skip_initmodel == 0) { + #pragma omp simd + #pragma ivdep + for (int id = 0; id < nodecount; id++) { + double v = 0.0; + } + } + } + + + /** register channel with the simulator */ + void _art_function_table_reg() { + + int mech_type = nrn_get_mechtype("art_function_table"); + art_function_table_global.mech_type = mech_type; + if (mech_type == -1) { + return; + } + + _nrn_layout_reg(mech_type, 0); + point_register_mech(mechanism_info, nrn_alloc_art_function_table, nullptr, nullptr, nullptr, nrn_init_art_function_table, nrn_private_constructor_art_function_table, nrn_private_destructor_art_function_table, first_pointer_var_index(), nullptr, nullptr, 1); + + hoc_register_prop_size(mech_type, float_variables_size(), int_variables_size()); + hoc_register_dparam_semantics(mech_type, 0, "area"); + hoc_register_dparam_semantics(mech_type, 1, "pntproc"); + add_nrn_artcell(mech_type, 0); + hoc_register_var(hoc_scalar_double, hoc_vector_double, NULL); + } +} diff --git a/function_table/coreneuron/function_table.cpp b/function_table/coreneuron/function_table.cpp index 8a9c5040..26fa19d5 100644 --- a/function_table/coreneuron/function_table.cpp +++ b/function_table/coreneuron/function_table.cpp @@ -211,6 +211,10 @@ namespace coreneuron { inline double use_tau2_function_table(int id, int pnodecount, function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v, double _lv, double _lx) { double ret_use_tau2 = 0.0; + printf("0: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_function_table(id, pnodecount, inst, data, indexes, thread, nt, v, _lv, _lx)); + printf("1: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_function_table(id, pnodecount, inst, data, indexes, thread, nt, v, _lv, _lx)); + printf("2: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_function_table(id, pnodecount, inst, data, indexes, thread, nt, v, _lv, _lx)); + printf("3: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_function_table(id, pnodecount, inst, data, indexes, thread, nt, v, _lv, _lx)); ret_use_tau2 = tau2_function_table(id, pnodecount, inst, data, indexes, thread, nt, v, _lv, _lx); return ret_use_tau2; } diff --git a/function_table/coreneuron/point_function_table.cpp b/function_table/coreneuron/point_function_table.cpp new file mode 100644 index 00000000..33b565c2 --- /dev/null +++ b/function_table/coreneuron/point_function_table.cpp @@ -0,0 +1,310 @@ +/********************************************************* +Model Name : point_function_table +Filename : point_function_table.mod +NMODL Version : 7.7.0 +Vectorized : true +Threadsafe : true +Created : DATE +Simulator : CoreNEURON +Backend : C++ (api-compatibility) +NMODL Compiler : VERSION +*********************************************************/ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace coreneuron { + #ifndef NRN_PRCELLSTATE + #define NRN_PRCELLSTATE 0 + #endif + + + /** channel information */ + static const char *mechanism_info[] = { + "7.7.0", + "point_function_table", + 0, + 0, + 0, + 0 + }; + + + /** all global variables */ + struct point_function_table_Store { + int point_type{}; + int reset{}; + int mech_type{}; + void* _ptable_cnst1{}; + void* _ptable_cnst2{}; + void* _ptable_tau1{}; + void* _ptable_tau2{}; + }; + static_assert(std::is_trivially_copy_constructible_v); + static_assert(std::is_trivially_move_constructible_v); + static_assert(std::is_trivially_copy_assignable_v); + static_assert(std::is_trivially_move_assignable_v); + static_assert(std::is_trivially_destructible_v); + point_function_table_Store point_function_table_global; + + + /** all mechanism instance variables and global variables */ + struct point_function_table_Instance { + double* v_unused{}; + const double* node_area{}; + const int* point_process{}; + point_function_table_Store* global{&point_function_table_global}; + }; + + + /** connect global (scalar) variables to hoc -- */ + static DoubScal hoc_scalar_double[] = { + {nullptr, nullptr} + }; + + + /** connect global (array) variables to hoc -- */ + static DoubVec hoc_vector_double[] = { + {nullptr, nullptr, 0} + }; + + + static inline int first_pointer_var_index() { + return -1; + } + + + static inline int first_random_var_index() { + return -1; + } + + + static inline int float_variables_size() { + return 1; + } + + + static inline int int_variables_size() { + return 2; + } + + + static inline int get_mech_type() { + return point_function_table_global.mech_type; + } + + + static inline Memb_list* get_memb_list(NrnThread* nt) { + if (!nt->_ml_list) { + return nullptr; + } + return nt->_ml_list[get_mech_type()]; + } + + + static inline void* mem_alloc(size_t num, size_t size, size_t alignment = 64) { + size_t aligned_size = ((num*size + alignment - 1) / alignment) * alignment; + void* ptr = aligned_alloc(alignment, aligned_size); + memset(ptr, 0, aligned_size); + return ptr; + } + + + static inline void mem_free(void* ptr) { + free(ptr); + } + + + static inline void coreneuron_abort() { + abort(); + } + + // Allocate instance structure + static void nrn_private_constructor_point_function_table(NrnThread* nt, Memb_list* ml, int type) { + assert(!ml->instance); + assert(!ml->global_variables); + assert(ml->global_variables_size == 0); + auto* const inst = new point_function_table_Instance{}; + assert(inst->global == &point_function_table_global); + ml->instance = inst; + ml->global_variables = inst->global; + ml->global_variables_size = sizeof(point_function_table_Store); + } + + // Deallocate the instance structure + static void nrn_private_destructor_point_function_table(NrnThread* nt, Memb_list* ml, int type) { + auto* const inst = static_cast(ml->instance); + assert(inst); + assert(inst->global); + assert(inst->global == &point_function_table_global); + assert(inst->global == ml->global_variables); + assert(ml->global_variables_size == sizeof(point_function_table_Store)); + delete inst; + ml->instance = nullptr; + ml->global_variables = nullptr; + ml->global_variables_size = 0; + } + + /** initialize mechanism instance variables */ + static inline void setup_instance(NrnThread* nt, Memb_list* ml) { + auto* const inst = static_cast(ml->instance); + assert(inst); + assert(inst->global); + assert(inst->global == &point_function_table_global); + assert(inst->global == ml->global_variables); + assert(ml->global_variables_size == sizeof(point_function_table_Store)); + int pnodecount = ml->_nodecount_padded; + Datum* indexes = ml->pdata; + inst->v_unused = ml->data+0*pnodecount; + inst->node_area = nt->_data; + inst->point_process = ml->pdata; + } + + + + static void nrn_alloc_point_function_table(double* data, Datum* indexes, int type) { + // do nothing + } + + + void nrn_constructor_point_function_table(NrnThread* nt, Memb_list* ml, int type) { + #ifndef CORENEURON_BUILD + int nodecount = ml->nodecount; + int pnodecount = ml->_nodecount_padded; + const int* node_index = ml->nodeindices; + double* data = ml->data; + const double* voltage = nt->_actual_v; + Datum* indexes = ml->pdata; + ThreadDatum* thread = ml->_thread; + auto* const inst = static_cast(ml->instance); + + #endif + } + + + void nrn_destructor_point_function_table(NrnThread* nt, Memb_list* ml, int type) { + #ifndef CORENEURON_BUILD + int nodecount = ml->nodecount; + int pnodecount = ml->_nodecount_padded; + const int* node_index = ml->nodeindices; + double* data = ml->data; + const double* voltage = nt->_actual_v; + Datum* indexes = ml->pdata; + ThreadDatum* thread = ml->_thread; + auto* const inst = static_cast(ml->instance); + + #endif + } + + + inline double use_tau2_point_function_table(int id, int pnodecount, point_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v, double _lv, double _lx); + + + inline double use_tau2_point_function_table(int id, int pnodecount, point_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v, double _lv, double _lx) { + double ret_use_tau2 = 0.0; + printf("0: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_point_function_table(id, pnodecount, inst, data, indexes, thread, nt, v, _lv, _lx)); + printf("1: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_point_function_table(id, pnodecount, inst, data, indexes, thread, nt, v, _lv, _lx)); + printf("2: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_point_function_table(id, pnodecount, inst, data, indexes, thread, nt, v, _lv, _lx)); + printf("3: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_point_function_table(id, pnodecount, inst, data, indexes, thread, nt, v, _lv, _lx)); + ret_use_tau2 = tau2_point_function_table(id, pnodecount, inst, data, indexes, thread, nt, v, _lv, _lx); + return ret_use_tau2; + } + double cnst1_point_function_table(int id, int pnodecount, point_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v, double v) { + double _arg[1]; + _arg[0] = v; + return hoc_func_table(inst->global->_ptable_cnst1, 1, _arg); + } + double table_cnst1_point_function_table(int id, int pnodecount, point_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v) { + hoc_spec_table(&inst->global->_ptable_cnst1, 1); + return 0.; + } + double cnst2_point_function_table(int id, int pnodecount, point_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v, double v, double x) { + double _arg[2]; + _arg[0] = v; + _arg[1] = x; + return hoc_func_table(inst->global->_ptable_cnst2, 2, _arg); + } + double table_cnst2_point_function_table(int id, int pnodecount, point_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v) { + hoc_spec_table(&inst->global->_ptable_cnst2, 2); + return 0.; + } + double tau1_point_function_table(int id, int pnodecount, point_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v, double v) { + double _arg[1]; + _arg[0] = v; + return hoc_func_table(inst->global->_ptable_tau1, 1, _arg); + } + double table_tau1_point_function_table(int id, int pnodecount, point_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v) { + hoc_spec_table(&inst->global->_ptable_tau1, 1); + return 0.; + } + double tau2_point_function_table(int id, int pnodecount, point_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v, double v, double x) { + double _arg[2]; + _arg[0] = v; + _arg[1] = x; + return hoc_func_table(inst->global->_ptable_tau2, 2, _arg); + } + double table_tau2_point_function_table(int id, int pnodecount, point_function_table_Instance* inst, double* data, const Datum* indexes, ThreadDatum* thread, NrnThread* nt, double v) { + hoc_spec_table(&inst->global->_ptable_tau2, 2); + return 0.; + } + + + /** initialize channel */ + void nrn_init_point_function_table(NrnThread* nt, Memb_list* ml, int type) { + int nodecount = ml->nodecount; + int pnodecount = ml->_nodecount_padded; + const int* node_index = ml->nodeindices; + double* data = ml->data; + const double* voltage = nt->_actual_v; + Datum* indexes = ml->pdata; + ThreadDatum* thread = ml->_thread; + + setup_instance(nt, ml); + auto* const inst = static_cast(ml->instance); + + if (_nrn_skip_initmodel == 0) { + #pragma omp simd + #pragma ivdep + for (int id = 0; id < nodecount; id++) { + int node_id = node_index[id]; + double v = voltage[node_id]; + #if NRN_PRCELLSTATE + inst->v_unused[id] = v; + #endif + } + } + } + + + /** register channel with the simulator */ + void _point_function_table_reg() { + + int mech_type = nrn_get_mechtype("point_function_table"); + point_function_table_global.mech_type = mech_type; + if (mech_type == -1) { + return; + } + + _nrn_layout_reg(mech_type, 0); + point_register_mech(mechanism_info, nrn_alloc_point_function_table, nullptr, nullptr, nullptr, nrn_init_point_function_table, nrn_private_constructor_point_function_table, nrn_private_destructor_point_function_table, first_pointer_var_index(), nullptr, nullptr, 1); + + hoc_register_prop_size(mech_type, float_variables_size(), int_variables_size()); + hoc_register_dparam_semantics(mech_type, 0, "area"); + hoc_register_dparam_semantics(mech_type, 1, "pntproc"); + hoc_register_var(hoc_scalar_double, hoc_vector_double, NULL); + } +} diff --git a/function_table/neuron/art_function_table.cpp b/function_table/neuron/art_function_table.cpp new file mode 100644 index 00000000..ada5b59a --- /dev/null +++ b/function_table/neuron/art_function_table.cpp @@ -0,0 +1,433 @@ +/********************************************************* +Model Name : art_function_table +Filename : art_function_table.mod +NMODL Version : 7.7.0 +Vectorized : true +Threadsafe : true +Created : DATE +Simulator : NEURON +Backend : C++ (api-compatibility) +NMODL Compiler : VERSION +*********************************************************/ + +#include +#include +#include +#include +#include +#include + +#include "mech_api.h" +#include "neuron/cache/mechanism_range.hpp" +#include "nrniv_mf.h" +#include "section_fwd.hpp" + +/* NEURON global macro definitions */ +/* VECTORIZED */ +#define NRN_VECTORIZED 1 + +static constexpr auto number_of_datum_variables = 2; +static constexpr auto number_of_floating_point_variables = 1; + +namespace { +template +using _nrn_mechanism_std_vector = std::vector; +using _nrn_model_sorted_token = neuron::model_sorted_token; +using _nrn_mechanism_cache_range = neuron::cache::MechanismRange; +using _nrn_mechanism_cache_instance = neuron::cache::MechanismInstance; +using _nrn_non_owning_id_without_container = neuron::container::non_owning_identifier_without_container; +template +using _nrn_mechanism_field = neuron::mechanism::field; +template +void _nrn_mechanism_register_data_fields(Args&&... args) { + neuron::mechanism::register_data_fields(std::forward(args)...); +} +} // namespace + +extern Prop* nrn_point_prop_; +extern Node* nrn_alloc_node_; + + +namespace neuron { + #ifndef NRN_PRCELLSTATE + #define NRN_PRCELLSTATE 0 + #endif + + + /** channel information */ + static const char *mechanism_info[] = { + "7.7.0", + "art_function_table", + 0, + 0, + 0, + 0 + }; + + + /* NEURON global variables */ + static int mech_type; + static int _pointtype; + static _nrn_mechanism_std_vector _extcall_thread; + + + /** all global variables */ + struct art_function_table_Store { + void* _ptable_cnst1{}; + void* _ptable_cnst2{}; + void* _ptable_tau1{}; + void* _ptable_tau2{}; + }; + static_assert(std::is_trivially_copy_constructible_v); + static_assert(std::is_trivially_move_constructible_v); + static_assert(std::is_trivially_copy_assignable_v); + static_assert(std::is_trivially_move_assignable_v); + static_assert(std::is_trivially_destructible_v); + art_function_table_Store art_function_table_global; + auto _ptable_cnst1_art_function_table() -> std::decay::type { + return art_function_table_global._ptable_cnst1; + } + auto _ptable_cnst2_art_function_table() -> std::decay::type { + return art_function_table_global._ptable_cnst2; + } + auto _ptable_tau1_art_function_table() -> std::decay::type { + return art_function_table_global._ptable_tau1; + } + auto _ptable_tau2_art_function_table() -> std::decay::type { + return art_function_table_global._ptable_tau2; + } + + static std::vector _parameter_defaults = { + }; + + + /** all mechanism instance variables and global variables */ + struct art_function_table_Instance { + double* v_unused{}; + const double* const* node_area{}; + art_function_table_Store* global{&art_function_table_global}; + }; + + + struct art_function_table_NodeData { + int const * nodeindices; + double const * node_voltages; + double * node_diagonal; + double * node_rhs; + int nodecount; + }; + + + static art_function_table_Instance make_instance_art_function_table(_nrn_mechanism_cache_range& _lmc) { + return art_function_table_Instance { + _lmc.template fpfield_ptr<0>(), + _lmc.template dptr_field_ptr<0>() + }; + } + + + static art_function_table_NodeData make_node_data_art_function_table(NrnThread& nt, Memb_list& _ml_arg) { + return art_function_table_NodeData { + _ml_arg.nodeindices, + nt.node_voltage_storage(), + nt.node_d_storage(), + nt.node_rhs_storage(), + _ml_arg.nodecount + }; + } + static art_function_table_NodeData make_node_data_art_function_table(Prop * _prop) { + static std::vector node_index{0}; + Node* _node = _nrn_mechanism_access_node(_prop); + return art_function_table_NodeData { + node_index.data(), + &_nrn_mechanism_access_voltage(_node), + &_nrn_mechanism_access_d(_node), + &_nrn_mechanism_access_rhs(_node), + 1 + }; + } + + void nrn_destructor_art_function_table(Prop* prop); + + + static void nrn_alloc_art_function_table(Prop* _prop) { + Datum *_ppvar = nullptr; + if (nrn_point_prop_) { + _nrn_mechanism_access_alloc_seq(_prop) = _nrn_mechanism_access_alloc_seq(nrn_point_prop_); + _ppvar = _nrn_mechanism_access_dparam(nrn_point_prop_); + } else { + _ppvar = nrn_prop_datum_alloc(mech_type, 2, _prop); + _nrn_mechanism_access_dparam(_prop) = _ppvar; + _nrn_mechanism_cache_instance _lmc{_prop}; + size_t const _iml = 0; + assert(_nrn_mechanism_get_num_vars(_prop) == 1); + /*initialize range parameters*/ + } + _nrn_mechanism_access_dparam(_prop) = _ppvar; + if(!nrn_point_prop_) { + } + } + + + /* Mechanism procedures and functions */ + inline double use_tau2_art_function_table(_nrn_mechanism_cache_range& _lmc, art_function_table_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* nt, double _lv, double _lx); + double cnst1_art_function_table(double v); + double table_cnst1_art_function_table(); + double cnst2_art_function_table(double v, double x); + double table_cnst2_art_function_table(); + double tau1_art_function_table(double v); + double table_tau1_art_function_table(); + double tau2_art_function_table(double v, double x); + double table_tau2_art_function_table(); + static void _apply_diffusion_function(ldifusfunc2_t _f, const _nrn_model_sorted_token& _sorted_token, NrnThread& _nt) { + } + + /* Point Process specific functions */ + static void* _hoc_create_pnt(Object* _ho) { + return create_point_process(_pointtype, _ho); + } + static void _hoc_destroy_pnt(void* _vptr) { + destroy_point_process(_vptr); + } + static double _hoc_loc_pnt(void* _vptr) { + return loc_point_process(_pointtype, _vptr); + } + static double _hoc_has_loc(void* _vptr) { + return has_loc_point(_vptr); + } + static double _hoc_get_loc_pnt(void* _vptr) { + return (get_loc_point_process(_vptr)); + } + /* Neuron setdata functions */ + extern void _nrn_setdata_reg(int, void(*)(Prop*)); + static void _setdata(Prop* _prop) { + } + static void _hoc_setdata(void* _vptr) { + Prop* _prop; + _prop = ((Point_process*)_vptr)->prop; + _setdata(_prop); + } + + + /** connect global (scalar) variables to hoc -- */ + static DoubScal hoc_scalar_double[] = { + {nullptr, nullptr} + }; + + + /** connect global (array) variables to hoc -- */ + static DoubVec hoc_vector_double[] = { + {nullptr, nullptr, 0} + }; + + + /* declaration of user functions */ + static double _hoc_use_tau2(void * _vptr); + static double _hoc_cnst1(void * _vptr); + static double _hoc_cnst2(void * _vptr); + static double _hoc_tau1(void * _vptr); + static double _hoc_tau2(void * _vptr); + static double _hoc_table_cnst1(void * _vptr); + static double _hoc_table_cnst2(void * _vptr); + static double _hoc_table_tau1(void * _vptr); + static double _hoc_table_tau2(void * _vptr); + + + /* connect user functions to hoc names */ + static VoidFunc hoc_intfunc[] = { + {0, 0} + }; + static Member_func _member_func[] = { + {"loc", _hoc_loc_pnt}, + {"has_loc", _hoc_has_loc}, + {"get_loc", _hoc_get_loc_pnt}, + {"use_tau2", _hoc_use_tau2}, + {"cnst1", _hoc_cnst1}, + {"cnst2", _hoc_cnst2}, + {"tau1", _hoc_tau1}, + {"tau2", _hoc_tau2}, + {"table_cnst1", _hoc_table_cnst1}, + {"table_cnst2", _hoc_table_cnst2}, + {"table_tau1", _hoc_table_tau1}, + {"table_tau2", _hoc_table_tau2}, + {nullptr, nullptr} + }; + static double _hoc_use_tau2(void * _vptr) { + double _r{}; + Datum* _ppvar; + Datum* _thread; + NrnThread* nt; + auto* const _pnt = static_cast(_vptr); + auto* const _p = _pnt->prop; + if (!_p) { + hoc_execerror("POINT_PROCESS data instance not valid", nullptr); + } + _nrn_mechanism_cache_instance _lmc{_p}; + size_t const id{}; + _ppvar = _nrn_mechanism_access_dparam(_p); + _thread = _extcall_thread.data(); + nt = static_cast(_pnt->_vnt); + auto inst = make_instance_art_function_table(_lmc); + _r = use_tau2_art_function_table(_lmc, inst, id, _ppvar, _thread, nt, *getarg(1), *getarg(2)); + return(_r); + } + static double _hoc_cnst1(void * _vptr) { + double _ret = cnst1_art_function_table(*getarg(1)); + return _ret; + } + static double _hoc_table_cnst1(void * _vptr) { + double _ret = table_cnst1_art_function_table(); + return _ret; + } + static double _npy_cnst1(Prop* _prop) { + return cnst1_art_function_table(*getarg(1)); + } + static double _npy_table_cnst1(Prop* _prop) { + return table_cnst1_art_function_table(); + } + static double _hoc_cnst2(void * _vptr) { + double _ret = cnst2_art_function_table(*getarg(1), *getarg(2)); + return _ret; + } + static double _hoc_table_cnst2(void * _vptr) { + double _ret = table_cnst2_art_function_table(); + return _ret; + } + static double _npy_cnst2(Prop* _prop) { + return cnst2_art_function_table(*getarg(1), *getarg(2)); + } + static double _npy_table_cnst2(Prop* _prop) { + return table_cnst2_art_function_table(); + } + static double _hoc_tau1(void * _vptr) { + double _ret = tau1_art_function_table(*getarg(1)); + return _ret; + } + static double _hoc_table_tau1(void * _vptr) { + double _ret = table_tau1_art_function_table(); + return _ret; + } + static double _npy_tau1(Prop* _prop) { + return tau1_art_function_table(*getarg(1)); + } + static double _npy_table_tau1(Prop* _prop) { + return table_tau1_art_function_table(); + } + static double _hoc_tau2(void * _vptr) { + double _ret = tau2_art_function_table(*getarg(1), *getarg(2)); + return _ret; + } + static double _hoc_table_tau2(void * _vptr) { + double _ret = table_tau2_art_function_table(); + return _ret; + } + static double _npy_tau2(Prop* _prop) { + return tau2_art_function_table(*getarg(1), *getarg(2)); + } + static double _npy_table_tau2(Prop* _prop) { + return table_tau2_art_function_table(); + } + + + inline double use_tau2_art_function_table(_nrn_mechanism_cache_range& _lmc, art_function_table_Instance& inst, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* nt, double _lv, double _lx) { + double ret_use_tau2 = 0.0; + printf("0: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_art_function_table(_lv, _lx)); + printf("1: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_art_function_table(_lv, _lx)); + printf("2: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_art_function_table(_lv, _lx)); + printf("3: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_art_function_table(_lv, _lx)); + ret_use_tau2 = tau2_art_function_table(_lv, _lx); + return ret_use_tau2; + } + double cnst1_art_function_table(double v) { + double _arg[1]; + _arg[0] = v; + return hoc_func_table(art_function_table_global._ptable_cnst1, 1, _arg); + } + double table_cnst1_art_function_table() { + hoc_spec_table(&art_function_table_global._ptable_cnst1, 1); + return 0.; + } + double cnst2_art_function_table(double v, double x) { + double _arg[2]; + _arg[0] = v; + _arg[1] = x; + return hoc_func_table(art_function_table_global._ptable_cnst2, 2, _arg); + } + double table_cnst2_art_function_table() { + hoc_spec_table(&art_function_table_global._ptable_cnst2, 2); + return 0.; + } + double tau1_art_function_table(double v) { + double _arg[1]; + _arg[0] = v; + return hoc_func_table(art_function_table_global._ptable_tau1, 1, _arg); + } + double table_tau1_art_function_table() { + hoc_spec_table(&art_function_table_global._ptable_tau1, 1); + return 0.; + } + double tau2_art_function_table(double v, double x) { + double _arg[2]; + _arg[0] = v; + _arg[1] = x; + return hoc_func_table(art_function_table_global._ptable_tau2, 2, _arg); + } + double table_tau2_art_function_table() { + hoc_spec_table(&art_function_table_global._ptable_tau2, 2); + return 0.; + } + + + void nrn_init_art_function_table(const _nrn_model_sorted_token& _sorted_token, NrnThread* nt, Memb_list* _ml_arg, int _type) { + _nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _ml_arg->type()}; + auto inst = make_instance_art_function_table(_lmc); + auto* _thread = _ml_arg->_thread; + auto nodecount = _ml_arg->nodecount; + for (int id = 0; id < nodecount; id++) { + auto* _ppvar = _ml_arg->pdata[id]; + } + } + + + static void nrn_jacob_art_function_table(const _nrn_model_sorted_token& _sorted_token, NrnThread* nt, Memb_list* _ml_arg, int _type) { + _nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _ml_arg->type()}; + auto inst = make_instance_art_function_table(_lmc); + auto* _thread = _ml_arg->_thread; + auto nodecount = _ml_arg->nodecount; + for (int id = 0; id < nodecount; id++) { + } + } + void nrn_destructor_art_function_table(Prop* prop) { + Datum* _ppvar = _nrn_mechanism_access_dparam(prop); + _nrn_mechanism_cache_instance _lmc{prop}; + const size_t id = 0; + auto inst = make_instance_art_function_table(_lmc); + + } + + + static void _initlists() { + } + + + /** register channel with the simulator */ + extern "C" void _art_function_table_reg() { + _initlists(); + + _pointtype = point_register_mech(mechanism_info, nrn_alloc_art_function_table, nullptr, nullptr, nullptr, nrn_init_art_function_table, -1, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); + + mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); + _nrn_mechanism_register_data_fields(mech_type, + _nrn_mechanism_field{"v_unused"} /* 0 */, + _nrn_mechanism_field{"node_area", "area"} /* 0 */, + _nrn_mechanism_field{"point_process", "pntproc"} /* 1 */ + ); + + hoc_register_prop_size(mech_type, 1, 2); + hoc_register_dparam_semantics(mech_type, 0, "area"); + hoc_register_dparam_semantics(mech_type, 1, "pntproc"); + add_nrn_artcell(mech_type, 0); + hoc_register_var(hoc_scalar_double, hoc_vector_double, hoc_intfunc); + } +} diff --git a/function_table/neuron/function_table.cpp b/function_table/neuron/function_table.cpp index 0cc7eed3..bebaf193 100644 --- a/function_table/neuron/function_table.cpp +++ b/function_table/neuron/function_table.cpp @@ -198,24 +198,24 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_use_tau2(void); - static double _npy_use_tau2(Prop*); - static void _hoc_cnst1(void); - static double _npy_cnst1(Prop*); - static void _hoc_cnst2(void); - static double _npy_cnst2(Prop*); - static void _hoc_tau1(void); - static double _npy_tau1(Prop*); - static void _hoc_tau2(void); - static double _npy_tau2(Prop*); - static void _hoc_table_cnst1(void); - static double _npy_table_cnst1(Prop*); - static void _hoc_table_cnst2(void); - static double _npy_table_cnst2(Prop*); - static void _hoc_table_tau1(void); - static double _npy_table_tau1(Prop*); - static void _hoc_table_tau2(void); - static double _npy_table_tau2(Prop*); + static void _hoc_use_tau2(); + static double _npy_use_tau2(Prop* _prop); + static void _hoc_cnst1(); + static double _npy_cnst1(Prop* _prop); + static void _hoc_cnst2(); + static double _npy_cnst2(Prop* _prop); + static void _hoc_tau1(); + static double _npy_tau1(Prop* _prop); + static void _hoc_tau2(); + static double _npy_tau2(Prop* _prop); + static void _hoc_table_cnst1(); + static double _npy_table_cnst1(Prop* _prop); + static void _hoc_table_cnst2(); + static double _npy_table_cnst2(Prop* _prop); + static void _hoc_table_tau1(); + static double _npy_table_tau1(Prop* _prop); + static void _hoc_table_tau2(); + static double _npy_table_tau2(Prop* _prop); /* connect user functions to hoc names */ @@ -234,9 +234,17 @@ namespace neuron { }; static NPyDirectMechFunc npy_direct_func_proc[] = { {"use_tau2", _npy_use_tau2}, + {"cnst1", _npy_cnst1}, + {"cnst2", _npy_cnst2}, + {"tau1", _npy_tau1}, + {"tau2", _npy_tau2}, + {"table_cnst1", _npy_table_cnst1}, + {"table_cnst2", _npy_table_cnst2}, + {"table_tau1", _npy_table_tau1}, + {"table_tau2", _npy_table_tau2}, {nullptr, nullptr} }; - static void _hoc_use_tau2(void) { + static void _hoc_use_tau2() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -268,10 +276,12 @@ namespace neuron { return(_r); } static void _hoc_cnst1() { - hoc_retpushx(cnst1_function_table(*getarg(1))); + double _ret = cnst1_function_table(*getarg(1)); + hoc_retpushx(_ret); } static void _hoc_table_cnst1() { - hoc_retpushx(table_cnst1_function_table()); + double _ret = table_cnst1_function_table(); + hoc_retpushx(_ret); } static double _npy_cnst1(Prop* _prop) { return cnst1_function_table(*getarg(1)); @@ -280,10 +290,12 @@ namespace neuron { return table_cnst1_function_table(); } static void _hoc_cnst2() { - hoc_retpushx(cnst2_function_table(*getarg(1), *getarg(2))); + double _ret = cnst2_function_table(*getarg(1), *getarg(2)); + hoc_retpushx(_ret); } static void _hoc_table_cnst2() { - hoc_retpushx(table_cnst2_function_table()); + double _ret = table_cnst2_function_table(); + hoc_retpushx(_ret); } static double _npy_cnst2(Prop* _prop) { return cnst2_function_table(*getarg(1), *getarg(2)); @@ -292,10 +304,12 @@ namespace neuron { return table_cnst2_function_table(); } static void _hoc_tau1() { - hoc_retpushx(tau1_function_table(*getarg(1))); + double _ret = tau1_function_table(*getarg(1)); + hoc_retpushx(_ret); } static void _hoc_table_tau1() { - hoc_retpushx(table_tau1_function_table()); + double _ret = table_tau1_function_table(); + hoc_retpushx(_ret); } static double _npy_tau1(Prop* _prop) { return tau1_function_table(*getarg(1)); @@ -304,10 +318,12 @@ namespace neuron { return table_tau1_function_table(); } static void _hoc_tau2() { - hoc_retpushx(tau2_function_table(*getarg(1), *getarg(2))); + double _ret = tau2_function_table(*getarg(1), *getarg(2)); + hoc_retpushx(_ret); } static void _hoc_table_tau2() { - hoc_retpushx(table_tau2_function_table()); + double _ret = table_tau2_function_table(); + hoc_retpushx(_ret); } static double _npy_tau2(Prop* _prop) { return tau2_function_table(*getarg(1), *getarg(2)); @@ -320,6 +336,10 @@ namespace neuron { inline double use_tau2_function_table(_nrn_mechanism_cache_range& _lmc, function_table_Instance& inst, function_table_NodeData& node_data, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* nt, double _lv, double _lx) { double ret_use_tau2 = 0.0; auto v = node_data.node_voltages[node_data.nodeindices[id]]; + printf("0: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_function_table(_lv, _lx)); + printf("1: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_function_table(_lv, _lx)); + printf("2: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_function_table(_lv, _lx)); + printf("3: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_function_table(_lv, _lx)); ret_use_tau2 = tau2_function_table(_lv, _lx); return ret_use_tau2; } diff --git a/function_table/neuron/point_function_table.cpp b/function_table/neuron/point_function_table.cpp new file mode 100644 index 00000000..e36a0f80 --- /dev/null +++ b/function_table/neuron/point_function_table.cpp @@ -0,0 +1,439 @@ +/********************************************************* +Model Name : point_function_table +Filename : point_function_table.mod +NMODL Version : 7.7.0 +Vectorized : true +Threadsafe : true +Created : DATE +Simulator : NEURON +Backend : C++ (api-compatibility) +NMODL Compiler : VERSION +*********************************************************/ + +#include +#include +#include +#include +#include +#include + +#include "mech_api.h" +#include "neuron/cache/mechanism_range.hpp" +#include "nrniv_mf.h" +#include "section_fwd.hpp" + +/* NEURON global macro definitions */ +/* VECTORIZED */ +#define NRN_VECTORIZED 1 + +static constexpr auto number_of_datum_variables = 2; +static constexpr auto number_of_floating_point_variables = 1; + +namespace { +template +using _nrn_mechanism_std_vector = std::vector; +using _nrn_model_sorted_token = neuron::model_sorted_token; +using _nrn_mechanism_cache_range = neuron::cache::MechanismRange; +using _nrn_mechanism_cache_instance = neuron::cache::MechanismInstance; +using _nrn_non_owning_id_without_container = neuron::container::non_owning_identifier_without_container; +template +using _nrn_mechanism_field = neuron::mechanism::field; +template +void _nrn_mechanism_register_data_fields(Args&&... args) { + neuron::mechanism::register_data_fields(std::forward(args)...); +} +} // namespace + +extern Prop* nrn_point_prop_; +extern Node* nrn_alloc_node_; + + +namespace neuron { + #ifndef NRN_PRCELLSTATE + #define NRN_PRCELLSTATE 0 + #endif + + + /** channel information */ + static const char *mechanism_info[] = { + "7.7.0", + "point_function_table", + 0, + 0, + 0, + 0 + }; + + + /* NEURON global variables */ + static int mech_type; + static int _pointtype; + static _nrn_mechanism_std_vector _extcall_thread; + + + /** all global variables */ + struct point_function_table_Store { + void* _ptable_cnst1{}; + void* _ptable_cnst2{}; + void* _ptable_tau1{}; + void* _ptable_tau2{}; + }; + static_assert(std::is_trivially_copy_constructible_v); + static_assert(std::is_trivially_move_constructible_v); + static_assert(std::is_trivially_copy_assignable_v); + static_assert(std::is_trivially_move_assignable_v); + static_assert(std::is_trivially_destructible_v); + point_function_table_Store point_function_table_global; + auto _ptable_cnst1_point_function_table() -> std::decay::type { + return point_function_table_global._ptable_cnst1; + } + auto _ptable_cnst2_point_function_table() -> std::decay::type { + return point_function_table_global._ptable_cnst2; + } + auto _ptable_tau1_point_function_table() -> std::decay::type { + return point_function_table_global._ptable_tau1; + } + auto _ptable_tau2_point_function_table() -> std::decay::type { + return point_function_table_global._ptable_tau2; + } + + static std::vector _parameter_defaults = { + }; + + + /** all mechanism instance variables and global variables */ + struct point_function_table_Instance { + double* v_unused{}; + const double* const* node_area{}; + point_function_table_Store* global{&point_function_table_global}; + }; + + + struct point_function_table_NodeData { + int const * nodeindices; + double const * node_voltages; + double * node_diagonal; + double * node_rhs; + int nodecount; + }; + + + static point_function_table_Instance make_instance_point_function_table(_nrn_mechanism_cache_range& _lmc) { + return point_function_table_Instance { + _lmc.template fpfield_ptr<0>(), + _lmc.template dptr_field_ptr<0>() + }; + } + + + static point_function_table_NodeData make_node_data_point_function_table(NrnThread& nt, Memb_list& _ml_arg) { + return point_function_table_NodeData { + _ml_arg.nodeindices, + nt.node_voltage_storage(), + nt.node_d_storage(), + nt.node_rhs_storage(), + _ml_arg.nodecount + }; + } + static point_function_table_NodeData make_node_data_point_function_table(Prop * _prop) { + static std::vector node_index{0}; + Node* _node = _nrn_mechanism_access_node(_prop); + return point_function_table_NodeData { + node_index.data(), + &_nrn_mechanism_access_voltage(_node), + &_nrn_mechanism_access_d(_node), + &_nrn_mechanism_access_rhs(_node), + 1 + }; + } + + void nrn_destructor_point_function_table(Prop* prop); + + + static void nrn_alloc_point_function_table(Prop* _prop) { + Datum *_ppvar = nullptr; + if (nrn_point_prop_) { + _nrn_mechanism_access_alloc_seq(_prop) = _nrn_mechanism_access_alloc_seq(nrn_point_prop_); + _ppvar = _nrn_mechanism_access_dparam(nrn_point_prop_); + } else { + _ppvar = nrn_prop_datum_alloc(mech_type, 2, _prop); + _nrn_mechanism_access_dparam(_prop) = _ppvar; + _nrn_mechanism_cache_instance _lmc{_prop}; + size_t const _iml = 0; + assert(_nrn_mechanism_get_num_vars(_prop) == 1); + /*initialize range parameters*/ + } + _nrn_mechanism_access_dparam(_prop) = _ppvar; + if(!nrn_point_prop_) { + } + } + + + /* Mechanism procedures and functions */ + inline double use_tau2_point_function_table(_nrn_mechanism_cache_range& _lmc, point_function_table_Instance& inst, point_function_table_NodeData& node_data, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* nt, double _lv, double _lx); + double cnst1_point_function_table(double v); + double table_cnst1_point_function_table(); + double cnst2_point_function_table(double v, double x); + double table_cnst2_point_function_table(); + double tau1_point_function_table(double v); + double table_tau1_point_function_table(); + double tau2_point_function_table(double v, double x); + double table_tau2_point_function_table(); + static void _apply_diffusion_function(ldifusfunc2_t _f, const _nrn_model_sorted_token& _sorted_token, NrnThread& _nt) { + } + + /* Point Process specific functions */ + static void* _hoc_create_pnt(Object* _ho) { + return create_point_process(_pointtype, _ho); + } + static void _hoc_destroy_pnt(void* _vptr) { + destroy_point_process(_vptr); + } + static double _hoc_loc_pnt(void* _vptr) { + return loc_point_process(_pointtype, _vptr); + } + static double _hoc_has_loc(void* _vptr) { + return has_loc_point(_vptr); + } + static double _hoc_get_loc_pnt(void* _vptr) { + return (get_loc_point_process(_vptr)); + } + /* Neuron setdata functions */ + extern void _nrn_setdata_reg(int, void(*)(Prop*)); + static void _setdata(Prop* _prop) { + } + static void _hoc_setdata(void* _vptr) { + Prop* _prop; + _prop = ((Point_process*)_vptr)->prop; + _setdata(_prop); + } + + + /** connect global (scalar) variables to hoc -- */ + static DoubScal hoc_scalar_double[] = { + {nullptr, nullptr} + }; + + + /** connect global (array) variables to hoc -- */ + static DoubVec hoc_vector_double[] = { + {nullptr, nullptr, 0} + }; + + + /* declaration of user functions */ + static double _hoc_use_tau2(void * _vptr); + static double _hoc_cnst1(void * _vptr); + static double _hoc_cnst2(void * _vptr); + static double _hoc_tau1(void * _vptr); + static double _hoc_tau2(void * _vptr); + static double _hoc_table_cnst1(void * _vptr); + static double _hoc_table_cnst2(void * _vptr); + static double _hoc_table_tau1(void * _vptr); + static double _hoc_table_tau2(void * _vptr); + + + /* connect user functions to hoc names */ + static VoidFunc hoc_intfunc[] = { + {0, 0} + }; + static Member_func _member_func[] = { + {"loc", _hoc_loc_pnt}, + {"has_loc", _hoc_has_loc}, + {"get_loc", _hoc_get_loc_pnt}, + {"use_tau2", _hoc_use_tau2}, + {"cnst1", _hoc_cnst1}, + {"cnst2", _hoc_cnst2}, + {"tau1", _hoc_tau1}, + {"tau2", _hoc_tau2}, + {"table_cnst1", _hoc_table_cnst1}, + {"table_cnst2", _hoc_table_cnst2}, + {"table_tau1", _hoc_table_tau1}, + {"table_tau2", _hoc_table_tau2}, + {nullptr, nullptr} + }; + static double _hoc_use_tau2(void * _vptr) { + double _r{}; + Datum* _ppvar; + Datum* _thread; + NrnThread* nt; + auto* const _pnt = static_cast(_vptr); + auto* const _p = _pnt->prop; + if (!_p) { + hoc_execerror("POINT_PROCESS data instance not valid", nullptr); + } + _nrn_mechanism_cache_instance _lmc{_p}; + size_t const id{}; + _ppvar = _nrn_mechanism_access_dparam(_p); + _thread = _extcall_thread.data(); + nt = static_cast(_pnt->_vnt); + auto inst = make_instance_point_function_table(_lmc); + auto node_data = make_node_data_point_function_table(_p); + _r = use_tau2_point_function_table(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1), *getarg(2)); + return(_r); + } + static double _hoc_cnst1(void * _vptr) { + double _ret = cnst1_point_function_table(*getarg(1)); + return _ret; + } + static double _hoc_table_cnst1(void * _vptr) { + double _ret = table_cnst1_point_function_table(); + return _ret; + } + static double _npy_cnst1(Prop* _prop) { + return cnst1_point_function_table(*getarg(1)); + } + static double _npy_table_cnst1(Prop* _prop) { + return table_cnst1_point_function_table(); + } + static double _hoc_cnst2(void * _vptr) { + double _ret = cnst2_point_function_table(*getarg(1), *getarg(2)); + return _ret; + } + static double _hoc_table_cnst2(void * _vptr) { + double _ret = table_cnst2_point_function_table(); + return _ret; + } + static double _npy_cnst2(Prop* _prop) { + return cnst2_point_function_table(*getarg(1), *getarg(2)); + } + static double _npy_table_cnst2(Prop* _prop) { + return table_cnst2_point_function_table(); + } + static double _hoc_tau1(void * _vptr) { + double _ret = tau1_point_function_table(*getarg(1)); + return _ret; + } + static double _hoc_table_tau1(void * _vptr) { + double _ret = table_tau1_point_function_table(); + return _ret; + } + static double _npy_tau1(Prop* _prop) { + return tau1_point_function_table(*getarg(1)); + } + static double _npy_table_tau1(Prop* _prop) { + return table_tau1_point_function_table(); + } + static double _hoc_tau2(void * _vptr) { + double _ret = tau2_point_function_table(*getarg(1), *getarg(2)); + return _ret; + } + static double _hoc_table_tau2(void * _vptr) { + double _ret = table_tau2_point_function_table(); + return _ret; + } + static double _npy_tau2(Prop* _prop) { + return tau2_point_function_table(*getarg(1), *getarg(2)); + } + static double _npy_table_tau2(Prop* _prop) { + return table_tau2_point_function_table(); + } + + + inline double use_tau2_point_function_table(_nrn_mechanism_cache_range& _lmc, point_function_table_Instance& inst, point_function_table_NodeData& node_data, size_t id, Datum* _ppvar, Datum* _thread, NrnThread* nt, double _lv, double _lx) { + double ret_use_tau2 = 0.0; + auto v = node_data.node_voltages[node_data.nodeindices[id]]; + printf("0: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_point_function_table(_lv, _lx)); + printf("1: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_point_function_table(_lv, _lx)); + printf("2: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_point_function_table(_lv, _lx)); + printf("3: use_tau2 v = %e, x = %e, tau2(v, x) = %e\n", _lv, _lx, tau2_point_function_table(_lv, _lx)); + ret_use_tau2 = tau2_point_function_table(_lv, _lx); + return ret_use_tau2; + } + double cnst1_point_function_table(double v) { + double _arg[1]; + _arg[0] = v; + return hoc_func_table(point_function_table_global._ptable_cnst1, 1, _arg); + } + double table_cnst1_point_function_table() { + hoc_spec_table(&point_function_table_global._ptable_cnst1, 1); + return 0.; + } + double cnst2_point_function_table(double v, double x) { + double _arg[2]; + _arg[0] = v; + _arg[1] = x; + return hoc_func_table(point_function_table_global._ptable_cnst2, 2, _arg); + } + double table_cnst2_point_function_table() { + hoc_spec_table(&point_function_table_global._ptable_cnst2, 2); + return 0.; + } + double tau1_point_function_table(double v) { + double _arg[1]; + _arg[0] = v; + return hoc_func_table(point_function_table_global._ptable_tau1, 1, _arg); + } + double table_tau1_point_function_table() { + hoc_spec_table(&point_function_table_global._ptable_tau1, 1); + return 0.; + } + double tau2_point_function_table(double v, double x) { + double _arg[2]; + _arg[0] = v; + _arg[1] = x; + return hoc_func_table(point_function_table_global._ptable_tau2, 2, _arg); + } + double table_tau2_point_function_table() { + hoc_spec_table(&point_function_table_global._ptable_tau2, 2); + return 0.; + } + + + void nrn_init_point_function_table(const _nrn_model_sorted_token& _sorted_token, NrnThread* nt, Memb_list* _ml_arg, int _type) { + _nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _ml_arg->type()}; + auto inst = make_instance_point_function_table(_lmc); + auto node_data = make_node_data_point_function_table(*nt, *_ml_arg); + auto* _thread = _ml_arg->_thread; + auto nodecount = _ml_arg->nodecount; + for (int id = 0; id < nodecount; id++) { + auto* _ppvar = _ml_arg->pdata[id]; + int node_id = node_data.nodeindices[id]; + auto v = node_data.node_voltages[node_id]; + } + } + + + static void nrn_jacob_point_function_table(const _nrn_model_sorted_token& _sorted_token, NrnThread* nt, Memb_list* _ml_arg, int _type) { + _nrn_mechanism_cache_range _lmc{_sorted_token, *nt, *_ml_arg, _ml_arg->type()}; + auto inst = make_instance_point_function_table(_lmc); + auto node_data = make_node_data_point_function_table(*nt, *_ml_arg); + auto* _thread = _ml_arg->_thread; + auto nodecount = _ml_arg->nodecount; + for (int id = 0; id < nodecount; id++) { + } + } + void nrn_destructor_point_function_table(Prop* prop) { + Datum* _ppvar = _nrn_mechanism_access_dparam(prop); + _nrn_mechanism_cache_instance _lmc{prop}; + const size_t id = 0; + auto inst = make_instance_point_function_table(_lmc); + auto node_data = make_node_data_point_function_table(prop); + + } + + + static void _initlists() { + } + + + /** register channel with the simulator */ + extern "C" void _point_function_table_reg() { + _initlists(); + + _pointtype = point_register_mech(mechanism_info, nrn_alloc_point_function_table, nullptr, nullptr, nullptr, nrn_init_point_function_table, -1, 1, _hoc_create_pnt, _hoc_destroy_pnt, _member_func); + + mech_type = nrn_get_mechtype(mechanism_info[1]); + hoc_register_parm_default(mech_type, &_parameter_defaults); + _nrn_mechanism_register_data_fields(mech_type, + _nrn_mechanism_field{"v_unused"} /* 0 */, + _nrn_mechanism_field{"node_area", "area"} /* 0 */, + _nrn_mechanism_field{"point_process", "pntproc"} /* 1 */ + ); + + hoc_register_prop_size(mech_type, 1, 2); + hoc_register_dparam_semantics(mech_type, 0, "area"); + hoc_register_dparam_semantics(mech_type, 1, "pntproc"); + hoc_register_var(hoc_scalar_double, hoc_vector_double, hoc_intfunc); + } +} diff --git a/global/neuron/non_threadsafe.cpp b/global/neuron/non_threadsafe.cpp index 21d2516d..246de421 100644 --- a/global/neuron/non_threadsafe.cpp +++ b/global/neuron/non_threadsafe.cpp @@ -197,12 +197,12 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_get_gbl(void); - static double _npy_get_gbl(Prop*); - static void _hoc_get_top_local(void); - static double _npy_get_top_local(Prop*); - static void _hoc_get_parameter(void); - static double _npy_get_parameter(Prop*); + static void _hoc_get_gbl(); + static double _npy_get_gbl(Prop* _prop); + static void _hoc_get_top_local(); + static double _npy_get_top_local(Prop* _prop); + static void _hoc_get_parameter(); + static double _npy_get_parameter(Prop* _prop); /* connect user functions to hoc names */ @@ -219,7 +219,7 @@ namespace neuron { {"get_parameter", _npy_get_parameter}, {nullptr, nullptr} }; - static void _hoc_get_gbl(void) { + static void _hoc_get_gbl() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -250,7 +250,7 @@ namespace neuron { _r = get_gbl_non_threadsafe(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static void _hoc_get_top_local(void) { + static void _hoc_get_top_local() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -281,7 +281,7 @@ namespace neuron { _r = get_top_local_non_threadsafe(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static void _hoc_get_parameter(void) { + static void _hoc_get_parameter() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/global/neuron/thread_variable.cpp b/global/neuron/thread_variable.cpp index 6437c434..7bb80c6b 100644 --- a/global/neuron/thread_variable.cpp +++ b/global/neuron/thread_variable.cpp @@ -254,12 +254,12 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_sum_arr(void); - static double _npy_sum_arr(Prop*); - static void _hoc_set_g_w(void); - static double _npy_set_g_w(Prop*); - static void _hoc_compute_g_v1(void); - static double _npy_compute_g_v1(Prop*); + static void _hoc_sum_arr(); + static double _npy_sum_arr(Prop* _prop); + static void _hoc_set_g_w(); + static double _npy_set_g_w(Prop* _prop); + static void _hoc_compute_g_v1(); + static double _npy_compute_g_v1(Prop* _prop); /* connect user functions to hoc names */ @@ -294,7 +294,7 @@ namespace neuron { delete[] _thread_data_ptr; } } - static void _hoc_set_g_w(void) { + static void _hoc_set_g_w() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -329,7 +329,7 @@ namespace neuron { set_g_w_shared_global(_lmc, inst, node_data, id, _ppvar, _thread, _thread_vars, nt, *getarg(1)); return(_r); } - static void _hoc_compute_g_v1(void) { + static void _hoc_compute_g_v1() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -366,7 +366,7 @@ namespace neuron { compute_g_v1_shared_global(_lmc, inst, node_data, id, _ppvar, _thread, _thread_vars, nt, *getarg(1)); return(_r); } - static void _hoc_sum_arr(void) { + static void _hoc_sum_arr() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/hodgkin_huxley/neuron/hodhux.cpp b/hodgkin_huxley/neuron/hodhux.cpp index b35363b2..dae79048 100644 --- a/hodgkin_huxley/neuron/hodhux.cpp +++ b/hodgkin_huxley/neuron/hodhux.cpp @@ -286,12 +286,12 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_vtrap(void); - static double _npy_vtrap(Prop*); - static void _hoc_states(void); - static double _npy_states(Prop*); - static void _hoc_rates(void); - static double _npy_rates(Prop*); + static void _hoc_vtrap(); + static double _npy_vtrap(Prop* _prop); + static void _hoc_states(); + static double _npy_states(Prop* _prop); + static void _hoc_rates(); + static double _npy_rates(Prop* _prop); /* connect user functions to hoc names */ @@ -308,7 +308,7 @@ namespace neuron { {"vtrap", _npy_vtrap}, {nullptr, nullptr} }; - static void _hoc_states(void) { + static void _hoc_states() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -344,7 +344,7 @@ namespace neuron { states_hodhux(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static void _hoc_rates(void) { + static void _hoc_rates() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -380,7 +380,7 @@ namespace neuron { rates_hodhux(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_vtrap(void) { + static void _hoc_vtrap() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/kinetic/neuron/X2Y.cpp b/kinetic/neuron/X2Y.cpp index 9adbd8f1..06ba0991 100644 --- a/kinetic/neuron/X2Y.cpp +++ b/kinetic/neuron/X2Y.cpp @@ -633,8 +633,8 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_rates(void); - static double _npy_rates(Prop*); + static void _hoc_rates(); + static double _npy_rates(Prop* _prop); /* connect user functions to hoc names */ @@ -647,7 +647,7 @@ namespace neuron { {"rates", _npy_rates}, {nullptr, nullptr} }; - static void _hoc_rates(void) { + static void _hoc_rates() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/longitudinal_diffusion/neuron/heat_eqn_function.cpp b/longitudinal_diffusion/neuron/heat_eqn_function.cpp index 09fc3d6d..8ff3c644 100644 --- a/longitudinal_diffusion/neuron/heat_eqn_function.cpp +++ b/longitudinal_diffusion/neuron/heat_eqn_function.cpp @@ -658,12 +658,12 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_factor(void); - static double _npy_factor(Prop*); - static void _hoc_vol(void); - static double _npy_vol(Prop*); - static void _hoc_mu(void); - static double _npy_mu(Prop*); + static void _hoc_factor(); + static double _npy_factor(Prop* _prop); + static void _hoc_vol(); + static double _npy_vol(Prop* _prop); + static void _hoc_mu(); + static double _npy_mu(Prop* _prop); /* connect user functions to hoc names */ @@ -698,7 +698,7 @@ namespace neuron { delete[] _thread_data_ptr; } } - static void _hoc_factor(void) { + static void _hoc_factor() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -731,7 +731,7 @@ namespace neuron { _r = factor_heat_eqn_function(_lmc, inst, node_data, id, _ppvar, _thread, _thread_vars, nt, *getarg(1)); return(_r); } - static void _hoc_vol(void) { + static void _hoc_vol() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -764,7 +764,7 @@ namespace neuron { _r = vol_heat_eqn_function(_lmc, inst, node_data, id, _ppvar, _thread, _thread_vars, nt, *getarg(1)); return(_r); } - static void _hoc_mu(void) { + static void _hoc_mu() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/morphology/neuron/two_radii.cpp b/morphology/neuron/two_radii.cpp index dea0a83b..f000d919 100644 --- a/morphology/neuron/two_radii.cpp +++ b/morphology/neuron/two_radii.cpp @@ -193,10 +193,10 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_square_diam(void); - static double _npy_square_diam(Prop*); - static void _hoc_square_area(void); - static double _npy_square_area(Prop*); + static void _hoc_square_diam(); + static double _npy_square_diam(Prop* _prop); + static void _hoc_square_area(); + static double _npy_square_area(Prop* _prop); /* connect user functions to hoc names */ @@ -211,7 +211,7 @@ namespace neuron { {"square_area", _npy_square_area}, {nullptr, nullptr} }; - static void _hoc_square_diam(void) { + static void _hoc_square_diam() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -242,7 +242,7 @@ namespace neuron { _r = square_diam_two_radii(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static void _hoc_square_area(void) { + static void _hoc_square_area() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/net_receive/neuron/NetReceiveCalls.cpp b/net_receive/neuron/NetReceiveCalls.cpp index 36a7dd24..c13e7bbe 100644 --- a/net_receive/neuron/NetReceiveCalls.cpp +++ b/net_receive/neuron/NetReceiveCalls.cpp @@ -206,8 +206,8 @@ namespace neuron { /* declaration of user functions */ - static double _hoc_one(void*); - static double _hoc_increment_c2(void*); + static double _hoc_one(void * _vptr); + static double _hoc_increment_c2(void * _vptr); /* connect user functions to hoc names */ @@ -222,7 +222,7 @@ namespace neuron { {"one", _hoc_one}, {nullptr, nullptr} }; - static double _hoc_increment_c2(void* _vptr) { + static double _hoc_increment_c2(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; @@ -243,7 +243,7 @@ namespace neuron { increment_c2_NetReceiveCalls(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static double _hoc_one(void* _vptr) { + static double _hoc_one(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/nonlinear/neuron/nonlin.cpp b/nonlinear/neuron/nonlin.cpp index cd4661a8..0ec5c864 100644 --- a/nonlinear/neuron/nonlin.cpp +++ b/nonlinear/neuron/nonlin.cpp @@ -597,10 +597,10 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_solve(void); - static double _npy_solve(Prop*); - static void _hoc_residual(void); - static double _npy_residual(Prop*); + static void _hoc_solve(); + static double _npy_solve(Prop* _prop); + static void _hoc_residual(); + static double _npy_residual(Prop* _prop); /* connect user functions to hoc names */ @@ -615,7 +615,7 @@ namespace neuron { {"residual", _npy_residual}, {nullptr, nullptr} }; - static void _hoc_solve(void) { + static void _hoc_solve() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -646,7 +646,7 @@ namespace neuron { _r = solve_nonlin(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static void _hoc_residual(void) { + static void _hoc_residual() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/pointer/neuron/basic_pointer.cpp b/pointer/neuron/basic_pointer.cpp index e3317b24..fb7c41eb 100644 --- a/pointer/neuron/basic_pointer.cpp +++ b/pointer/neuron/basic_pointer.cpp @@ -201,10 +201,10 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_read_p1(void); - static double _npy_read_p1(Prop*); - static void _hoc_read_p2(void); - static double _npy_read_p2(Prop*); + static void _hoc_read_p1(); + static double _npy_read_p1(Prop* _prop); + static void _hoc_read_p2(); + static double _npy_read_p2(Prop* _prop); /* connect user functions to hoc names */ @@ -219,7 +219,7 @@ namespace neuron { {"read_p2", _npy_read_p2}, {nullptr, nullptr} }; - static void _hoc_read_p1(void) { + static void _hoc_read_p1() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -253,7 +253,7 @@ namespace neuron { _r = read_p1_basic_pointer(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static void _hoc_read_p2(void) { + static void _hoc_read_p2() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/pointer/neuron/point_basic.cpp b/pointer/neuron/point_basic.cpp index 71bfeee5..00ef40d5 100644 --- a/pointer/neuron/point_basic.cpp +++ b/pointer/neuron/point_basic.cpp @@ -222,8 +222,8 @@ namespace neuron { /* declaration of user functions */ - static double _hoc_read_p1(void*); - static double _hoc_read_p2(void*); + static double _hoc_read_p1(void * _vptr); + static double _hoc_read_p2(void * _vptr); /* connect user functions to hoc names */ @@ -238,7 +238,7 @@ namespace neuron { {"read_p2", _hoc_read_p2}, {nullptr, nullptr} }; - static double _hoc_read_p1(void* _vptr) { + static double _hoc_read_p1(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; @@ -258,7 +258,7 @@ namespace neuron { _r = read_p1_point_basic(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static double _hoc_read_p2(void* _vptr) { + static double _hoc_read_p2(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/pointer/neuron/pointing.cpp b/pointer/neuron/pointing.cpp index 407c7736..94cd8426 100644 --- a/pointer/neuron/pointing.cpp +++ b/pointer/neuron/pointing.cpp @@ -179,8 +179,8 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_is_valid(void); - static double _npy_is_valid(Prop*); + static void _hoc_is_valid(); + static double _npy_is_valid(Prop* _prop); /* connect user functions to hoc names */ @@ -193,7 +193,7 @@ namespace neuron { {"is_valid", _npy_is_valid}, {nullptr, nullptr} }; - static void _hoc_is_valid(void) { + static void _hoc_is_valid() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/procedure/neuron/point_procedures.cpp b/procedure/neuron/point_procedures.cpp index ff60f334..5286a2cb 100644 --- a/procedure/neuron/point_procedures.cpp +++ b/procedure/neuron/point_procedures.cpp @@ -206,13 +206,13 @@ namespace neuron { /* declaration of user functions */ - static double _hoc_identity(void*); - static double _hoc_set_x_42(void*); - static double _hoc_set_x_a(void*); - static double _hoc_set_a_x(void*); - static double _hoc_set_x_v(void*); - static double _hoc_set_x_just_v(void*); - static double _hoc_set_x_just_vv(void*); + static double _hoc_identity(void * _vptr); + static double _hoc_set_x_42(void * _vptr); + static double _hoc_set_x_a(void * _vptr); + static double _hoc_set_a_x(void * _vptr); + static double _hoc_set_x_v(void * _vptr); + static double _hoc_set_x_just_v(void * _vptr); + static double _hoc_set_x_just_vv(void * _vptr); /* connect user functions to hoc names */ @@ -232,7 +232,7 @@ namespace neuron { {"identity", _hoc_identity}, {nullptr, nullptr} }; - static double _hoc_set_x_42(void* _vptr) { + static double _hoc_set_x_42(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; @@ -253,7 +253,7 @@ namespace neuron { set_x_42_point_procedures(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static double _hoc_set_x_a(void* _vptr) { + static double _hoc_set_x_a(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; @@ -274,7 +274,7 @@ namespace neuron { set_x_a_point_procedures(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static double _hoc_set_a_x(void* _vptr) { + static double _hoc_set_a_x(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; @@ -295,7 +295,7 @@ namespace neuron { set_a_x_point_procedures(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static double _hoc_set_x_v(void* _vptr) { + static double _hoc_set_x_v(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; @@ -316,7 +316,7 @@ namespace neuron { set_x_v_point_procedures(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static double _hoc_set_x_just_v(void* _vptr) { + static double _hoc_set_x_just_v(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; @@ -337,7 +337,7 @@ namespace neuron { set_x_just_v_point_procedures(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static double _hoc_set_x_just_vv(void* _vptr) { + static double _hoc_set_x_just_vv(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; @@ -358,7 +358,7 @@ namespace neuron { set_x_just_vv_point_procedures(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static double _hoc_identity(void* _vptr) { + static double _hoc_identity(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/procedure/neuron/procedures.cpp b/procedure/neuron/procedures.cpp index 48da1e24..6b8a7ccc 100644 --- a/procedure/neuron/procedures.cpp +++ b/procedure/neuron/procedures.cpp @@ -182,20 +182,20 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_identity(void); - static double _npy_identity(Prop*); - static void _hoc_set_x_42(void); - static double _npy_set_x_42(Prop*); - static void _hoc_set_x_a(void); - static double _npy_set_x_a(Prop*); - static void _hoc_set_a_x(void); - static double _npy_set_a_x(Prop*); - static void _hoc_set_x_v(void); - static double _npy_set_x_v(Prop*); - static void _hoc_set_x_just_v(void); - static double _npy_set_x_just_v(Prop*); - static void _hoc_set_x_just_vv(void); - static double _npy_set_x_just_vv(Prop*); + static void _hoc_identity(); + static double _npy_identity(Prop* _prop); + static void _hoc_set_x_42(); + static double _npy_set_x_42(Prop* _prop); + static void _hoc_set_x_a(); + static double _npy_set_x_a(Prop* _prop); + static void _hoc_set_a_x(); + static double _npy_set_a_x(Prop* _prop); + static void _hoc_set_x_v(); + static double _npy_set_x_v(Prop* _prop); + static void _hoc_set_x_just_v(); + static double _npy_set_x_just_v(Prop* _prop); + static void _hoc_set_x_just_vv(); + static double _npy_set_x_just_vv(Prop* _prop); /* connect user functions to hoc names */ @@ -220,7 +220,7 @@ namespace neuron { {"identity", _npy_identity}, {nullptr, nullptr} }; - static void _hoc_set_x_42(void) { + static void _hoc_set_x_42() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -256,7 +256,7 @@ namespace neuron { set_x_42_procedures(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static void _hoc_set_x_a(void) { + static void _hoc_set_x_a() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -292,7 +292,7 @@ namespace neuron { set_x_a_procedures(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_set_a_x(void) { + static void _hoc_set_a_x() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -328,7 +328,7 @@ namespace neuron { set_a_x_procedures(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static void _hoc_set_x_v(void) { + static void _hoc_set_x_v() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -364,7 +364,7 @@ namespace neuron { set_x_v_procedures(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static void _hoc_set_x_just_v(void) { + static void _hoc_set_x_just_v() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -400,7 +400,7 @@ namespace neuron { set_x_just_v_procedures(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static void _hoc_set_x_just_vv(void) { + static void _hoc_set_x_just_vv() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -436,7 +436,7 @@ namespace neuron { set_x_just_vv_procedures(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_identity(void) { + static void _hoc_identity() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/random/neuron/random_variable.cpp b/random/neuron/random_variable.cpp index a4e36fc8..959c3700 100644 --- a/random/neuron/random_variable.cpp +++ b/random/neuron/random_variable.cpp @@ -179,8 +179,8 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_negexp(void); - static double _npy_negexp(Prop*); + static void _hoc_negexp(); + static double _npy_negexp(Prop* _prop); /* connect user functions to hoc names */ @@ -193,7 +193,7 @@ namespace neuron { {"negexp", _npy_negexp}, {nullptr, nullptr} }; - static void _hoc_negexp(void) { + static void _hoc_negexp() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/solve/neuron/finite_difference.cpp b/solve/neuron/finite_difference.cpp index 29a1002a..362d1528 100644 --- a/solve/neuron/finite_difference.cpp +++ b/solve/neuron/finite_difference.cpp @@ -630,8 +630,8 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_f(void); - static double _npy_f(Prop*); + static void _hoc_f(); + static double _npy_f(Prop* _prop); /* connect user functions to hoc names */ @@ -662,7 +662,7 @@ namespace neuron { delete[] _thread_data_ptr; } } - static void _hoc_f(void) { + static void _hoc_f() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/spike_travel/neuron/hodhux.cpp b/spike_travel/neuron/hodhux.cpp index b35363b2..dae79048 100644 --- a/spike_travel/neuron/hodhux.cpp +++ b/spike_travel/neuron/hodhux.cpp @@ -286,12 +286,12 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_vtrap(void); - static double _npy_vtrap(Prop*); - static void _hoc_states(void); - static double _npy_states(Prop*); - static void _hoc_rates(void); - static double _npy_rates(Prop*); + static void _hoc_vtrap(); + static double _npy_vtrap(Prop* _prop); + static void _hoc_states(); + static double _npy_states(Prop* _prop); + static void _hoc_rates(); + static double _npy_rates(Prop* _prop); /* connect user functions to hoc names */ @@ -308,7 +308,7 @@ namespace neuron { {"vtrap", _npy_vtrap}, {nullptr, nullptr} }; - static void _hoc_states(void) { + static void _hoc_states() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -344,7 +344,7 @@ namespace neuron { states_hodhux(_lmc, inst, node_data, id, _ppvar, _thread, nt); return(_r); } - static void _hoc_rates(void) { + static void _hoc_rates() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -380,7 +380,7 @@ namespace neuron { rates_hodhux(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_vtrap(void) { + static void _hoc_vtrap() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/table/neuron/table.cpp b/table/neuron/table.cpp index 7ff9238f..ac072e63 100644 --- a/table/neuron/table.cpp +++ b/table/neuron/table.cpp @@ -270,12 +270,12 @@ namespace neuron { /* declaration of user functions */ - static void _hoc_quadratic(void); - static double _npy_quadratic(Prop*); - static void _hoc_sigmoidal(void); - static double _npy_sigmoidal(Prop*); - static void _hoc_sinusoidal(void); - static double _npy_sinusoidal(Prop*); + static void _hoc_quadratic(); + static double _npy_quadratic(Prop* _prop); + static void _hoc_sigmoidal(); + static double _npy_sigmoidal(Prop* _prop); + static void _hoc_sinusoidal(); + static double _npy_sinusoidal(Prop* _prop); /* connect user functions to hoc names */ @@ -292,7 +292,7 @@ namespace neuron { {"quadratic", _npy_quadratic}, {nullptr, nullptr} }; - static void _hoc_sigmoidal(void) { + static void _hoc_sigmoidal() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -327,7 +327,7 @@ namespace neuron { sigmoidal_tbl(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_sinusoidal(void) { + static void _hoc_sinusoidal() { double _r{}; Datum* _ppvar; Datum* _thread; @@ -365,7 +365,7 @@ namespace neuron { sinusoidal_tbl(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static void _hoc_quadratic(void) { + static void _hoc_quadratic() { double _r{}; Datum* _ppvar; Datum* _thread; diff --git a/table/neuron/table_point_process.cpp b/table/neuron/table_point_process.cpp index 7d41c8fa..9310a971 100644 --- a/table/neuron/table_point_process.cpp +++ b/table/neuron/table_point_process.cpp @@ -294,9 +294,9 @@ namespace neuron { /* declaration of user functions */ - static double _hoc_quadratic(void*); - static double _hoc_sigmoidal(void*); - static double _hoc_sinusoidal(void*); + static double _hoc_quadratic(void * _vptr); + static double _hoc_sigmoidal(void * _vptr); + static double _hoc_sinusoidal(void * _vptr); /* connect user functions to hoc names */ @@ -312,7 +312,7 @@ namespace neuron { {"quadratic", _hoc_quadratic}, {nullptr, nullptr} }; - static double _hoc_sigmoidal(void* _vptr) { + static double _hoc_sigmoidal(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; @@ -334,7 +334,7 @@ namespace neuron { sigmoidal_tbl_point_process(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static double _hoc_sinusoidal(void* _vptr) { + static double _hoc_sinusoidal(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread; @@ -356,7 +356,7 @@ namespace neuron { sinusoidal_tbl_point_process(_lmc, inst, node_data, id, _ppvar, _thread, nt, *getarg(1)); return(_r); } - static double _hoc_quadratic(void* _vptr) { + static double _hoc_quadratic(void * _vptr) { double _r{}; Datum* _ppvar; Datum* _thread;