From 162a42d7c96c151d34e4e5061117440ea5c48b2c Mon Sep 17 00:00:00 2001 From: 1uc Date: Thu, 8 Feb 2024 10:08:01 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20BlueBrai?= =?UTF-8?q?n/nmodl@9cb6d978423141ae36bfd059d643c7fd39f4a1f9=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...degen_1_1_codegen_acc_visitor-members.html | 22 +- ...dl_1_1codegen_1_1_codegen_acc_visitor.html | 67 +- ...odegen_coreneuron_cpp_visitor-members.html | 22 +- ...en_1_1_codegen_coreneuron_cpp_visitor.html | 731 +- ...egen_1_1_codegen_coreneuron_cpp_visitor.js | 15 +- ...degen_1_1_codegen_cpp_visitor-members.html | 145 +- ...dl_1_1codegen_1_1_codegen_cpp_visitor.html | 596 +- ...modl_1_1codegen_1_1_codegen_cpp_visitor.js | 11 + ..._1_codegen_neuron_cpp_visitor-members.html | 167 +- ...odegen_1_1_codegen_neuron_cpp_visitor.html | 239 +- ...1codegen_1_1_codegen_neuron_cpp_visitor.js | 2 + .../codegen__acc__visitor_8cpp_source.html | 4 +- ..._coreneuron__cpp__visitor_8hpp_source.html | 2439 +++--- .../codegen__cpp__visitor_8cpp_source.html | 2152 ++--- .../codegen__cpp__visitor_8hpp_source.html | 1762 ++-- ...gen__neuron__cpp__visitor_8hpp_source.html | 1237 +-- html/doxygen/functions_b.html | 2 +- html/doxygen/functions_c.html | 16 +- html/doxygen/functions_func_b.html | 2 +- html/doxygen/functions_func_c.html | 20 +- html/doxygen/functions_func_i.html | 8 +- html/doxygen/functions_func_o.html | 4 +- html/doxygen/functions_func_p.html | 2 +- html/doxygen/functions_func_r.html | 2 +- html/doxygen/functions_func_u.html | 2 +- html/doxygen/functions_func_w.html | 2 +- html/doxygen/functions_i.html | 8 +- html/doxygen/functions_o.html | 4 +- html/doxygen/functions_p.html | 2 +- html/doxygen/functions_r.html | 2 +- html/doxygen/functions_u.html | 2 +- html/doxygen/functions_w.html | 2 +- html/doxygen/group__codegen__backends.html | 6 +- html/doxygen/group__codegen__backends.js | 28 +- html/doxygen/namespacenmodl_1_1codegen.html | 8 +- html/doxygen/navtreedata.js | 36 +- html/doxygen/navtreeindex15.js | 414 +- html/doxygen/navtreeindex16.js | 294 +- html/doxygen/navtreeindex17.js | 10 +- html/doxygen/navtreeindex18.js | 10 +- html/doxygen/navtreeindex19.js | 10 +- html/doxygen/navtreeindex20.js | 10 +- html/doxygen/navtreeindex21.js | 10 +- html/doxygen/navtreeindex22.js | 10 +- html/doxygen/navtreeindex23.js | 10 +- html/doxygen/navtreeindex24.js | 10 +- html/doxygen/navtreeindex25.js | 14 +- html/doxygen/navtreeindex26.js | 58 +- html/doxygen/navtreeindex27.js | 32 +- html/doxygen/navtreeindex28.js | 36 +- html/doxygen/navtreeindex29.js | 24 +- html/doxygen/navtreeindex30.js | 10 +- html/doxygen/navtreeindex31.js | 10 +- html/doxygen/navtreeindex32.js | 10 +- html/doxygen/navtreeindex33.js | 4 + html/doxygen/search/all_1.js | 2 +- html/doxygen/search/all_10.js | 2 +- html/doxygen/search/all_13.js | 2 +- html/doxygen/search/all_14.js | 2 +- html/doxygen/search/all_15.js | 2 +- html/doxygen/search/all_2.js | 2 +- html/doxygen/search/all_8.js | 8 +- html/doxygen/search/all_e.js | 2 +- html/doxygen/search/all_f.js | 2 +- html/doxygen/search/functions_1.js | 2 +- html/doxygen/search/functions_10.js | 2 +- html/doxygen/search/functions_13.js | 2 +- html/doxygen/search/functions_15.js | 2 +- html/doxygen/search/functions_2.js | 2 +- html/doxygen/search/functions_8.js | 8 +- html/doxygen/search/functions_e.js | 2 +- html/doxygen/search/functions_f.js | 2 +- ..._coreneuron__cpp__visitor_8cpp_source.html | 7309 ++++++++--------- ...gen__neuron__cpp__visitor_8cpp_source.html | 1817 ++-- html/doxygen/src_2main_8cpp_source.html | 2 +- html/doxygen/todo.html | 20 +- html/notebooks/nmodl-sympy-solver-cnexp.html | 19 +- 77 files changed, 10148 insertions(+), 9820 deletions(-) diff --git a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor-members.html b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor-members.html index cb7eed7bbe..715f23da80 100644 --- a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor-members.html +++ b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor-members.html @@ -99,7 +99,7 @@ - + @@ -112,7 +112,7 @@ - + @@ -143,10 +143,10 @@ - - - - + + + + @@ -171,7 +171,7 @@ - + @@ -295,12 +295,12 @@ - + - + @@ -308,7 +308,7 @@ - + @@ -432,7 +432,7 @@ - +
add_escape_quote(const std::string &text) constnmodl::codegen::CodegenCppVisitorinlineprotected
backend_name() const overridenmodl::codegen::CodegenAccVisitorprotectedvirtual
breakpoint_current(std::string current) constnmodl::codegen::CodegenCoreneuronCppVisitorprotected
breakpoint_current(std::string current) constnmodl::codegen::CodegenCppVisitorprotected
breakpoint_exist() const noexceptnmodl::codegen::CodegenCppVisitorprotected
check_if_var_is_array(const std::string &name)nmodl::codegen::CodegenCoreneuronCppVisitorprotected
codegen_float_variablesnmodl::codegen::CodegenCppVisitorprotected
CodegenCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenCppVisitorinlineprotected
CodegenCppVisitor(std::string mod_filename, std::ostream &stream, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenCppVisitorinlineprotected
compute_method_name(BlockType type) constnmodl::codegen::CodegenCppVisitorprotected
conc_write_statement(const std::string &ion_name, const std::string &concentration, int index)nmodl::codegen::CodegenCoreneuronCppVisitorprotected
conc_write_statement(const std::string &ion_name, const std::string &concentration, int index) overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
current_watch_statementnmodl::codegen::CodegenCppVisitorprotected
default_float_data_type() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
default_int_data_type() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
internal_method_arguments() overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
internal_method_call_encounterednmodl::codegen::CodegenCppVisitorprotected
internal_method_parameters() overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
ion_read_statements(BlockType type) constnmodl::codegen::CodegenCoreneuronCppVisitorprotected
ion_read_statements_optimized(BlockType type) constnmodl::codegen::CodegenCoreneuronCppVisitorprotected
ion_variable_struct_required() constnmodl::codegen::CodegenCoreneuronCppVisitorprotected
ion_write_statements(BlockType type)nmodl::codegen::CodegenCoreneuronCppVisitorprotected
ion_read_statements(BlockType type) constnmodl::codegen::CodegenCppVisitorprotected
ion_read_statements_optimized(BlockType type) constnmodl::codegen::CodegenCppVisitorprotected
ion_variable_struct_required() constnmodl::codegen::CodegenCppVisitorprotected
ion_write_statements(BlockType type)nmodl::codegen::CodegenCppVisitorprotected
is_constant_variable(const std::string &name) constnmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
is_functor_const(const ast::StatementBlock &variable_block, const ast::StatementBlock &functor_block)nmodl::codegen::CodegenCoreneuronCppVisitorprotected
is_net_event(const std::string &name) const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
num_thread_objects() const noexceptnmodl::codegen::CodegenCoreneuronCppVisitorinlineprotected
operator_for_d() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
operator_for_rhs() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
optimize_ion_variable_copies() constnmodl::codegen::CodegenCoreneuronCppVisitorprotected
optimize_ion_variable_copies() const overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
optimize_ionvar_copiesnmodl::codegen::CodegenCppVisitorprotected
ParamVector typedefnmodl::codegen::CodegenCppVisitorprotected
position_of_float_var(const std::string &name) const overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
printing_net_initnmodl::codegen::CodegenCppVisitorprotected
printing_net_receivenmodl::codegen::CodegenCppVisitorprotected
printing_top_verbatim_blocksnmodl::codegen::CodegenCppVisitorprotected
process_shadow_update_statement(const ShadowUseStatement &statement, BlockType type)nmodl::codegen::CodegenCoreneuronCppVisitorprotected
process_shadow_update_statement(const ShadowUseStatement &statement, BlockType type)nmodl::codegen::CodegenCppVisitorprotected
process_verbatim_text(std::string const &text) overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
process_verbatim_token(const std::string &token)nmodl::codegen::CodegenCoreneuronCppVisitorprotected
program_symtabnmodl::codegen::CodegenCppVisitorprotected
range_variable_setup_required() const noexceptnmodl::codegen::CodegenCppVisitorprotected
read_ion_variable_name(const std::string &name)nmodl::codegen::CodegenCoreneuronCppVisitorprotectedstatic
read_ion_variable_name(const std::string &name)nmodl::codegen::CodegenCppVisitorprotectedstatic
register_mechanism_arguments() const overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
rename_function_arguments()nmodl::codegen::CodegenCppVisitorprotected
replace_if_verbatim_variable(std::string name)nmodl::codegen::CodegenCoreneuronCppVisitorprotected
simulator_name() overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
statement_to_skip(const ast::Statement &node)nmodl::codegen::CodegenCppVisitorprotectedstatic
SymbolType typedefnmodl::codegen::CodegenCppVisitorprotected
update_if_ion_variable_name(const std::string &name) constnmodl::codegen::CodegenCoreneuronCppVisitorprotected
update_if_ion_variable_name(const std::string &name) constnmodl::codegen::CodegenCppVisitorprotected
update_index_semantics()nmodl::codegen::CodegenCppVisitorprotected
visit_after_block(const ast::AfterBlock &node) overridenmodl::visitor::ConstAstVisitorvirtual
visit_argument(const ast::Argument &node) overridenmodl::visitor::ConstAstVisitorvirtual
visit_while_statement(const ast::WhileStatement &node) overridenmodl::codegen::CodegenCppVisitorprotectedvirtual
visit_wrapped_expression(const ast::WrappedExpression &node) overridenmodl::visitor::ConstAstVisitorvirtual
visit_write_ion_var(const ast::WriteIonVar &node) overridenmodl::visitor::ConstAstVisitorvirtual
write_ion_variable_name(const std::string &name)nmodl::codegen::CodegenCoreneuronCppVisitorprotectedstatic
write_ion_variable_name(const std::string &name)nmodl::codegen::CodegenCppVisitorprotectedstatic
~ConstVisitor()=defaultnmodl::visitor::ConstVisitorvirtual
diff --git a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor.html b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor.html index 2d7c73dad5..300dc32c7f 100644 --- a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor.html +++ b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_acc_visitor.html @@ -622,24 +622,9 @@ int position_of_int_var (const std::string &name) const override  Determine the position in the data array for a given int variable. More...
  -std::string breakpoint_current (std::string current) const - Determine the variable name for the "current" used in breakpoint block taking into account intermediate code transformations. More...
-  -std::vector< std::string > ion_read_statements (BlockType type) const - For a given output block type, return statements for all read ion variables. More...
-  -std::vector< std::string > ion_read_statements_optimized (BlockType type) const - For a given output block type, return minimal statements for all read ion variables. More...
-  -std::vector< ShadowUseStatemention_write_statements (BlockType type) - For a given output block type, return statements for writing back ion variables. More...
-  std::string process_verbatim_token (const std::string &token)  Process a token in a verbatim block for possible variable renaming. More...
  -bool ion_variable_struct_required () const - Check if a structure for ion variables is required. More...
-  virtual bool is_constant_variable (const std::string &name) const  Check if variable is qualified as constant. More...
  @@ -655,9 +640,9 @@ virtual void print_backend_namespace_stop ()  Prints the end of namespace for the backend-specific code. More...
  -bool optimize_ion_variable_copies () const - Check if ion variable copies should be avoided. More...
-  +bool optimize_ion_variable_copies () const override + Check if ion variable copies should be avoided. More...
+  void print_top_verbatim_blocks ()  Print top level (global scope) verbatim blocks. More...
  @@ -726,12 +711,9 @@ std::string register_mechanism_arguments () const override  Arguments for register_mech or point_register_mech function. More...
  -std::string conc_write_statement (const std::string &ion_name, const std::string &concentration, int index) - Generate Function call statement for nrn_wrote_conc. More...
-  -std::string process_shadow_update_statement (const ShadowUseStatement &statement, BlockType type) - Process shadow update statement. More...
-  +std::string conc_write_statement (const std::string &ion_name, const std::string &concentration, int index) override + Generate Function call statement for nrn_wrote_conc. More...
+  void print_first_pointer_var_index_getter ()  Print the getter method for index position of first pointer variable. More...
  @@ -759,9 +741,6 @@ void print_thread_getters ()  Print the getter method for thread variables and ids. More...
  -std::string update_if_ion_variable_name (const std::string &name) const - Determine the updated name if the ion variable has been optimized. More...
-  std::string float_variable_name (const SymbolType &symbol, bool use_instance) const override  Determine the name of a float variable given its symbol. More...
  @@ -985,6 +964,9 @@ std::string get_channel_info_var_name () const noexcept  Name of channel info variable. More...
  +bool ion_variable_struct_required () const + Check if a structure for ion variables is required. More...
+  template<typename T > bool has_parameter_of_name (const T &node, const std::string &name)  Check if function or procedure node has parameter with given name. More...
@@ -1046,6 +1028,21 @@ std::vector< IndexVariableInfoget_int_variables ()  Determine all int variables required during code generation. More...
  +std::vector< std::string > ion_read_statements (BlockType type) const + For a given output block type, return statements for all read ion variables. More...
+  +std::vector< std::string > ion_read_statements_optimized (BlockType type) const + For a given output block type, return minimal statements for all read ion variables. More...
+  +std::vector< ShadowUseStatemention_write_statements (BlockType type) + For a given output block type, return statements for writing back ion variables. More...
+  +std::string process_shadow_update_statement (const ShadowUseStatement &statement, BlockType type) + Process shadow update statement. More...
+  +std::string breakpoint_current (std::string current) const + Determine the variable name for the "current" used in breakpoint block taking into account intermediate code transformations. More...
+  virtual void print_global_var_struct_decl ()  Instantiate global var instance. More...
  @@ -1071,6 +1068,9 @@ SymbolType make_symbol (const std::string &name) const  Creates a temporary symbol. More...
  +std::string update_if_ion_variable_name (const std::string &name) const + Determine the updated name if the ion variable has been optimized. More...
+  virtual void print_global_var_struct_assertions () const  Print static assertions about the global variable struct. More...
  @@ -1182,13 +1182,6 @@ using ParamVector = std::vector< std::tuple< std::string, std::string, std::string, std::string > >  A vector of parameters represented by a 4-tuple of strings: More...
  -- Static Protected Member Functions inherited from nmodl::codegen::CodegenCoreneuronCppVisitor -static std::pair< std::string, std::string > read_ion_variable_name (const std::string &name) - Return ion variable name and corresponding ion read variable name. More...
-  -static std::pair< std::string, std::string > write_ion_variable_name (const std::string &name) - Return ion variable name and corresponding ion write variable name. More...
- Static Protected Member Functions inherited from nmodl::codegen::CodegenCppVisitor static bool need_semicolon (const ast::Statement &node)  Check if a semicolon is required at the end of given statement. More...
@@ -1199,6 +1192,12 @@ static bool statement_to_skip (const ast::Statement &node)  Check if given statement should be skipped during code generation. More...
  +static std::pair< std::string, std::string > read_ion_variable_name (const std::string &name) + Return ion variable name and corresponding ion read variable name. More...
+  +static std::pair< std::string, std::string > write_ion_variable_name (const std::string &name) + Return ion variable name and corresponding ion write variable name. More...
- Protected Attributes inherited from nmodl::codegen::CodegenCppVisitor std::unique_ptr< CodePrinterprinter  Code printer object for target (C++) More...
diff --git a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor-members.html b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor-members.html index 8db09fc528..5df3ab6d18 100644 --- a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor-members.html +++ b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor-members.html @@ -99,7 +99,7 @@ - + @@ -110,7 +110,7 @@ - + @@ -141,10 +141,10 @@ - - - - + + + + @@ -169,7 +169,7 @@ - + @@ -293,12 +293,12 @@ - + - + @@ -306,7 +306,7 @@ - + @@ -430,7 +430,7 @@ - +
add_escape_quote(const std::string &text) constnmodl::codegen::CodegenCppVisitorinlineprotected
backend_name() const overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
breakpoint_current(std::string current) constnmodl::codegen::CodegenCoreneuronCppVisitorprotected
breakpoint_current(std::string current) constnmodl::codegen::CodegenCppVisitorprotected
breakpoint_exist() const noexceptnmodl::codegen::CodegenCppVisitorprotected
check_if_var_is_array(const std::string &name)nmodl::codegen::CodegenCoreneuronCppVisitorprotected
codegen_float_variablesnmodl::codegen::CodegenCppVisitorprotected
CodegenCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenCppVisitorinlineprotected
CodegenCppVisitor(std::string mod_filename, std::ostream &stream, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenCppVisitorinlineprotected
compute_method_name(BlockType type) constnmodl::codegen::CodegenCppVisitorprotected
conc_write_statement(const std::string &ion_name, const std::string &concentration, int index)nmodl::codegen::CodegenCoreneuronCppVisitorprotected
conc_write_statement(const std::string &ion_name, const std::string &concentration, int index) overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
current_watch_statementnmodl::codegen::CodegenCppVisitorprotected
default_float_data_type() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
default_int_data_type() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
internal_method_arguments() overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
internal_method_call_encounterednmodl::codegen::CodegenCppVisitorprotected
internal_method_parameters() overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
ion_read_statements(BlockType type) constnmodl::codegen::CodegenCoreneuronCppVisitorprotected
ion_read_statements_optimized(BlockType type) constnmodl::codegen::CodegenCoreneuronCppVisitorprotected
ion_variable_struct_required() constnmodl::codegen::CodegenCoreneuronCppVisitorprotected
ion_write_statements(BlockType type)nmodl::codegen::CodegenCoreneuronCppVisitorprotected
ion_read_statements(BlockType type) constnmodl::codegen::CodegenCppVisitorprotected
ion_read_statements_optimized(BlockType type) constnmodl::codegen::CodegenCppVisitorprotected
ion_variable_struct_required() constnmodl::codegen::CodegenCppVisitorprotected
ion_write_statements(BlockType type)nmodl::codegen::CodegenCppVisitorprotected
is_constant_variable(const std::string &name) constnmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
is_functor_const(const ast::StatementBlock &variable_block, const ast::StatementBlock &functor_block)nmodl::codegen::CodegenCoreneuronCppVisitorprotected
is_net_event(const std::string &name) const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
num_thread_objects() const noexceptnmodl::codegen::CodegenCoreneuronCppVisitorinlineprotected
operator_for_d() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
operator_for_rhs() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
optimize_ion_variable_copies() constnmodl::codegen::CodegenCoreneuronCppVisitorprotected
optimize_ion_variable_copies() const overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
optimize_ionvar_copiesnmodl::codegen::CodegenCppVisitorprotected
ParamVector typedefnmodl::codegen::CodegenCppVisitorprotected
position_of_float_var(const std::string &name) const overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
printing_net_initnmodl::codegen::CodegenCppVisitorprotected
printing_net_receivenmodl::codegen::CodegenCppVisitorprotected
printing_top_verbatim_blocksnmodl::codegen::CodegenCppVisitorprotected
process_shadow_update_statement(const ShadowUseStatement &statement, BlockType type)nmodl::codegen::CodegenCoreneuronCppVisitorprotected
process_shadow_update_statement(const ShadowUseStatement &statement, BlockType type)nmodl::codegen::CodegenCppVisitorprotected
process_verbatim_text(std::string const &text) overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
process_verbatim_token(const std::string &token)nmodl::codegen::CodegenCoreneuronCppVisitorprotected
program_symtabnmodl::codegen::CodegenCppVisitorprotected
range_variable_setup_required() const noexceptnmodl::codegen::CodegenCppVisitorprotected
read_ion_variable_name(const std::string &name)nmodl::codegen::CodegenCoreneuronCppVisitorprotectedstatic
read_ion_variable_name(const std::string &name)nmodl::codegen::CodegenCppVisitorprotectedstatic
register_mechanism_arguments() const overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
rename_function_arguments()nmodl::codegen::CodegenCppVisitorprotected
replace_if_verbatim_variable(std::string name)nmodl::codegen::CodegenCoreneuronCppVisitorprotected
simulator_name() overridenmodl::codegen::CodegenCoreneuronCppVisitorprotectedvirtual
statement_to_skip(const ast::Statement &node)nmodl::codegen::CodegenCppVisitorprotectedstatic
SymbolType typedefnmodl::codegen::CodegenCppVisitorprotected
update_if_ion_variable_name(const std::string &name) constnmodl::codegen::CodegenCoreneuronCppVisitorprotected
update_if_ion_variable_name(const std::string &name) constnmodl::codegen::CodegenCppVisitorprotected
update_index_semantics()nmodl::codegen::CodegenCppVisitorprotected
visit_after_block(const ast::AfterBlock &node) overridenmodl::visitor::ConstAstVisitorvirtual
visit_argument(const ast::Argument &node) overridenmodl::visitor::ConstAstVisitorvirtual
visit_while_statement(const ast::WhileStatement &node) overridenmodl::codegen::CodegenCppVisitorprotectedvirtual
visit_wrapped_expression(const ast::WrappedExpression &node) overridenmodl::visitor::ConstAstVisitorvirtual
visit_write_ion_var(const ast::WriteIonVar &node) overridenmodl::visitor::ConstAstVisitorvirtual
write_ion_variable_name(const std::string &name)nmodl::codegen::CodegenCoreneuronCppVisitorprotectedstatic
write_ion_variable_name(const std::string &name)nmodl::codegen::CodegenCppVisitorprotectedstatic
~ConstVisitor()=defaultnmodl::visitor::ConstVisitorvirtual
diff --git a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html index 63b42b462b..5e07601426 100644 --- a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html +++ b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html @@ -93,7 +93,6 @@
Public Member Functions | Protected Member Functions | -Static Protected Member Functions | List of all members
nmodl::codegen::CodegenCoreneuronCppVisitor Class Reference
@@ -104,7 +103,7 @@ More...

Detailed Description

Visitor for printing C++ code compatible with legacy api of CoreNEURON

-
Todo:
- -

Determine the variable name for the "current" used in breakpoint block taking into account intermediate code transformations.

-
Parameters
- - -
currentThe variable name for the current used in the model
-
-
-
Returns
The name for the current to be printed in C++
-

Current variable used in breakpoint block could be local variable. In this case, neuron has already renamed the variable name by prepending "_l". In our implementation, the variable could have been renamed by one of the pass. And hence, we search all local variables and check if the variable is renamed. Note that we have to look into the symbol table of statement block and not breakpoint.

- -

Definition at line 98 of file codegen_coreneuron_cpp_visitor.cpp.

-
@@ -1472,12 +1430,12 @@

Returns
return a tuple <true, array_length> if variable is an array otherwise <false, 0>
-

Definition at line 563 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 424 of file codegen_coreneuron_cpp_visitor.cpp.

- -

◆ conc_write_statement()

+ +

◆ conc_write_statement()

@@ -1559,7 +1519,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1078 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 939 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1598,7 +1558,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1083 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 944 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1649,7 +1609,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1391 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1218 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1686,7 +1646,7 @@

-

Definition at line 2248 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2057 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1736,7 +1696,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1465 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1274 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1786,7 +1746,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1437 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1264 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1844,7 +1804,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1411 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1238 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1876,7 +1836,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1050 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 911 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -1905,154 +1865,11 @@

Returns
the method parameters
-
Todo:
: figure out how to correctly handle qualifiers
+
Todo:
: figure out how to correctly handle qualifiers

Implements nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1061 of file codegen_coreneuron_cpp_visitor.cpp.

- - - - -

◆ ion_read_statements()

- -
-
- - - - - -
- - - - - - - - -
std::vector< std::string > nmodl::codegen::CodegenCoreneuronCppVisitor::ion_read_statements (BlockType type) const
-
-protected
-
- -

For a given output block type, return statements for all read ion variables.

-
Parameters
- - -
typeThe type of code block being generated
-
-
-
Returns
A vector of strings representing the reading of ion variables
-

Depending upon the block type, we have to print read/write ion variables during code generation. Depending on block/procedure being printed, this method return statements as vector. As different code backends could have different variable names, we rely on backend-specific read_ion_variable_name and write_ion_variable_name method which will be overloaded.

- -

Definition at line 124 of file codegen_coreneuron_cpp_visitor.cpp.

- -
-
- -

◆ ion_read_statements_optimized()

- -
-
- - - - - -
- - - - - - - - -
std::vector< std::string > nmodl::codegen::CodegenCoreneuronCppVisitor::ion_read_statements_optimized (BlockType type) const
-
-protected
-
- -

For a given output block type, return minimal statements for all read ion variables.

-
Parameters
- - -
typeThe type of code block being generated
-
-
-
Returns
A vector of strings representing the reading of ion variables
- -

Definition at line 154 of file codegen_coreneuron_cpp_visitor.cpp.

- -
-
- -

◆ ion_variable_struct_required()

- -
-
- - - - - -
- - - - - - - -
bool nmodl::codegen::CodegenCoreneuronCppVisitor::ion_variable_struct_required () const
-
-protected
-
- -

Check if a structure for ion variables is required.

-
Returns
true if a structure fot ion variables must be generated
- -

Definition at line 259 of file codegen_coreneuron_cpp_visitor.cpp.

- -
-
- -

◆ ion_write_statements()

- -
-
- - - - - -
- - - - - - - - -
std::vector< ShadowUseStatement > nmodl::codegen::CodegenCoreneuronCppVisitor::ion_write_statements (BlockType type)
-
-protected
-
- -

For a given output block type, return statements for writing back ion variables.

-
Parameters
- - -
typeThe type of code block being generated
-
-
-
Returns
A vector of strings representing the write-back of ion variables
-
Todo:
Unhandled case in neuron implementation
- -

Definition at line 171 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 922 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2090,7 +1907,7 @@

Returns
true if it is constant

This can be override in the backend. For example, parameters can be constant except in INITIAL block where they are set to 0. As initial block is/can be executed on c++/cpu backend, gpu backend can mark the parameter as constant.

-

Definition at line 269 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 130 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2139,7 +1956,7 @@

Returns
True if operator() is const else False
-

Definition at line 905 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 766 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2169,7 +1986,7 @@

Returns
The target code string
-

Definition at line 3007 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2816 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2200,7 +2017,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 398 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 259 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2231,7 +2048,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1093 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 954 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2263,7 +2080,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1105 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 966 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2296,8 +2113,8 @@

-

◆ optimize_ion_variable_copies()

+ +

◆ optimize_ion_variable_copies()

@@ -2430,7 +2249,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 492 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 353 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2464,7 +2283,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 440 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 301 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2495,7 +2314,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 465 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 326 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2526,7 +2345,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1538 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1347 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2556,7 +2375,7 @@

Definition at line 455 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 316 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2586,7 +2405,7 @@

Definition at line 460 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 321 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2637,7 +2456,7 @@

Definition at line 2563 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2372 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2693,7 +2512,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 375 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 236 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2722,7 +2541,7 @@

Definition at line 783 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 644 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2753,7 +2572,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3654 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3463 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2782,7 +2601,7 @@

Definition at line 3584 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3393 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2813,7 +2632,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3623 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3432 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2842,7 +2661,7 @@

Definition at line 1569 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1378 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2880,7 +2699,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3595 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3404 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2911,7 +2730,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 294 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 155 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2946,10 +2765,10 @@

Todo:
Data is not derived.
+
Todo:
Data is not derived.

Need to add instance into instance struct? data used here is wrong in AoS because as in original implementation, data is not incremented every iteration for AoS. May be better to derive actual variable names? [resolved now?] slist needs to added as local variable

-

Definition at line 3219 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3028 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -2980,7 +2799,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 299 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 160 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3010,7 +2829,7 @@

Note
This is not used for the C++ backend
-

Definition at line 445 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 306 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3041,7 +2860,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 324 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 185 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3072,7 +2891,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 319 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 180 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3110,7 +2929,7 @@

-

Definition at line 1008 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 869 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3143,7 +2962,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 3499 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3308 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3172,7 +2991,7 @@

Definition at line 1253 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1080 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3201,7 +3020,7 @@

Definition at line 1262 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1089 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3239,7 +3058,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 847 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 708 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3288,7 +3107,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 807 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 668 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3326,7 +3145,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 828 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 689 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3357,7 +3176,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 529 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 390 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3393,7 +3212,7 @@

Definition at line 867 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 728 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3429,7 +3248,7 @@

Definition at line 941 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 802 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3458,7 +3277,7 @@

Definition at line 2641 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2450 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3489,7 +3308,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3614 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3423 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3518,7 +3337,7 @@

Definition at line 3012 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2821 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3567,7 +3386,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2437 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2246 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3597,7 +3416,7 @@

Note
This is not used for the C++ backend
-

Definition at line 450 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 311 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3629,7 +3448,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 2222 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2031 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3661,7 +3480,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1816 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1625 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3692,7 +3511,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3565 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3374 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3729,7 +3548,7 @@

Definition at line 2387 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2196 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3761,7 +3580,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 376 of file codegen_coreneuron_cpp_visitor.hpp.

+

Definition at line 333 of file codegen_coreneuron_cpp_visitor.hpp.

@@ -3793,7 +3612,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 383 of file codegen_coreneuron_cpp_visitor.hpp.

+

Definition at line 340 of file codegen_coreneuron_cpp_visitor.hpp.

@@ -3824,7 +3643,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 354 of file codegen_coreneuron_cpp_visitor.hpp.

+

Definition at line 311 of file codegen_coreneuron_cpp_visitor.hpp.

@@ -3864,7 +3683,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 368 of file codegen_coreneuron_cpp_visitor.hpp.

+

Definition at line 325 of file codegen_coreneuron_cpp_visitor.hpp.

@@ -3885,7 +3704,7 @@

Definition at line 2264 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2073 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3921,7 +3740,7 @@

Definition at line 2200 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2009 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3950,7 +3769,7 @@

Definition at line 2170 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1979 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -3979,7 +3798,7 @@

Definition at line 2217 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2026 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4017,7 +3836,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 343 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 204 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4048,7 +3867,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 348 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 209 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4077,7 +3896,7 @@

Definition at line 1298 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1125 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4119,7 +3938,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1669 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1478 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4157,7 +3976,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2128 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1937 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4197,7 +4016,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1923 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1732 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4226,7 +4045,7 @@

Definition at line 1308 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1135 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4257,7 +4076,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 475 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 336 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4288,7 +4107,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3572 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3381 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4319,7 +4138,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3578 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3387 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4350,7 +4169,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1320 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1147 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4381,7 +4200,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1326 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1153 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4419,7 +4238,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2902 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2711 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4448,7 +4267,7 @@

Definition at line 2954 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2763 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4479,7 +4298,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 353 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 214 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4510,7 +4329,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 358 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 219 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4548,7 +4367,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2875 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2684 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4577,7 +4396,7 @@

Definition at line 3178 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2987 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4606,7 +4425,7 @@

Definition at line 1286 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1113 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4642,7 +4461,7 @@

Definition at line 3033 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2842 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4689,7 +4508,7 @@

Definition at line 2792 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2601 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4718,7 +4537,7 @@

Definition at line 3119 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2928 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4747,7 +4566,7 @@

Definition at line 3021 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2830 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4776,7 +4595,7 @@

Definition at line 3028 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2837 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4807,7 +4626,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 314 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 175 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4838,7 +4657,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 304 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 165 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4869,7 +4688,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 309 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 170 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4899,7 +4718,7 @@

Definition at line 3091 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2900 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4931,7 +4750,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 3079 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2888 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -4963,7 +4782,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 3084 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2893 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5001,7 +4820,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2843 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2652 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5032,7 +4851,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 3308 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3117 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5063,7 +4882,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2649 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2458 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5094,7 +4913,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2617 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2426 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5125,7 +4944,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3528 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3337 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5164,7 +4983,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3392 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3201 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5202,7 +5021,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3463 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3272 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5233,7 +5052,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 424 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 285 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5264,7 +5083,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 411 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 272 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5296,7 +5115,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3429 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3238 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5335,7 +5154,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3373 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3182 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5366,7 +5185,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 2629 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2438 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5402,7 +5221,7 @@

Definition at line 2488 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2297 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5430,11 +5249,11 @@

Print nrn_state / state update function definition.

-
Todo:
Eigen solver node also emits IonCurVar variable in the functor but that shouldn't update ions in derivative block
+
Todo:
Eigen solver node also emits IonCurVar variable in the functor but that shouldn't update ions in derivative block

Implements nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3318 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3127 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5463,7 +5282,7 @@

Definition at line 1271 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1098 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5501,7 +5320,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 842 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 703 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5532,7 +5351,7 @@

nmodl::codegen::CodegenAccVisitor.

-

Definition at line 403 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 264 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5562,7 +5381,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1602 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1411 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5591,7 +5410,7 @@

Definition at line 2986 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2795 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5620,7 +5439,7 @@

Definition at line 2227 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2036 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5651,7 +5470,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1558 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1367 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5687,7 +5506,7 @@

Definition at line 577 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 438 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5723,7 +5542,7 @@

Definition at line 674 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 535 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5758,7 +5577,7 @@

Definition at line 1342 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1169 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5787,7 +5606,7 @@

Definition at line 2065 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1874 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5816,7 +5635,7 @@

Definition at line 505 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 366 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5847,7 +5666,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 3602 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3411 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5875,11 +5694,11 @@

Print watch activate function.

-
Todo:
Number of watch could be more than number of statements according to grammar.
+
Todo:
Number of watch could be more than number of statements according to grammar.

Check if this is correctly handled in neuron and coreneuron.

-
Todo:
Similar to neuron/coreneuron we are using first watch and ignoring rest.
+
Todo:
Similar to neuron/coreneuron we are using first watch and ignoring rest.
-

Definition at line 2662 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2471 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5907,61 +5726,10 @@

Print watch activate function.

-
Todo:
Similar to print_watch_activate, we are using only first watch.
+
Todo:
Similar to print_watch_activate, we are using only first watch.

need to verify with neuron/coreneuron about rest.

-

Definition at line 2710 of file codegen_coreneuron_cpp_visitor.cpp.

- - - - -

◆ process_shadow_update_statement()

- -
-
- - - - - -
- - - - - - - - - - - - - - - - - - -
std::string nmodl::codegen::CodegenCoreneuronCppVisitor::process_shadow_update_statement (const ShadowUseStatementstatement,
BlockType type 
)
-
-protected
-
- -

Process shadow update statement.

-

If mechanisms dependency level execution is enabled then certain updates like ionic current contributions needs to be atomically updated.

-

If the statement requires reduction then add it to vector of reduction statement and return statement using shadow update

-
Parameters
- - - -
statementThe statement that might require shadow updates
typeThe target backend code block type
-
-
-
Returns
The generated target backend code
-

In this case we first update current mechanism's shadow vector and then add statement to queue that will be used in reduction queue.

- -

Definition at line 1232 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 2519 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -5998,11 +5766,11 @@

Returns
The code with all variables renamed as needed
-
Todo:
: this is still ad-hoc and requires re-implementation to handle it more elegantly.
+
Todo:
: this is still ad-hoc and requires re-implementation to handle it more elegantly.

Implements nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1146 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1007 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -6040,44 +5808,7 @@

Returns
The code after variable renaming

Often top level verbatim blocks use variables with old names. Here we process if we are processing verbatim block at global scope.

-

Definition at line 228 of file codegen_coreneuron_cpp_visitor.cpp.

- - - - -

◆ read_ion_variable_name()

- -
-
- - - - - -
- - - - - - - - -
std::pair< std::string, std::string > nmodl::codegen::CodegenCoreneuronCppVisitor::read_ion_variable_name (const std::string & name)
-
-staticprotected
-
- -

Return ion variable name and corresponding ion read variable name.

-
Parameters
- - -
nameThe ion variable name
-
-
-
Returns
The ion read variable name
- -

Definition at line 1192 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 94 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -6108,7 +5839,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 1173 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 1034 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -6147,7 +5878,7 @@

Returns
The possibly replace variable name

if function is defined the same mod file then the arguments must contain mechanism instance as well.

-

Definition at line 1117 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 978 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -6180,43 +5911,6 @@

Definition at line 56 of file codegen_coreneuron_cpp_visitor.cpp.

- - - -

◆ update_if_ion_variable_name()

- -
-
- - - - - -
- - - - - - - - -
std::string nmodl::codegen::CodegenCoreneuronCppVisitor::update_if_ion_variable_name (const std::string & name) const
-
-protected
-
- -

Determine the updated name if the ion variable has been optimized.

-
Parameters
- - -
nameThe ion variable name
-
-
-
Returns
The updated name of the variable has been optimized (e.g. ena --> ion_ena)
- -

Definition at line 1447 of file codegen_coreneuron_cpp_visitor.cpp.

-
@@ -6247,7 +5941,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 3685 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3494 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -6279,7 +5973,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 3721 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3530 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -6311,7 +6005,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 3693 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3502 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -6343,7 +6037,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 3747 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3556 of file codegen_coreneuron_cpp_visitor.cpp.

@@ -6375,44 +6069,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 3785 of file codegen_coreneuron_cpp_visitor.cpp.

- - - - -

◆ write_ion_variable_name()

- -
-
- - - - - -
- - - - - - - - -
std::pair< std::string, std::string > nmodl::codegen::CodegenCoreneuronCppVisitor::write_ion_variable_name (const std::string & name)
-
-staticprotected
-
- -

Return ion variable name and corresponding ion write variable name.

-
Parameters
- - -
nameThe ion variable name
-
-
-
Returns
The ion write variable name
- -

Definition at line 1198 of file codegen_coreneuron_cpp_visitor.cpp.

+

Definition at line 3594 of file codegen_coreneuron_cpp_visitor.cpp.

diff --git a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.js b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.js index 3c316ac7d3..e9e692de2b 100644 --- a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.js +++ b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.js @@ -3,9 +3,8 @@ var classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor = [ "CodegenCoreneuronCppVisitor", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad1816124976f0e4697006bfc2b6378d7", null ], [ "CodegenCoreneuronCppVisitor", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6cd894c71733fbdc58ea828ad035976f", null ], [ "backend_name", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#acfddae56ef5e91b7394b6f4c91748698", null ], - [ "breakpoint_current", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a40430cd5a36ba2b612adc095952d50a9", null ], [ "check_if_var_is_array", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a293512e33ee9a6a4585664e73e5897ed", null ], - [ "conc_write_statement", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a805dff5f277ea3b3536a553818fb917a", null ], + [ "conc_write_statement", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a542c802c8bea31d9a7702831eb385633", null ], [ "external_method_arguments", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ada7cc9156da44d1e34fd0e0ca42032ec", null ], [ "external_method_parameters", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adabf97eae5508fe69a5298c9ce6b627d", null ], [ "float_variable_name", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a18e0834ef774dd2bb5e5adc4ff2df5ae", null ], @@ -15,10 +14,6 @@ var classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor = [ "int_variable_name", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a328753b743f89bbdf4123c462d63ba0c", null ], [ "internal_method_arguments", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7d14e3cc08441dc6b3bd64f0ca0a13ba", null ], [ "internal_method_parameters", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af48766525e3a1c8f88471a9338ae59e7", null ], - [ "ion_read_statements", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2ff6b6d552739a604c1c9c19968dafb4", null ], - [ "ion_read_statements_optimized", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a43e3e9beeb7ca80989d361c917491e1e", null ], - [ "ion_variable_struct_required", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7089dc9d4bfda5791d6f95388a877c8b", null ], - [ "ion_write_statements", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0c07a4568bf732ccc7a6ec9b763bc71b", null ], [ "is_constant_variable", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a5d1ca0fcb615508f88c56b6d7a987419", null ], [ "is_functor_const", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2c93009c078b20b41517309c499f081f", null ], [ "net_receive_buffering_declaration", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a18c00e97466c3bf5a83f277ca48b0d95", null ], @@ -26,7 +21,7 @@ var classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor = [ "nrn_thread_arguments", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a294fadf1935383379dd1002208363c71", null ], [ "nrn_thread_internal_arguments", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4b959a2df6058dc1539d8f4f745b01ec", null ], [ "num_thread_objects", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a43b05a41af87606941c4dff097a5f7b9", null ], - [ "optimize_ion_variable_copies", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a58808da4cf7e64ffb1bcb5be20f977e3", null ], + [ "optimize_ion_variable_copies", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0620e76a8bf6864c3f4a38680f514158", null ], [ "position_of_float_var", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9494db3e1dfa2a390f133a9a8b5aa8e0", null ], [ "position_of_int_var", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aeada2d6cff883f8cbd1924f1d9729250", null ], [ "print_abort_routine", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab87a69ec67fe4d42df3cb0084c99dc85", null ], @@ -136,18 +131,14 @@ var classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor = [ "print_v_unused", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aa00bfb7065e72ad3b287eb78c414bd8d", null ], [ "print_watch_activate", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8366981bc5ecb9b4d52af74865e16bb6", null ], [ "print_watch_check", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a3ea1bf8ef47090b926d8738d18306de7", null ], - [ "process_shadow_update_statement", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7b99884ba28c9b21c1ff40bb54ca20f5", null ], [ "process_verbatim_text", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a592905dcf5bb27083ec0a84f1ab29508", null ], [ "process_verbatim_token", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4ce5f8dd96c5a12646610da8e40de705", null ], - [ "read_ion_variable_name", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aeb4f46dc88633a2d367cda3aaa650e1e", null ], [ "register_mechanism_arguments", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af7e3a49a86646f3b69a3d387aa4116bb", null ], [ "replace_if_verbatim_variable", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a950d9144e4f19333c602cfff78810d1b", null ], [ "simulator_name", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab13ca7a0bef674739095466ff66f9843", null ], - [ "update_if_ion_variable_name", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a992c19b9aa26099d7d1954fe77107b0d", null ], [ "visit_derivimplicit_callback", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a97acfbb75ee033066beb784570ad4a04", null ], [ "visit_eigen_linear_solver_block", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afa72e4268acf4beee9e0297e7efa9f3f", null ], [ "visit_eigen_newton_solver_block", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a06aa792160b4f021f66b58a21d3a296c", null ], [ "visit_for_netcon", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a524be3f8fa4165f983647ed8ebbb9f01", null ], - [ "visit_watch_statement", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8d05784b3300be188775cf2ec9958dc6", null ], - [ "write_ion_variable_name", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4c6c17a2eeafae316e104bf5722337fa", null ] + [ "visit_watch_statement", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8d05784b3300be188775cf2ec9958dc6", null ] ]; \ No newline at end of file diff --git a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor-members.html b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor-members.html index 6da6dfeb93..92ce13b679 100644 --- a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor-members.html +++ b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor-members.html @@ -99,13 +99,15 @@ - - - - - - - + + + + + + + + + @@ -135,6 +137,10 @@ + + + + @@ -154,68 +160,72 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + @@ -339,7 +349,8 @@ - + +
add_escape_quote(const std::string &text) constnmodl::codegen::CodegenCppVisitorinlineprotected
backend_name() const =0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
breakpoint_exist() const noexceptnmodl::codegen::CodegenCppVisitorprotected
codegen_float_variablesnmodl::codegen::CodegenCppVisitorprotected
codegen_global_variablesnmodl::codegen::CodegenCppVisitorprotected
codegen_int_variablesnmodl::codegen::CodegenCppVisitorprotected
CodegenCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenCppVisitorinlineprotected
CodegenCppVisitor(std::string mod_filename, std::ostream &stream, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenCppVisitorinlineprotected
compute_method_name(BlockType type) constnmodl::codegen::CodegenCppVisitorprotected
breakpoint_current(std::string current) constnmodl::codegen::CodegenCppVisitorprotected
breakpoint_exist() const noexceptnmodl::codegen::CodegenCppVisitorprotected
codegen_float_variablesnmodl::codegen::CodegenCppVisitorprotected
codegen_global_variablesnmodl::codegen::CodegenCppVisitorprotected
codegen_int_variablesnmodl::codegen::CodegenCppVisitorprotected
CodegenCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenCppVisitorinlineprotected
CodegenCppVisitor(std::string mod_filename, std::ostream &stream, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenCppVisitorinlineprotected
compute_method_name(BlockType type) constnmodl::codegen::CodegenCppVisitorprotected
conc_write_statement(const std::string &ion_name, const std::string &concentration, int index)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
current_watch_statementnmodl::codegen::CodegenCppVisitorprotected
default_float_data_type() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
default_int_data_type() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
internal_method_arguments()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
internal_method_call_encounterednmodl::codegen::CodegenCppVisitorprotected
internal_method_parameters()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
ion_read_statements(BlockType type) constnmodl::codegen::CodegenCppVisitorprotected
ion_read_statements_optimized(BlockType type) constnmodl::codegen::CodegenCppVisitorprotected
ion_variable_struct_required() constnmodl::codegen::CodegenCppVisitorprotected
ion_write_statements(BlockType type)nmodl::codegen::CodegenCppVisitorprotected
is_net_event(const std::string &name) const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
is_net_move(const std::string &name) const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
is_net_send(const std::string &name) const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
nrn_thread_internal_arguments()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
operator_for_d() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
operator_for_rhs() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
optimize_ionvar_copiesnmodl::codegen::CodegenCppVisitorprotected
ParamVector typedefnmodl::codegen::CodegenCppVisitorprotected
position_of_float_var(const std::string &name) const =0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
position_of_int_var(const std::string &name) const =0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_atomic_reduction_pragma()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_backend_info()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_codegen_routines()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_compute_functions()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_data_structures(bool print_initializers)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_fast_imem_calculation()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_function(const ast::FunctionBlock &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_function_call(const ast::FunctionCall &node)nmodl::codegen::CodegenCppVisitorprotectedvirtual
print_function_or_procedure(const ast::Block &node, const std::string &name)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_function_procedure_helper(const ast::Block &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_function_prototypes()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_g_unused() const =0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_global_function_common_code(BlockType type, const std::string &function_name="")=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_global_var_struct_assertions() constnmodl::codegen::CodegenCppVisitorprotectedvirtual
print_global_var_struct_decl()nmodl::codegen::CodegenCppVisitorprotectedvirtual
print_global_variables_for_hoc()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_headers_include()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_mechanism_global_var_structure(bool print_initializers)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_mechanism_info()nmodl::codegen::CodegenCppVisitorprotected
print_mechanism_range_var_structure(bool print_initializers)=0nmodl::codegen::CodegenCppVisitorpure virtual
print_mechanism_register()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_namespace_begin()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_namespace_end()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_namespace_start()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_namespace_stop()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_net_event_call(const ast::FunctionCall &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_net_move_call(const ast::FunctionCall &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_net_send_call(const ast::FunctionCall &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nmodl_constants()nmodl::codegen::CodegenCppVisitorprotected
print_nrn_alloc()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_constructor()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_cur()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_cur_kernel(const ast::BreakpointBlock &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_cur_non_conductance_kernel()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_current(const ast::BreakpointBlock &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_destructor()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_state()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_prcellstate_macros() constnmodl::codegen::CodegenCppVisitorprotected
print_procedure(const ast::ProcedureBlock &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_sdlists_init(bool print_initializers)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_standard_includes()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_statement_block(const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)nmodl::codegen::CodegenCppVisitorprotected
print_v_unused() const =0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_vector_elements(const std::vector< T > &elements, const std::string &separator, const std::string &prefix="")nmodl::codegen::CodegenCppVisitorprotected
printernmodl::codegen::CodegenCppVisitorprotected
printing_net_initnmodl::codegen::CodegenCppVisitorprotected
printing_net_receivenmodl::codegen::CodegenCppVisitorprotected
printing_top_verbatim_blocksnmodl::codegen::CodegenCppVisitorprotected
optimize_ion_variable_copies() const =0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
optimize_ionvar_copiesnmodl::codegen::CodegenCppVisitorprotected
ParamVector typedefnmodl::codegen::CodegenCppVisitorprotected
position_of_float_var(const std::string &name) const =0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
position_of_int_var(const std::string &name) const =0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_atomic_reduction_pragma()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_backend_info()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_codegen_routines()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_compute_functions()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_data_structures(bool print_initializers)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_fast_imem_calculation()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_function(const ast::FunctionBlock &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_function_call(const ast::FunctionCall &node)nmodl::codegen::CodegenCppVisitorprotectedvirtual
print_function_or_procedure(const ast::Block &node, const std::string &name)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_function_procedure_helper(const ast::Block &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_function_prototypes()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_g_unused() const =0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_global_function_common_code(BlockType type, const std::string &function_name="")=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_global_var_struct_assertions() constnmodl::codegen::CodegenCppVisitorprotectedvirtual
print_global_var_struct_decl()nmodl::codegen::CodegenCppVisitorprotectedvirtual
print_global_variables_for_hoc()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_headers_include()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_mechanism_global_var_structure(bool print_initializers)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_mechanism_info()nmodl::codegen::CodegenCppVisitorprotected
print_mechanism_range_var_structure(bool print_initializers)=0nmodl::codegen::CodegenCppVisitorpure virtual
print_mechanism_register()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_namespace_begin()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_namespace_end()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_namespace_start()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_namespace_stop()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_net_event_call(const ast::FunctionCall &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_net_move_call(const ast::FunctionCall &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_net_send_call(const ast::FunctionCall &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nmodl_constants()nmodl::codegen::CodegenCppVisitorprotected
print_nrn_alloc()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_constructor()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_cur()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_cur_kernel(const ast::BreakpointBlock &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_cur_non_conductance_kernel()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_current(const ast::BreakpointBlock &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_destructor()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_nrn_state()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_prcellstate_macros() constnmodl::codegen::CodegenCppVisitorprotected
print_procedure(const ast::ProcedureBlock &node)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_sdlists_init(bool print_initializers)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_standard_includes()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_statement_block(const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)nmodl::codegen::CodegenCppVisitorprotected
print_v_unused() const =0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
print_vector_elements(const std::vector< T > &elements, const std::string &separator, const std::string &prefix="")nmodl::codegen::CodegenCppVisitorprotected
printernmodl::codegen::CodegenCppVisitorprotected
printing_net_initnmodl::codegen::CodegenCppVisitorprotected
printing_net_receivenmodl::codegen::CodegenCppVisitorprotected
printing_top_verbatim_blocksnmodl::codegen::CodegenCppVisitorprotected
process_shadow_update_statement(const ShadowUseStatement &statement, BlockType type)nmodl::codegen::CodegenCppVisitorprotected
process_verbatim_text(std::string const &text)=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
program_symtabnmodl::codegen::CodegenCppVisitorprotected
range_variable_setup_required() const noexceptnmodl::codegen::CodegenCppVisitorprotected
register_mechanism_arguments() const =0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
rename_function_arguments()nmodl::codegen::CodegenCppVisitorprotected
setup(const ast::Program &node)nmodl::codegen::CodegenCppVisitor
simulator_name()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
statement_to_skip(const ast::Statement &node)nmodl::codegen::CodegenCppVisitorprotectedstatic
SymbolType typedefnmodl::codegen::CodegenCppVisitorprotected
read_ion_variable_name(const std::string &name)nmodl::codegen::CodegenCppVisitorprotectedstatic
register_mechanism_arguments() const =0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
rename_function_arguments()nmodl::codegen::CodegenCppVisitorprotected
setup(const ast::Program &node)nmodl::codegen::CodegenCppVisitor
simulator_name()=0nmodl::codegen::CodegenCppVisitorprotectedpure virtual
statement_to_skip(const ast::Statement &node)nmodl::codegen::CodegenCppVisitorprotectedstatic
SymbolType typedefnmodl::codegen::CodegenCppVisitorprotected
update_if_ion_variable_name(const std::string &name) constnmodl::codegen::CodegenCppVisitorprotected
update_index_semantics()nmodl::codegen::CodegenCppVisitorprotected
visit_after_block(const ast::AfterBlock &node) overridenmodl::visitor::ConstAstVisitorvirtual
visit_argument(const ast::Argument &node) overridenmodl::visitor::ConstAstVisitorvirtual
visit_while_statement(const ast::WhileStatement &node) overridenmodl::codegen::CodegenCppVisitorprotectedvirtual
visit_wrapped_expression(const ast::WrappedExpression &node) overridenmodl::visitor::ConstAstVisitorvirtual
visit_write_ion_var(const ast::WriteIonVar &node) overridenmodl::visitor::ConstAstVisitorvirtual
~ConstVisitor()=defaultnmodl::visitor::ConstVisitorvirtual
write_ion_variable_name(const std::string &name)nmodl::codegen::CodegenCppVisitorprotectedstatic
~ConstVisitor()=defaultnmodl::visitor::ConstVisitorvirtual
diff --git a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html index 151b304fd6..befdfc4ac7 100644 --- a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html +++ b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html @@ -560,6 +560,9 @@ std::string get_channel_info_var_name () const noexcept  Name of channel info variable. More...
  +bool ion_variable_struct_required () const + Check if a structure for ion variables is required. More...
+  template<typename T > bool has_parameter_of_name (const T &node, const std::string &name)  Check if function or procedure node has parameter with given name. More...
@@ -627,12 +630,30 @@ std::vector< IndexVariableInfoget_int_variables ()  Determine all int variables required during code generation. More...
  +std::vector< std::string > ion_read_statements (BlockType type) const + For a given output block type, return statements for all read ion variables. More...
+  +std::vector< std::string > ion_read_statements_optimized (BlockType type) const + For a given output block type, return minimal statements for all read ion variables. More...
+  +std::vector< ShadowUseStatemention_write_statements (BlockType type) + For a given output block type, return statements for writing back ion variables. More...
+  +std::string process_shadow_update_statement (const ShadowUseStatement &statement, BlockType type) + Process shadow update statement. More...
+  +std::string breakpoint_current (std::string current) const + Determine the variable name for the "current" used in breakpoint block taking into account intermediate code transformations. More...
+  virtual void print_atomic_reduction_pragma ()=0  Print atomic update pragma for reduction statements. More...
  virtual void print_global_var_struct_decl ()  Instantiate global var instance. More...
  +virtual bool optimize_ion_variable_copies () const =0 + Check if ion variable copies should be avoided. More...
+  void print_statement_block (const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)  Print any statement block in nmodl with option to (not) print braces. More...
  @@ -703,12 +724,18 @@ SymbolType make_symbol (const std::string &name) const  Creates a temporary symbol. More...
  +virtual std::string conc_write_statement (const std::string &ion_name, const std::string &concentration, int index)=0 + Generate Function call statement for nrn_wrote_conc. More...
+  virtual void print_namespace_start ()=0  Prints the start of the simulator namespace. More...
  virtual void print_namespace_stop ()=0  Prints the end of the simulator namespace. More...
  +std::string update_if_ion_variable_name (const std::string &name) const + Determine the updated name if the ion variable has been optimized. More...
+  virtual std::string float_variable_name (const SymbolType &symbol, bool use_instance) const =0  Determine the name of a float variable given its symbol. More...
  @@ -909,6 +936,12 @@ static bool statement_to_skip (const ast::Statement &node)  Check if given statement should be skipped during code generation. More...
  +static std::pair< std::string, std::string > read_ion_variable_name (const std::string &name) + Return ion variable name and corresponding ion read variable name. More...
+  +static std::pair< std::string, std::string > write_ion_variable_name (const std::string &name) + Return ion variable name and corresponding ion write variable name. More...
+  @@ -1064,7 +1097,7 @@

Definition at line 1125 of file codegen_cpp_visitor.hpp.

+

Definition at line 1226 of file codegen_cpp_visitor.hpp.

@@ -1116,7 +1149,7 @@

Definition at line 1136 of file codegen_cpp_visitor.hpp.

+

Definition at line 1237 of file codegen_cpp_visitor.hpp.

@@ -1154,7 +1187,7 @@

Returns
The same string with double-quotes pre- and postfixed
-

Definition at line 787 of file codegen_cpp_visitor.hpp.

+

Definition at line 847 of file codegen_cpp_visitor.hpp.

@@ -1185,6 +1218,44 @@

nmodl::codegen::CodegenNeuronCppVisitor, nmodl::codegen::CodegenCoreneuronCppVisitor, and nmodl::codegen::CodegenAccVisitor.

+ + + +

◆ breakpoint_current()

+ +
+
+

Protected Attributes

+ + + + +
+ + + + + + + + +
std::string nmodl::codegen::CodegenCppVisitor::breakpoint_current (std::string current) const
+
+protected
+
+ +

Determine the variable name for the "current" used in breakpoint block taking into account intermediate code transformations.

+
Parameters
+ + +
currentThe variable name for the current used in the model
+
+
+
Returns
The name for the current to be printed in C++
+

Current variable used in breakpoint block could be local variable. In this case, neuron has already renamed the variable name by prepending "_l". In our implementation, the variable could have been renamed by one of the pass. And hence, we search all local variables and check if the variable is renamed. Note that we have to look into the symbol table of statement block and not breakpoint.

+ +

Definition at line 350 of file codegen_cpp_visitor.cpp.

+
@@ -1212,7 +1283,7 @@

Definition at line 123 of file codegen_cpp_visitor.cpp.

+

Definition at line 127 of file codegen_cpp_visitor.cpp.

@@ -1240,7 +1311,62 @@

-

Definition at line 953 of file codegen_cpp_visitor.cpp.

+

Definition at line 1142 of file codegen_cpp_visitor.cpp.

+ + + + +

◆ conc_write_statement()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
virtual std::string nmodl::codegen::CodegenCppVisitor::conc_write_statement (const std::string & ion_name,
const std::string & concentration,
int index 
)
+
+protectedpure virtual
+
+ +

Generate Function call statement for nrn_wrote_conc.

+
Parameters
+ + + + +
ion_nameThe name of the ion variable
concentrationThe name of the concentration variable
index
+
+
+
Returns
The string representing the function call
+ +

Implemented in nmodl::codegen::CodegenCoreneuronCppVisitor, and nmodl::codegen::CodegenNeuronCppVisitor.

@@ -1335,7 +1461,7 @@

Returns
true if the method is defined
-

Definition at line 143 of file codegen_cpp_visitor.cpp.

+

Definition at line 147 of file codegen_cpp_visitor.cpp.

@@ -1509,7 +1635,7 @@

Definition at line 149 of file codegen_cpp_visitor.cpp.

+

Definition at line 153 of file codegen_cpp_visitor.cpp.

@@ -1547,7 +1673,7 @@

Returns
Its string representation

We can directly print value but if user specify value as integer then then it gets printed as an integer. To avoid this, we use below wrapper. If user has provided integer then it gets printed as 1.0 (similar to mod2c and neuron where ".0" is appended). Otherwise we print double variables as they are represented in the mod file by user. If the value is in scientific representation (1e+20, 1E-15) then keep it as it is.

-

Definition at line 168 of file codegen_cpp_visitor.cpp.

+

Definition at line 172 of file codegen_cpp_visitor.cpp.

@@ -1584,7 +1710,7 @@

Returns
Its string representation
-

Definition at line 173 of file codegen_cpp_visitor.cpp.

+

Definition at line 177 of file codegen_cpp_visitor.cpp.

@@ -1643,7 +1769,7 @@

Returns
A vector of float variables
-

Definition at line 743 of file codegen_cpp_visitor.cpp.

+

Definition at line 932 of file codegen_cpp_visitor.cpp.

@@ -1690,7 +1816,7 @@

Note
Variables for watch statements : there is one extra variable used in coreneuron compared to actual watch statements for compatibility with neuron (which uses one extra Datum variable)
-

Definition at line 809 of file codegen_cpp_visitor.cpp.

+

Definition at line 998 of file codegen_cpp_visitor.cpp.

@@ -1728,7 +1854,7 @@

Returns
The string representing the declaration of function parameters
-

Definition at line 30 of file codegen_cpp_visitor.cpp.

+

Definition at line 34 of file codegen_cpp_visitor.cpp.

@@ -1938,7 +2064,7 @@

Returns
True if argument with name exist
-

Definition at line 50 of file codegen_cpp_visitor.cpp.

+

Definition at line 54 of file codegen_cpp_visitor.cpp.

@@ -2052,7 +2178,7 @@

Definition at line 154 of file codegen_cpp_visitor.cpp.

+

Definition at line 158 of file codegen_cpp_visitor.cpp.

@@ -2114,6 +2240,149 @@

nmodl::codegen::CodegenCoreneuronCppVisitor, and nmodl::codegen::CodegenNeuronCppVisitor.

+ + + +

◆ ion_read_statements()

+ +
+
+ + + + + +
+ + + + + + + + +
std::vector< std::string > nmodl::codegen::CodegenCppVisitor::ion_read_statements (BlockType type) const
+
+protected
+
+ +

For a given output block type, return statements for all read ion variables.

+
Parameters
+ + +
typeThe type of code block being generated
+
+
+
Returns
A vector of strings representing the reading of ion variables
+

Depending upon the block type, we have to print read/write ion variables during code generation. Depending on block/procedure being printed, this method return statements as vector. As different code backends could have different variable names, we rely on backend-specific read_ion_variable_name and write_ion_variable_name method which will be overloaded.

+ +

Definition at line 223 of file codegen_cpp_visitor.cpp.

+ +
+
+ +

◆ ion_read_statements_optimized()

+ +
+
+ + + + + +
+ + + + + + + + +
std::vector< std::string > nmodl::codegen::CodegenCppVisitor::ion_read_statements_optimized (BlockType type) const
+
+protected
+
+ +

For a given output block type, return minimal statements for all read ion variables.

+
Parameters
+ + +
typeThe type of code block being generated
+
+
+
Returns
A vector of strings representing the reading of ion variables
+ +

Definition at line 253 of file codegen_cpp_visitor.cpp.

+ +
+
+ +

◆ ion_variable_struct_required()

+ +
+
+ + + + + +
+ + + + + + + +
bool nmodl::codegen::CodegenCppVisitor::ion_variable_struct_required () const
+
+protected
+
+ +

Check if a structure for ion variables is required.

+
Returns
true if a structure fot ion variables must be generated
+ +

Definition at line 29 of file codegen_cpp_visitor.cpp.

+ +
+
+ +

◆ ion_write_statements()

+ +
+
+ + + + + +
+ + + + + + + + +
std::vector< ShadowUseStatement > nmodl::codegen::CodegenCppVisitor::ion_write_statements (BlockType type)
+
+protected
+
+ +

For a given output block type, return statements for writing back ion variables.

+
Parameters
+ + +
typeThe type of code block being generated
+
+
+
Returns
A vector of strings representing the write-back of ion variables
+
Todo:
Unhandled case in neuron implementation
+ +

Definition at line 269 of file codegen_cpp_visitor.cpp.

+
@@ -2149,7 +2418,7 @@

Returns
true if the function is net_event
-

Definition at line 524 of file codegen_cpp_visitor.hpp.

+

Definition at line 530 of file codegen_cpp_visitor.hpp.

@@ -2186,7 +2455,7 @@

Returns
true if the function is net_move
-

Definition at line 514 of file codegen_cpp_visitor.hpp.

+

Definition at line 520 of file codegen_cpp_visitor.hpp.

@@ -2223,7 +2492,7 @@

Returns
true if the function is net_send
-

Definition at line 504 of file codegen_cpp_visitor.hpp.

+

Definition at line 510 of file codegen_cpp_visitor.hpp.

@@ -2289,7 +2558,7 @@

Returns
A symbol based on the given name
-

Definition at line 807 of file codegen_cpp_visitor.hpp.

+

Definition at line 867 of file codegen_cpp_visitor.hpp.

@@ -2326,7 +2595,7 @@

Returns
The name of the function or procedure postfixed with the model name
-

Definition at line 797 of file codegen_cpp_visitor.hpp.

+

Definition at line 857 of file codegen_cpp_visitor.hpp.

@@ -2364,7 +2633,7 @@

Returns
true if this Statement requires a semicolon

Statements like if, else etc. don't need semicolon at the end. (Note that it's valid to have "extraneous" semicolon). Also, statement block can appear as statement using expression statement which need to be inspected.

-

Definition at line 184 of file codegen_cpp_visitor.cpp.

+

Definition at line 188 of file codegen_cpp_visitor.cpp.

@@ -2393,7 +2662,7 @@

Definition at line 100 of file codegen_cpp_visitor.cpp.

+

Definition at line 104 of file codegen_cpp_visitor.cpp.

@@ -2422,7 +2691,7 @@

Definition at line 118 of file codegen_cpp_visitor.cpp.

+

Definition at line 122 of file codegen_cpp_visitor.cpp.

@@ -2451,7 +2720,7 @@

Definition at line 128 of file codegen_cpp_visitor.cpp.

+

Definition at line 132 of file codegen_cpp_visitor.cpp.

@@ -2480,7 +2749,7 @@

Definition at line 90 of file codegen_cpp_visitor.cpp.

+

Definition at line 94 of file codegen_cpp_visitor.cpp.

@@ -2539,7 +2808,7 @@

Definition at line 113 of file codegen_cpp_visitor.cpp.

+

Definition at line 117 of file codegen_cpp_visitor.cpp.

@@ -2568,7 +2837,7 @@

Definition at line 105 of file codegen_cpp_visitor.cpp.

+

Definition at line 109 of file codegen_cpp_visitor.cpp.

@@ -2686,6 +2955,35 @@

Definition at line 384 of file codegen_cpp_visitor.hpp.

+ + + +

◆ optimize_ion_variable_copies()

+ +
+
+ + + + + +
+ + + + + + + +
virtual bool nmodl::codegen::CodegenCppVisitor::optimize_ion_variable_copies () const
+
+protectedpure virtual
+
+ +

Check if ion variable copies should be avoided.

+ +

Implemented in nmodl::codegen::CodegenCoreneuronCppVisitor, and nmodl::codegen::CodegenNeuronCppVisitor.

+
@@ -3011,7 +3309,7 @@

Definition at line 236 of file codegen_cpp_visitor.cpp.

+

Definition at line 425 of file codegen_cpp_visitor.cpp.

@@ -3227,7 +3525,7 @@

Definition at line 218 of file codegen_cpp_visitor.cpp.

+

Definition at line 407 of file codegen_cpp_visitor.cpp.

@@ -3257,7 +3555,7 @@

Returns
""
-

Definition at line 231 of file codegen_cpp_visitor.cpp.

+

Definition at line 420 of file codegen_cpp_visitor.cpp.

@@ -3380,7 +3678,7 @@

Definition at line 299 of file codegen_cpp_visitor.cpp.

+

Definition at line 488 of file codegen_cpp_visitor.cpp.

@@ -3703,7 +4001,7 @@

static const double PI = 3.14159;
static const double R = 8.3145;
-

Definition at line 404 of file codegen_cpp_visitor.cpp.

+

Definition at line 593 of file codegen_cpp_visitor.cpp.

@@ -4017,7 +4315,7 @@

Definition at line 292 of file codegen_cpp_visitor.cpp.

+

Definition at line 481 of file codegen_cpp_visitor.cpp.

@@ -4166,7 +4464,7 @@

Definition at line 337 of file codegen_cpp_visitor.cpp.

+

Definition at line 526 of file codegen_cpp_visitor.cpp.

@@ -4197,6 +4495,57 @@

nmodl::codegen::CodegenCoreneuronCppVisitor, and nmodl::codegen::CodegenNeuronCppVisitor.

+ + + +

◆ process_shadow_update_statement()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
std::string nmodl::codegen::CodegenCppVisitor::process_shadow_update_statement (const ShadowUseStatementstatement,
BlockType type 
)
+
+protected
+
+ +

Process shadow update statement.

+

If mechanisms dependency level execution is enabled then certain updates like ionic current contributions needs to be atomically updated.

+

If the statement requires reduction then add it to vector of reduction statement and return statement using shadow update

+
Parameters
+ + + +
statementThe statement that might require shadow updates
typeThe target backend code block type
+
+
+
Returns
The generated target backend code
+

In this case we first update current mechanism's shadow vector and then add statement to queue that will be used in reduction queue.

+ +

Definition at line 327 of file codegen_cpp_visitor.cpp.

+
@@ -4263,7 +4612,45 @@

Returns

When floating point data type is not default (i.e. double) then we have to copy old array to new type (for range variables).

-

Definition at line 137 of file codegen_cpp_visitor.cpp.

+

Definition at line 141 of file codegen_cpp_visitor.cpp.

+ + + + +

◆ read_ion_variable_name()

+ +
+
+ + + + + +
+ + + + + + + + +
std::pair< std::string, std::string > nmodl::codegen::CodegenCppVisitor::read_ion_variable_name (const std::string & name)
+
+staticprotected
+
+ +

Return ion variable name and corresponding ion read variable name.

+

Example: {"ena", "ion_ena"} = read_ion_variable_name("ena");

+
Parameters
+ + +
nameThe ion variable name
+
+
+
Returns
The ion read variable name
+ +

Definition at line 390 of file codegen_cpp_visitor.cpp.

@@ -4323,7 +4710,7 @@

Todo:
Issue with verbatim renaming.

e.g. pattern.mod has info struct with index variable. If we use "index" instead of "indexes" as default argument then during verbatim replacement we don't know the index is which one. This is because verbatim renaming pass has already stripped out prefixes from the text.

-

Definition at line 376 of file codegen_cpp_visitor.cpp.

+

Definition at line 565 of file codegen_cpp_visitor.cpp.

@@ -4346,7 +4733,7 @@

Definition at line 934 of file codegen_cpp_visitor.cpp.

+

Definition at line 1123 of file codegen_cpp_visitor.cpp.

@@ -4413,7 +4800,44 @@

Returns
true if this Statement is to be skipped

Certain statements like unit, comment, solve can/need to be skipped during code generation. Note that solve block is wrapped in expression statement and hence we have to check inner expression. It's also true for the initial block defined inside net receive block.

-

Definition at line 66 of file codegen_cpp_visitor.cpp.

+

Definition at line 70 of file codegen_cpp_visitor.cpp.

+ + + + +

◆ update_if_ion_variable_name()

+ +
+
+ + + + + +
+ + + + + + + + +
std::string nmodl::codegen::CodegenCppVisitor::update_if_ion_variable_name (const std::string & name) const
+
+protected
+
+ +

Determine the updated name if the ion variable has been optimized.

+
Parameters
+ + +
nameThe ion variable name
+
+
+
Returns
The updated name of the variable has been optimized (e.g. ena --> ion_ena)
+ +

Definition at line 373 of file codegen_cpp_visitor.cpp.

@@ -4444,7 +4868,7 @@

Definition at line 667 of file codegen_cpp_visitor.cpp.

+

Definition at line 856 of file codegen_cpp_visitor.cpp.

@@ -4476,7 +4900,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 570 of file codegen_cpp_visitor.cpp.

+

Definition at line 759 of file codegen_cpp_visitor.cpp.

@@ -4508,7 +4932,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 588 of file codegen_cpp_visitor.cpp.

+

Definition at line 777 of file codegen_cpp_visitor.cpp.

@@ -4540,7 +4964,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 449 of file codegen_cpp_visitor.cpp.

+

Definition at line 638 of file codegen_cpp_visitor.cpp.

@@ -4572,7 +4996,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 444 of file codegen_cpp_visitor.cpp.

+

Definition at line 633 of file codegen_cpp_visitor.cpp.

@@ -4604,7 +5028,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 520 of file codegen_cpp_visitor.cpp.

+

Definition at line 709 of file codegen_cpp_visitor.cpp.

@@ -4636,7 +5060,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 528 of file codegen_cpp_visitor.cpp.

+

Definition at line 717 of file codegen_cpp_visitor.cpp.

@@ -4668,7 +5092,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 439 of file codegen_cpp_visitor.cpp.

+

Definition at line 628 of file codegen_cpp_visitor.cpp.

@@ -4700,7 +5124,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 542 of file codegen_cpp_visitor.cpp.

+

Definition at line 731 of file codegen_cpp_visitor.cpp.

@@ -4732,7 +5156,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 608 of file codegen_cpp_visitor.cpp.

+

Definition at line 797 of file codegen_cpp_visitor.cpp.

@@ -4764,7 +5188,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 507 of file codegen_cpp_visitor.cpp.

+

Definition at line 696 of file codegen_cpp_visitor.cpp.

@@ -4796,7 +5220,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 491 of file codegen_cpp_visitor.cpp.

+

Definition at line 680 of file codegen_cpp_visitor.cpp.

@@ -4828,7 +5252,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 433 of file codegen_cpp_visitor.cpp.

+

Definition at line 622 of file codegen_cpp_visitor.cpp.

@@ -4860,7 +5284,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 501 of file codegen_cpp_visitor.cpp.

+

Definition at line 690 of file codegen_cpp_visitor.cpp.

@@ -4892,7 +5316,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 640 of file codegen_cpp_visitor.cpp.

+

Definition at line 829 of file codegen_cpp_visitor.cpp.

@@ -4924,7 +5348,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 647 of file codegen_cpp_visitor.cpp.

+

Definition at line 836 of file codegen_cpp_visitor.cpp.

@@ -4956,7 +5380,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 454 of file codegen_cpp_visitor.cpp.

+

Definition at line 643 of file codegen_cpp_visitor.cpp.

@@ -4988,7 +5412,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 563 of file codegen_cpp_visitor.cpp.

+

Definition at line 752 of file codegen_cpp_visitor.cpp.

@@ -5020,7 +5444,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 464 of file codegen_cpp_visitor.cpp.

+

Definition at line 653 of file codegen_cpp_visitor.cpp.

@@ -5058,7 +5482,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 976 of file codegen_cpp_visitor.cpp.

+

Definition at line 1165 of file codegen_cpp_visitor.cpp.

@@ -5090,7 +5514,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 632 of file codegen_cpp_visitor.cpp.

+

Definition at line 821 of file codegen_cpp_visitor.cpp.

@@ -5122,7 +5546,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 652 of file codegen_cpp_visitor.cpp.

+

Definition at line 841 of file codegen_cpp_visitor.cpp.

@@ -5153,7 +5577,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 603 of file codegen_cpp_visitor.cpp.

+

Definition at line 792 of file codegen_cpp_visitor.cpp.

@@ -5185,7 +5609,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 424 of file codegen_cpp_visitor.cpp.

+

Definition at line 613 of file codegen_cpp_visitor.cpp.

@@ -5217,7 +5641,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 593 of file codegen_cpp_visitor.cpp.

+

Definition at line 782 of file codegen_cpp_visitor.cpp.

@@ -5249,7 +5673,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 459 of file codegen_cpp_visitor.cpp.

+

Definition at line 648 of file codegen_cpp_visitor.cpp.

@@ -5281,7 +5705,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 627 of file codegen_cpp_visitor.cpp.

+

Definition at line 816 of file codegen_cpp_visitor.cpp.

@@ -5312,7 +5736,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 472 of file codegen_cpp_visitor.cpp.

+

Definition at line 661 of file codegen_cpp_visitor.cpp.

@@ -5344,7 +5768,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 613 of file codegen_cpp_visitor.cpp.

+

Definition at line 802 of file codegen_cpp_visitor.cpp.

@@ -5376,7 +5800,45 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 534 of file codegen_cpp_visitor.cpp.

+

Definition at line 723 of file codegen_cpp_visitor.cpp.

+ + + + +

◆ write_ion_variable_name()

+ +
+
+ + + + + +
+ + + + + + + + +
std::pair< std::string, std::string > nmodl::codegen::CodegenCppVisitor::write_ion_variable_name (const std::string & name)
+
+staticprotected
+
+ +

Return ion variable name and corresponding ion write variable name.

+

Example: {"ion_ena", "ena"} = write_ion_variable_name("ena");

+
Parameters
+ + +
nameThe ion variable name
+
+
+
Returns
The ion write variable name
+ +

Definition at line 396 of file codegen_cpp_visitor.cpp.

diff --git a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.js b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.js index fad48ec3cc..ecc6f8aff7 100644 --- a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.js +++ b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_cpp_visitor.js @@ -6,8 +6,10 @@ var classnmodl_1_1codegen_1_1_codegen_cpp_visitor = [ "CodegenCppVisitor", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a18359d1914ead9e3f6ddfa77ea99bab3", null ], [ "add_escape_quote", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aeeacd28215827d6b0cd23cf59e5fc0c2", null ], [ "backend_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a30af017ff0f7101ed71d9b43e56031ca", null ], + [ "breakpoint_current", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aada5b6eeb7fd6f21a4ce2c68da1e2994", null ], [ "breakpoint_exist", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a578f6c60b4ca495b24e5b7ae2db448cc", null ], [ "compute_method_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae022e99573f663fc0db935c5c1bb7199", null ], + [ "conc_write_statement", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae29a1c321357b464d7a67ee4fbfabfe3", null ], [ "default_float_data_type", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#afba5ac1d4636d7ba57ac3fd7c7b5e2ba", null ], [ "default_int_data_type", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a199a281ca182a40a40331fa29e45828a", null ], [ "defined_method", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2f6825fbb587362e1ed38f03e3b97d86", null ], @@ -32,6 +34,10 @@ var classnmodl_1_1codegen_1_1_codegen_cpp_visitor = [ "int_variables_size", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aac1df493cd346d7faccb17ae5440ddc4", null ], [ "internal_method_arguments", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aeacff81944f23540968aa617d25e3d22", null ], [ "internal_method_parameters", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a32f908e88bbb1c5070b5e011f2955c07", null ], + [ "ion_read_statements", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d8c0140086b0f5284e1cf7c23632463", null ], + [ "ion_read_statements_optimized", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a26ad42be1c7c9a127b2d806d08e426a6", null ], + [ "ion_variable_struct_required", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6e25890e173635c92d41465a2ee4d3a2", null ], + [ "ion_write_statements", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2e2dd82a055dd830e8efc7f1dce03924", null ], [ "is_net_event", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a294f3c4467883beffdc0d6bea67e1741", null ], [ "is_net_move", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a7559257a5ad55a48d1221522838c5daf", null ], [ "is_net_send", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2ecbf452d80ce4914271469183e2e31c", null ], @@ -50,6 +56,7 @@ var classnmodl_1_1codegen_1_1_codegen_cpp_visitor = [ "nrn_thread_internal_arguments", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#abcf0d5623d10f929b40dd3fc0e8ad00a", null ], [ "operator_for_d", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2d7cffd628c745f2e7614ffab48f4346", null ], [ "operator_for_rhs", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d260fcee2ad4a83b36fc26adad5934d", null ], + [ "optimize_ion_variable_copies", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a81cded985b616728b55976bf7eca4488", null ], [ "position_of_float_var", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3ef901c89d40124058a0df268b4f8101", null ], [ "position_of_int_var", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aaa6dae67e44cbd29e86e10b270249bed", null ], [ "print_atomic_reduction_pragma", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a92bfb8a4daec705014f8e871fb0feacb", null ], @@ -97,13 +104,16 @@ var classnmodl_1_1codegen_1_1_codegen_cpp_visitor = [ "print_statement_block", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8b912ad6d9a4f6d8e4c1bb16f2c95fbf", null ], [ "print_v_unused", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a5d7d3326aaa9849977f0c203078f39e4", null ], [ "print_vector_elements", "group__codegen__backends.html#ga743bcd56c5822a14381fd87fe586ed6c", null ], + [ "process_shadow_update_statement", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aa539bb6033a8bcd87fc4eb279bad887a", null ], [ "process_verbatim_text", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac53419e9abc2d2f9b12acf10507e7954", null ], [ "range_variable_setup_required", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a1e105e4b89ba5652f46bb91e49c817eb", null ], + [ "read_ion_variable_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3ee489972d8827f03490337c96a74b43", null ], [ "register_mechanism_arguments", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aec3cef47cc3c1e5901b4ff401ce8e725", null ], [ "rename_function_arguments", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aef331b9ddcbd761f3aea6b457f83e88e", null ], [ "setup", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae333398890c61148ec60cb52c3d28c10", null ], [ "simulator_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8b8b75dcd53ae8e3a641f18cb00bee1d", null ], [ "statement_to_skip", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a789dae2310c3496443a8a51c26cc8b71", null ], + [ "update_if_ion_variable_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aba3a9521ace5f09f4d2263e4401b33ee", null ], [ "update_index_semantics", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae0d8d4e346e244c764911c0c64c2ac1c", null ], [ "visit_binary_expression", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae02024096ab4490b8a6215b3e59e6de0", null ], [ "visit_binary_operator", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a22b033ac5c8d3f09e96b814355fea17a", null ], @@ -134,6 +144,7 @@ var classnmodl_1_1codegen_1_1_codegen_cpp_visitor = [ "visit_var_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a4f2304d508e3d9645581004c676d94ca", null ], [ "visit_verbatim", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad283ce438acd2faea2bbb309251890a1", null ], [ "visit_while_statement", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad488bc63dac24ac7e5c29a1138172ed7", null ], + [ "write_ion_variable_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8c28e874826634125ad9b5f59511f445", null ], [ "codegen_float_variables", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae63ddf806884e983a264346f21794168", null ], [ "codegen_global_variables", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2a1e5337a20e3f1dad1d1dfbb89fbb1b", null ], [ "codegen_int_variables", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a661794563709a984308164abcdd543ee", null ], diff --git a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor-members.html b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor-members.html index da897b8b3b..f48631ac1d 100644 --- a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor-members.html +++ b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor-members.html @@ -99,15 +99,17 @@ - - - - - - - - - + + + + + + + + + + + @@ -137,6 +139,10 @@ + + + + @@ -156,77 +162,81 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + @@ -350,7 +360,8 @@ - + +
add_escape_quote(const std::string &text) constnmodl::codegen::CodegenCppVisitorinlineprotected
backend_name() const overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
breakpoint_exist() const noexceptnmodl::codegen::CodegenCppVisitorprotected
codegen_float_variablesnmodl::codegen::CodegenCppVisitorprotected
codegen_global_variablesnmodl::codegen::CodegenCppVisitorprotected
codegen_int_variablesnmodl::codegen::CodegenCppVisitorprotected
CodegenCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenCppVisitorinlineprotected
CodegenCppVisitor(std::string mod_filename, std::ostream &stream, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenCppVisitorinlineprotected
CodegenNeuronCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenNeuronCppVisitorinline
CodegenNeuronCppVisitor(std::string mod_filename, std::ostream &stream, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenNeuronCppVisitorinline
compute_method_name(BlockType type) constnmodl::codegen::CodegenCppVisitorprotected
breakpoint_current(std::string current) constnmodl::codegen::CodegenCppVisitorprotected
breakpoint_exist() const noexceptnmodl::codegen::CodegenCppVisitorprotected
codegen_float_variablesnmodl::codegen::CodegenCppVisitorprotected
codegen_global_variablesnmodl::codegen::CodegenCppVisitorprotected
codegen_int_variablesnmodl::codegen::CodegenCppVisitorprotected
CodegenCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenCppVisitorinlineprotected
CodegenCppVisitor(std::string mod_filename, std::ostream &stream, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenCppVisitorinlineprotected
CodegenNeuronCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenNeuronCppVisitorinline
CodegenNeuronCppVisitor(std::string mod_filename, std::ostream &stream, std::string float_type, const bool optimize_ionvar_copies)nmodl::codegen::CodegenNeuronCppVisitorinline
compute_method_name(BlockType type) constnmodl::codegen::CodegenCppVisitorprotected
conc_write_statement(const std::string &ion_name, const std::string &concentration, int index) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
current_watch_statementnmodl::codegen::CodegenCppVisitorprotected
default_float_data_type() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
default_int_data_type() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
internal_method_arguments() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
internal_method_call_encounterednmodl::codegen::CodegenCppVisitorprotected
internal_method_parameters() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
ion_read_statements(BlockType type) constnmodl::codegen::CodegenCppVisitorprotected
ion_read_statements_optimized(BlockType type) constnmodl::codegen::CodegenCppVisitorprotected
ion_variable_struct_required() constnmodl::codegen::CodegenCppVisitorprotected
ion_write_statements(BlockType type)nmodl::codegen::CodegenCppVisitorprotected
is_net_event(const std::string &name) const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
is_net_move(const std::string &name) const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
is_net_send(const std::string &name) const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
nrn_thread_internal_arguments() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
operator_for_d() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
operator_for_rhs() const noexceptnmodl::codegen::CodegenCppVisitorinlineprotected
optimize_ionvar_copiesnmodl::codegen::CodegenCppVisitorprotected
ParamVector typedefnmodl::codegen::CodegenCppVisitorprotected
position_of_float_var(const std::string &name) const overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
position_of_int_var(const std::string &name) const overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_atomic_reduction_pragma() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_backend_info() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_codegen_routines() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_compute_functions() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_data_structures(bool print_initializers) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_fast_imem_calculation() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_function(const ast::FunctionBlock &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_function_call(const ast::FunctionCall &node)nmodl::codegen::CodegenCppVisitorprotectedvirtual
print_function_declaration(const T &node, const std::string &name)nmodl::codegen::CodegenNeuronCppVisitorprotected
print_function_or_procedure(const ast::Block &node, const std::string &name) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_function_procedure_helper(const ast::Block &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_function_prototypes() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_g_unused() const overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_global_function_common_code(BlockType type, const std::string &function_name="") overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_global_macros()nmodl::codegen::CodegenNeuronCppVisitorprotected
print_global_var_struct_assertions() constnmodl::codegen::CodegenCppVisitorprotectedvirtual
print_global_var_struct_decl()nmodl::codegen::CodegenCppVisitorprotectedvirtual
print_global_variables_for_hoc() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_headers_include() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_initial_block(const ast::InitialBlock *node)nmodl::codegen::CodegenNeuronCppVisitorprotected
print_macro_definitions()nmodl::codegen::CodegenNeuronCppVisitorprotected
print_make_instance() constnmodl::codegen::CodegenNeuronCppVisitorprotected
print_mechanism_global_var_structure(bool print_initializers) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_mechanism_info()nmodl::codegen::CodegenCppVisitorprotected
print_mechanism_range_var_structure(bool print_initializers) overridenmodl::codegen::CodegenNeuronCppVisitorvirtual
print_mechanism_register() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_mechanism_variables_macros()nmodl::codegen::CodegenNeuronCppVisitorprotected
print_namespace_begin() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_namespace_end() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_namespace_start() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_namespace_stop() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_net_event_call(const ast::FunctionCall &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_net_move_call(const ast::FunctionCall &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_net_send_call(const ast::FunctionCall &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_neuron_includes()nmodl::codegen::CodegenNeuronCppVisitorprotected
print_nmodl_constants()nmodl::codegen::CodegenCppVisitorprotected
print_nrn_alloc() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_constructor() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_cur() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_cur_kernel(const ast::BreakpointBlock &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_cur_non_conductance_kernel() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_current(const ast::BreakpointBlock &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_destructor() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_init(bool skip_init_check=true)nmodl::codegen::CodegenNeuronCppVisitorprotected
print_nrn_jacob()nmodl::codegen::CodegenNeuronCppVisitorprotected
print_nrn_state() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_prcellstate_macros() constnmodl::codegen::CodegenCppVisitorprotected
print_procedure(const ast::ProcedureBlock &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_sdlists_init(bool print_initializers) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_standard_includes() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_statement_block(const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)nmodl::codegen::CodegenCppVisitorprotected
print_v_unused() const overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_vector_elements(const std::vector< T > &elements, const std::string &separator, const std::string &prefix="")nmodl::codegen::CodegenCppVisitorprotected
printernmodl::codegen::CodegenCppVisitorprotected
printing_net_initnmodl::codegen::CodegenCppVisitorprotected
printing_net_receivenmodl::codegen::CodegenCppVisitorprotected
printing_top_verbatim_blocksnmodl::codegen::CodegenCppVisitorprotected
optimize_ion_variable_copies() const overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
optimize_ionvar_copiesnmodl::codegen::CodegenCppVisitorprotected
ParamVector typedefnmodl::codegen::CodegenCppVisitorprotected
position_of_float_var(const std::string &name) const overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
position_of_int_var(const std::string &name) const overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_atomic_reduction_pragma() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_backend_info() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_codegen_routines() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_compute_functions() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_data_structures(bool print_initializers) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_fast_imem_calculation() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_function(const ast::FunctionBlock &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_function_call(const ast::FunctionCall &node)nmodl::codegen::CodegenCppVisitorprotectedvirtual
print_function_declaration(const T &node, const std::string &name)nmodl::codegen::CodegenNeuronCppVisitorprotected
print_function_or_procedure(const ast::Block &node, const std::string &name) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_function_procedure_helper(const ast::Block &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_function_prototypes() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_g_unused() const overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_global_function_common_code(BlockType type, const std::string &function_name="") overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_global_macros()nmodl::codegen::CodegenNeuronCppVisitorprotected
print_global_var_struct_assertions() constnmodl::codegen::CodegenCppVisitorprotectedvirtual
print_global_var_struct_decl()nmodl::codegen::CodegenCppVisitorprotectedvirtual
print_global_variables_for_hoc() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_headers_include() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_initial_block(const ast::InitialBlock *node)nmodl::codegen::CodegenNeuronCppVisitorprotected
print_macro_definitions()nmodl::codegen::CodegenNeuronCppVisitorprotected
print_make_instance() constnmodl::codegen::CodegenNeuronCppVisitorprotected
print_mechanism_global_var_structure(bool print_initializers) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_mechanism_info()nmodl::codegen::CodegenCppVisitorprotected
print_mechanism_range_var_structure(bool print_initializers) overridenmodl::codegen::CodegenNeuronCppVisitorvirtual
print_mechanism_register() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_mechanism_variables_macros()nmodl::codegen::CodegenNeuronCppVisitorprotected
print_namespace_begin() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_namespace_end() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_namespace_start() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_namespace_stop() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_net_event_call(const ast::FunctionCall &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_net_move_call(const ast::FunctionCall &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_net_send_call(const ast::FunctionCall &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_neuron_includes()nmodl::codegen::CodegenNeuronCppVisitorprotected
print_nmodl_constants()nmodl::codegen::CodegenCppVisitorprotected
print_nrn_alloc() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_constructor() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_cur() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_cur_kernel(const ast::BreakpointBlock &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_cur_non_conductance_kernel() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_current(const ast::BreakpointBlock &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_destructor() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_nrn_init(bool skip_init_check=true)nmodl::codegen::CodegenNeuronCppVisitorprotected
print_nrn_jacob()nmodl::codegen::CodegenNeuronCppVisitorprotected
print_nrn_state() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_prcellstate_macros() constnmodl::codegen::CodegenCppVisitorprotected
print_procedure(const ast::ProcedureBlock &node) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_sdlists_init(bool print_initializers) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_standard_includes() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_statement_block(const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)nmodl::codegen::CodegenCppVisitorprotected
print_v_unused() const overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
print_vector_elements(const std::vector< T > &elements, const std::string &separator, const std::string &prefix="")nmodl::codegen::CodegenCppVisitorprotected
printernmodl::codegen::CodegenCppVisitorprotected
printing_net_initnmodl::codegen::CodegenCppVisitorprotected
printing_net_receivenmodl::codegen::CodegenCppVisitorprotected
printing_top_verbatim_blocksnmodl::codegen::CodegenCppVisitorprotected
process_shadow_update_statement(const ShadowUseStatement &statement, BlockType type)nmodl::codegen::CodegenCppVisitorprotected
process_verbatim_text(std::string const &text) overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
program_symtabnmodl::codegen::CodegenCppVisitorprotected
range_variable_setup_required() const noexceptnmodl::codegen::CodegenCppVisitorprotected
register_mechanism_arguments() const overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
rename_function_arguments()nmodl::codegen::CodegenCppVisitorprotected
setup(const ast::Program &node)nmodl::codegen::CodegenCppVisitor
simulator_name() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
statement_to_skip(const ast::Statement &node)nmodl::codegen::CodegenCppVisitorprotectedstatic
SymbolType typedefnmodl::codegen::CodegenCppVisitorprotected
read_ion_variable_name(const std::string &name)nmodl::codegen::CodegenCppVisitorprotectedstatic
register_mechanism_arguments() const overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
rename_function_arguments()nmodl::codegen::CodegenCppVisitorprotected
setup(const ast::Program &node)nmodl::codegen::CodegenCppVisitor
simulator_name() overridenmodl::codegen::CodegenNeuronCppVisitorprotectedvirtual
statement_to_skip(const ast::Statement &node)nmodl::codegen::CodegenCppVisitorprotectedstatic
SymbolType typedefnmodl::codegen::CodegenCppVisitorprotected
update_if_ion_variable_name(const std::string &name) constnmodl::codegen::CodegenCppVisitorprotected
update_index_semantics()nmodl::codegen::CodegenCppVisitorprotected
visit_after_block(const ast::AfterBlock &node) overridenmodl::visitor::ConstAstVisitorvirtual
visit_argument(const ast::Argument &node) overridenmodl::visitor::ConstAstVisitorvirtual
visit_while_statement(const ast::WhileStatement &node) overridenmodl::codegen::CodegenCppVisitorprotectedvirtual
visit_wrapped_expression(const ast::WrappedExpression &node) overridenmodl::visitor::ConstAstVisitorvirtual
visit_write_ion_var(const ast::WriteIonVar &node) overridenmodl::visitor::ConstAstVisitorvirtual
~ConstVisitor()=defaultnmodl::visitor::ConstVisitorvirtual
write_ion_variable_name(const std::string &name)nmodl::codegen::CodegenCppVisitorprotectedstatic
~ConstVisitor()=defaultnmodl::visitor::ConstVisitorvirtual
diff --git a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html index 637d8e4b9d..9ff5bd118c 100644 --- a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html +++ b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html @@ -530,6 +530,9 @@ virtual void print_atomic_reduction_pragma () override  Print atomic update pragma for reduction statements. More...
  +bool optimize_ion_variable_copies () const override + Check if ion variable copies should be avoided. More...
+  void print_net_send_call (const ast::FunctionCall &node) override  Print call to net_send. More...
  @@ -578,6 +581,9 @@ std::string register_mechanism_arguments () const override  Arguments for register_mech or point_register_mech function. More...
  +std::string conc_write_statement (const std::string &ion_name, const std::string &concentration, int index) override + Generate Function call statement for nrn_wrote_conc. More...
+  void print_namespace_start () override  Prints the start of the neuron namespace. More...
  @@ -735,6 +741,9 @@ std::string get_channel_info_var_name () const noexcept  Name of channel info variable. More...
  +bool ion_variable_struct_required () const + Check if a structure for ion variables is required. More...
+  template<typename T > bool has_parameter_of_name (const T &node, const std::string &name)  Check if function or procedure node has parameter with given name. More...
@@ -796,6 +805,21 @@ std::vector< IndexVariableInfoget_int_variables ()  Determine all int variables required during code generation. More...
  +std::vector< std::string > ion_read_statements (BlockType type) const + For a given output block type, return statements for all read ion variables. More...
+  +std::vector< std::string > ion_read_statements_optimized (BlockType type) const + For a given output block type, return minimal statements for all read ion variables. More...
+  +std::vector< ShadowUseStatemention_write_statements (BlockType type) + For a given output block type, return statements for writing back ion variables. More...
+  +std::string process_shadow_update_statement (const ShadowUseStatement &statement, BlockType type) + Process shadow update statement. More...
+  +std::string breakpoint_current (std::string current) const + Determine the variable name for the "current" used in breakpoint block taking into account intermediate code transformations. More...
+  virtual void print_global_var_struct_decl ()  Instantiate global var instance. More...
  @@ -821,6 +845,9 @@ SymbolType make_symbol (const std::string &name) const  Creates a temporary symbol. More...
  +std::string update_if_ion_variable_name (const std::string &name) const + Determine the updated name if the ion variable has been optimized. More...
+  virtual void print_global_var_struct_assertions () const  Print static assertions about the global variable struct. More...
  @@ -942,6 +969,12 @@ static bool statement_to_skip (const ast::Statement &node)  Check if given statement should be skipped during code generation. More...
  +static std::pair< std::string, std::string > read_ion_variable_name (const std::string &name) + Return ion variable name and corresponding ion read variable name. More...
+  +static std::pair< std::string, std::string > write_ion_variable_name (const std::string &name) + Return ion variable name and corresponding ion write variable name. More...
- Protected Attributes inherited from nmodl::codegen::CodegenCppVisitor std::unique_ptr< CodePrinterprinter  Code printer object for target (C++) More...
@@ -1048,7 +1081,7 @@

Definition at line 597 of file codegen_neuron_cpp_visitor.hpp.

+

Definition at line 605 of file codegen_neuron_cpp_visitor.hpp.

@@ -1110,7 +1143,7 @@

Definition at line 619 of file codegen_neuron_cpp_visitor.hpp.

+

Definition at line 627 of file codegen_neuron_cpp_visitor.hpp.

@@ -1144,6 +1177,63 @@

Definition at line 40 of file codegen_neuron_cpp_visitor.cpp.

+ + + +

◆ conc_write_statement()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::string nmodl::codegen::CodegenNeuronCppVisitor::conc_write_statement (const std::string & ion_name,
const std::string & concentration,
int index 
)
+
+overrideprotectedvirtual
+
+ +

Generate Function call statement for nrn_wrote_conc.

+
Parameters
+ + + + +
ion_nameThe name of the ion variable
concentrationThe name of the concentration variable
index
+
+
+
Returns
The string representing the function call
+ +

Implements nmodl::codegen::CodegenCppVisitor.

+ +

Definition at line 201 of file codegen_neuron_cpp_visitor.cpp.

+
@@ -1175,7 +1265,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 143 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 150 of file codegen_neuron_cpp_visitor.cpp.

@@ -1215,7 +1305,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 149 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 156 of file codegen_neuron_cpp_visitor.cpp.

@@ -1267,7 +1357,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 200 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 213 of file codegen_neuron_cpp_visitor.cpp.

@@ -1317,7 +1407,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 238 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 251 of file codegen_neuron_cpp_visitor.cpp.

@@ -1367,7 +1457,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 228 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 241 of file codegen_neuron_cpp_visitor.cpp.

@@ -1426,7 +1516,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 221 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 234 of file codegen_neuron_cpp_visitor.cpp.

@@ -1459,7 +1549,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 131 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 138 of file codegen_neuron_cpp_visitor.cpp.

@@ -1492,7 +1582,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 137 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 144 of file codegen_neuron_cpp_visitor.cpp.

@@ -1524,7 +1614,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 155 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 162 of file codegen_neuron_cpp_visitor.cpp.

@@ -1556,7 +1646,38 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 161 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 168 of file codegen_neuron_cpp_visitor.cpp.

+ + + + +

◆ optimize_ion_variable_copies()

+ +
+
+ + + + + +
+ + + + + + + +
bool nmodl::codegen::CodegenNeuronCppVisitor::optimize_ion_variable_copies () const
+
+overrideprotectedvirtual
+
+ +

Check if ion variable copies should be avoided.

+ +

Implements nmodl::codegen::CodegenCppVisitor.

+ +

Definition at line 86 of file codegen_neuron_cpp_visitor.cpp.

@@ -1697,7 +1818,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 310 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 323 of file codegen_neuron_cpp_visitor.cpp.

@@ -1729,7 +1850,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 916 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 929 of file codegen_neuron_cpp_visitor.cpp.

@@ -1761,7 +1882,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 907 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 920 of file codegen_neuron_cpp_visitor.cpp.

@@ -1799,7 +1920,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 878 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 891 of file codegen_neuron_cpp_visitor.cpp.

@@ -1831,7 +1952,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 784 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 797 of file codegen_neuron_cpp_visitor.cpp.

@@ -1870,7 +1991,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 120 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 127 of file codegen_neuron_cpp_visitor.cpp.

@@ -1920,7 +2041,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 101 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 108 of file codegen_neuron_cpp_visitor.cpp.

@@ -1959,7 +2080,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 108 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 115 of file codegen_neuron_cpp_visitor.cpp.

@@ -1991,7 +2112,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 93 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 100 of file codegen_neuron_cpp_visitor.cpp.

@@ -2022,7 +2143,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 897 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 910 of file codegen_neuron_cpp_visitor.cpp.

@@ -2070,7 +2191,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 665 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 678 of file codegen_neuron_cpp_visitor.cpp.

@@ -2099,7 +2220,7 @@

Definition at line 822 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 835 of file codegen_neuron_cpp_visitor.cpp.

@@ -2132,7 +2253,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 484 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 497 of file codegen_neuron_cpp_visitor.cpp.

@@ -2163,7 +2284,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 810 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 823 of file codegen_neuron_cpp_visitor.cpp.

@@ -2193,7 +2314,7 @@

Definition at line 656 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 669 of file codegen_neuron_cpp_visitor.cpp.

@@ -2222,7 +2343,7 @@

Definition at line 816 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 829 of file codegen_neuron_cpp_visitor.cpp.

@@ -2251,7 +2372,7 @@

Definition at line 533 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 546 of file codegen_neuron_cpp_visitor.cpp.

@@ -2290,7 +2411,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 396 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 409 of file codegen_neuron_cpp_visitor.cpp.

@@ -2328,7 +2449,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 616 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 629 of file codegen_neuron_cpp_visitor.cpp.

@@ -2360,7 +2481,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 558 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 571 of file codegen_neuron_cpp_visitor.cpp.

@@ -2390,7 +2511,7 @@

Definition at line 839 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 852 of file codegen_neuron_cpp_visitor.cpp.

@@ -2421,7 +2542,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 868 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 881 of file codegen_neuron_cpp_visitor.cpp.

@@ -2452,7 +2573,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 873 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 886 of file codegen_neuron_cpp_visitor.cpp.

@@ -2483,7 +2604,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 183 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 190 of file codegen_neuron_cpp_visitor.cpp.

@@ -2514,7 +2635,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 189 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 196 of file codegen_neuron_cpp_visitor.cpp.

@@ -2552,7 +2673,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 941 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 954 of file codegen_neuron_cpp_visitor.cpp.

@@ -2590,7 +2711,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 937 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 950 of file codegen_neuron_cpp_visitor.cpp.

@@ -2628,7 +2749,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 933 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 946 of file codegen_neuron_cpp_visitor.cpp.

@@ -2657,7 +2778,7 @@

Definition at line 343 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 356 of file codegen_neuron_cpp_visitor.cpp.

@@ -2689,7 +2810,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 715 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 728 of file codegen_neuron_cpp_visitor.cpp.

@@ -2721,7 +2842,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 703 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 716 of file codegen_neuron_cpp_visitor.cpp.

@@ -2754,7 +2875,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 790 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 803 of file codegen_neuron_cpp_visitor.cpp.

@@ -2794,7 +2915,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 766 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 779 of file codegen_neuron_cpp_visitor.cpp.

@@ -2833,7 +2954,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 778 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 791 of file codegen_neuron_cpp_visitor.cpp.

@@ -2866,7 +2987,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 772 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 785 of file codegen_neuron_cpp_visitor.cpp.

@@ -2906,7 +3027,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 760 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 773 of file codegen_neuron_cpp_visitor.cpp.

@@ -2938,7 +3059,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 709 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 722 of file codegen_neuron_cpp_visitor.cpp.

@@ -2974,7 +3095,7 @@

Definition at line 679 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 692 of file codegen_neuron_cpp_visitor.cpp.

@@ -3003,7 +3124,7 @@

Definition at line 691 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 704 of file codegen_neuron_cpp_visitor.cpp.

@@ -3035,7 +3156,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 730 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 743 of file codegen_neuron_cpp_visitor.cpp.

@@ -3074,7 +3195,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 114 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 121 of file codegen_neuron_cpp_visitor.cpp.

@@ -3109,7 +3230,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 354 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 367 of file codegen_neuron_cpp_visitor.cpp.

@@ -3140,7 +3261,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 330 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 343 of file codegen_neuron_cpp_visitor.cpp.

@@ -3171,7 +3292,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 885 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 898 of file codegen_neuron_cpp_visitor.cpp.

@@ -3211,7 +3332,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 167 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 174 of file codegen_neuron_cpp_visitor.cpp.

@@ -3243,7 +3364,7 @@

nmodl::codegen::CodegenCppVisitor.

-

Definition at line 173 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 180 of file codegen_neuron_cpp_visitor.cpp.

@@ -3306,7 +3427,7 @@

nmodl::visitor::ConstVisitor.

-

Definition at line 951 of file codegen_neuron_cpp_visitor.cpp.

+

Definition at line 964 of file codegen_neuron_cpp_visitor.cpp.

diff --git a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.js b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.js index da40d4bab3..d16b39b0ce 100644 --- a/html/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.js +++ b/html/doxygen/classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.js @@ -3,6 +3,7 @@ var classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor = [ "CodegenNeuronCppVisitor", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aef77df54b474011a077b79e3b9126433", null ], [ "CodegenNeuronCppVisitor", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8dc54bf1b8cfca4663fffa7fb5444975", null ], [ "backend_name", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a89c5a0f046f8752579636a3db97d669a", null ], + [ "conc_write_statement", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a593b6a70562ebbf42e13fea3b03d9174", null ], [ "external_method_arguments", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a14b770116ea7a9580c6d82d7a2bb1bc1", null ], [ "external_method_parameters", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a6e501a98cc559afd172f898fa0d7cef7", null ], [ "float_variable_name", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acfd3c1256b1d34de5fef97cff079cb8a", null ], @@ -13,6 +14,7 @@ var classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor = [ "internal_method_parameters", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a68499754b87764b2eba30bf38a1edbb4", null ], [ "nrn_thread_arguments", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af6676bc4b255a87e484bc2641d64b713", null ], [ "nrn_thread_internal_arguments", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa08a55bc62e18a9c545e8903dd3b1530", null ], + [ "optimize_ion_variable_copies", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a70bd9cedc2fcae2e924ebcc59c7f728b", null ], [ "position_of_float_var", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#afdd6466ebac569ec670c3b6f4ca11d3e", null ], [ "position_of_int_var", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8c348f1869653cec3dcc39b1866bab97", null ], [ "print_atomic_reduction_pragma", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a910f9f22e6fbdae4eefae177eb8910f9", null ], diff --git a/html/doxygen/codegen__acc__visitor_8cpp_source.html b/html/doxygen/codegen__acc__visitor_8cpp_source.html index 25c213a8e6..e4974c4e13 100644 --- a/html/doxygen/codegen__acc__visitor_8cpp_source.html +++ b/html/doxygen/codegen__acc__visitor_8cpp_source.html @@ -496,11 +496,11 @@
void print_nrn_cur_matrix_shadow_update() override
update to matrix elements with/without shadow vectors
void print_instance_struct_copy_to_device() override
call helper function for copying the instance struct to the device
void print_rhs_d_shadow_variables() override
setup method for setting matrix shadow vectors
-
virtual void print_memory_allocation_routine() const
Print memory allocation routine.
+
virtual void print_memory_allocation_routine() const
Print memory allocation routine.
@ NetReceive
net_receive block
bool point_process
if mod file is point process
virtual void print_dt_update_to_device() const override
update dt from host to device
-
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
+
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
void print_global_variable_device_update_annotation() override
update global variable from host to the device
bool electrode_current
if electrode current specified
void print_kernel_data_present_annotation_block_end() override
end of annotation like "acc enter data"
diff --git a/html/doxygen/codegen__coreneuron__cpp__visitor_8hpp_source.html b/html/doxygen/codegen__coreneuron__cpp__visitor_8hpp_source.html index 831801707d..63bb1c6113 100644 --- a/html/doxygen/codegen__coreneuron__cpp__visitor_8hpp_source.html +++ b/html/doxygen/codegen__coreneuron__cpp__visitor_8hpp_source.html @@ -209,1364 +209,1273 @@
113 
114 
115  /**
-
116  * Determine the variable name for the "current" used in breakpoint block taking into account
-
117  * intermediate code transformations.
-
118  * \param current The variable name for the current used in the model
-
119  * \return The name for the current to be printed in C++
-
120  */
-
121  std::string breakpoint_current(std::string current) const;
-
122 
-
123 
-
124  /**
-
125  * For a given output block type, return statements for all read ion variables
-
126  *
-
127  * \param type The type of code block being generated
-
128  * \return A \c vector of strings representing the reading of ion variables
-
129  */
-
130  std::vector<std::string> ion_read_statements(BlockType type) const;
-
131 
-
132 
-
133  /**
-
134  * For a given output block type, return minimal statements for all read ion variables
-
135  *
-
136  * \param type The type of code block being generated
-
137  * \return A \c vector of strings representing the reading of ion variables
+
116  * Process a token in a verbatim block for possible variable renaming
+
117  * \param token The verbatim token to be processed
+
118  * \return The code after variable renaming
+
119  */
+
120  std::string process_verbatim_token(const std::string& token);
+
121 
+
122 
+
123  /**
+
124  * Check if variable is qualified as constant
+
125  * \param name The name of variable
+
126  * \return \c true if it is constant
+
127  */
+
128  virtual bool is_constant_variable(const std::string& name) const;
+
129 
+
130 
+
131  /****************************************************************************************/
+
132  /* Backend specific routines */
+
133  /****************************************************************************************/
+
134 
+
135 
+
136  /**
+
137  * Print the code to copy derivative advance flag to device
138  */
-
139  std::vector<std::string> ion_read_statements_optimized(BlockType type) const;
+
139  virtual void print_deriv_advance_flag_transfer_to_device() const;
140 
141 
142  /**
-
143  * For a given output block type, return statements for writing back ion variables
-
144  *
-
145  * \param type The type of code block being generated
-
146  * \return A \c vector of strings representing the write-back of ion variables
-
147  */
-
148  std::vector<ShadowUseStatement> ion_write_statements(BlockType type);
-
149 
-
150 
-
151  /**
-
152  * Process a token in a verbatim block for possible variable renaming
-
153  * \param token The verbatim token to be processed
-
154  * \return The code after variable renaming
-
155  */
-
156  std::string process_verbatim_token(const std::string& token);
-
157 
-
158 
-
159  /**
-
160  * Check if a structure for ion variables is required
-
161  * \return \c true if a structure fot ion variables must be generated
+
143  * Print pragma annotation for increase and capture of variable in automatic way
+
144  */
+
145  virtual void print_device_atomic_capture_annotation() const;
+
146 
+
147 
+
148  /**
+
149  * Print the code to update NetSendBuffer_t count from device to host
+
150  */
+
151  virtual void print_net_send_buf_count_update_to_host() const;
+
152 
+
153 
+
154  /**
+
155  * Print the code to update NetSendBuffer_t from device to host
+
156  */
+
157  virtual void print_net_send_buf_update_to_host() const;
+
158 
+
159 
+
160  /**
+
161  * Print the code to update NetSendBuffer_t count from host to device
162  */
-
163  bool ion_variable_struct_required() const;
-
164 
-
165 
-
166  /**
-
167  * Check if variable is qualified as constant
-
168  * \param name The name of variable
-
169  * \return \c true if it is constant
-
170  */
-
171  virtual bool is_constant_variable(const std::string& name) const;
-
172 
-
173 
-
174  /****************************************************************************************/
-
175  /* Backend specific routines */
-
176  /****************************************************************************************/
-
177 
-
178 
-
179  /**
-
180  * Print the code to copy derivative advance flag to device
-
181  */
-
182  virtual void print_deriv_advance_flag_transfer_to_device() const;
-
183 
-
184 
-
185  /**
-
186  * Print pragma annotation for increase and capture of variable in automatic way
-
187  */
-
188  virtual void print_device_atomic_capture_annotation() const;
-
189 
-
190 
-
191  /**
-
192  * Print the code to update NetSendBuffer_t count from device to host
-
193  */
-
194  virtual void print_net_send_buf_count_update_to_host() const;
-
195 
-
196 
-
197  /**
-
198  * Print the code to update NetSendBuffer_t from device to host
-
199  */
-
200  virtual void print_net_send_buf_update_to_host() const;
-
201 
-
202 
-
203  /**
-
204  * Print the code to update NetSendBuffer_t count from host to device
-
205  */
-
206  virtual void print_net_send_buf_count_update_to_device() const;
-
207 
-
208  /**
-
209  * Print the code to update dt from host to device
-
210  */
-
211  virtual void print_dt_update_to_device() const;
-
212 
-
213  /**
-
214  * Print the code to synchronise/wait on stream specific to NrnThread
-
215  */
-
216  virtual void print_device_stream_wait() const;
-
217 
-
218 
-
219  /**
-
220  * Print accelerator annotations indicating data presence on device
-
221  */
- -
223 
-
224 
-
225  /**
-
226  * Print matching block end of accelerator annotations for data presence on device
-
227  */
- -
229 
-
230 
-
231  /**
-
232  * Print accelerator kernels begin annotation for net_init kernel
+
163  virtual void print_net_send_buf_count_update_to_device() const;
+
164 
+
165  /**
+
166  * Print the code to update dt from host to device
+
167  */
+
168  virtual void print_dt_update_to_device() const;
+
169 
+
170  /**
+
171  * Print the code to synchronise/wait on stream specific to NrnThread
+
172  */
+
173  virtual void print_device_stream_wait() const;
+
174 
+
175 
+
176  /**
+
177  * Print accelerator annotations indicating data presence on device
+
178  */
+ +
180 
+
181 
+
182  /**
+
183  * Print matching block end of accelerator annotations for data presence on device
+
184  */
+ +
186 
+
187 
+
188  /**
+
189  * Print accelerator kernels begin annotation for net_init kernel
+
190  */
+ +
192 
+
193 
+
194  /**
+
195  * Print accelerator kernels end annotation for net_init kernel
+
196  */
+ +
198 
+
199 
+
200  /**
+
201  * Print pragma annotations for channel iterations
+
202  *
+
203  * This can be overriden by backends to provide additonal annotations or pragmas to enable
+
204  * for example SIMD code generation (e.g. through \c ivdep)
+
205  * The default implementation prints
+
206  *
+
207  * \code
+
208  * #pragma ivdep
+
209  * \endcode
+
210  *
+
211  * \param type The block type
+
212  */
+ +
214  const ast::Block* block);
+
215 
+
216 
+
217  /**
+
218  * Check if reduction block in \c nrn\_cur required
+
219  */
+
220  virtual bool nrn_cur_reduction_loop_required();
+
221 
+
222 
+
223  /**
+
224  * Print the setup method for setting matrix shadow vectors
+
225  *
+
226  */
+
227  virtual void print_rhs_d_shadow_variables();
+
228 
+
229 
+
230  /**
+
231  * Print the update to matrix elements with/without shadow vectors
+
232  *
233  */
- +
234  virtual void print_nrn_cur_matrix_shadow_update();
235 
236 
237  /**
-
238  * Print accelerator kernels end annotation for net_init kernel
-
239  */
- -
241 
-
242 
-
243  /**
-
244  * Print pragma annotations for channel iterations
-
245  *
-
246  * This can be overriden by backends to provide additonal annotations or pragmas to enable
-
247  * for example SIMD code generation (e.g. through \c ivdep)
-
248  * The default implementation prints
-
249  *
-
250  * \code
-
251  * #pragma ivdep
-
252  * \endcode
-
253  *
-
254  * \param type The block type
-
255  */
- -
257  const ast::Block* block);
-
258 
-
259 
-
260  /**
-
261  * Check if reduction block in \c nrn\_cur required
+
238  * Print the reduction to matrix elements from shadow vectors
+
239  *
+
240  */
+ +
242 
+
243 
+
244  /**
+
245  * Print atomic update pragma for reduction statements
+
246  */
+
247  virtual void print_atomic_reduction_pragma() override;
+
248 
+
249 
+
250  /**
+
251  * Print the backend specific device method annotation
+
252  *
+
253  * \note This is not used for the C++ backend
+
254  */
+
255  virtual void print_device_method_annotation();
+
256 
+
257 
+
258  /**
+
259  * Print backend specific global method annotation
+
260  *
+
261  * \note This is not used for the C++ backend
262  */
-
263  virtual bool nrn_cur_reduction_loop_required();
+
263  virtual void print_global_method_annotation();
264 
265 
266  /**
-
267  * Print the setup method for setting matrix shadow vectors
+
267  * Prints the start of namespace for the backend-specific code
268  *
-
269  */
-
270  virtual void print_rhs_d_shadow_variables();
-
271 
-
272 
-
273  /**
-
274  * Print the update to matrix elements with/without shadow vectors
-
275  *
-
276  */
-
277  virtual void print_nrn_cur_matrix_shadow_update();
-
278 
-
279 
-
280  /**
-
281  * Print the reduction to matrix elements from shadow vectors
-
282  *
-
283  */
- -
285 
-
286 
-
287  /**
-
288  * Print atomic update pragma for reduction statements
-
289  */
-
290  virtual void print_atomic_reduction_pragma() override;
-
291 
-
292 
-
293  /**
-
294  * Print the backend specific device method annotation
-
295  *
-
296  * \note This is not used for the C++ backend
-
297  */
-
298  virtual void print_device_method_annotation();
-
299 
-
300 
-
301  /**
-
302  * Print backend specific global method annotation
-
303  *
-
304  * \note This is not used for the C++ backend
-
305  */
-
306  virtual void print_global_method_annotation();
-
307 
-
308 
-
309  /**
-
310  * Prints the start of namespace for the backend-specific code
-
311  *
-
312  * For the C++ backend no additional namespace is required
-
313  */
-
314  virtual void print_backend_namespace_start();
-
315 
-
316 
-
317  /**
-
318  * Prints the end of namespace for the backend-specific code
-
319  *
-
320  * For the C++ backend no additional namespace is required
-
321  */
-
322  virtual void print_backend_namespace_stop();
-
323 
-
324 
-
325  /**
-
326  * Print backend specific includes (none needed for C++ backend)
-
327  */
-
328  virtual void print_backend_includes();
-
329 
-
330 
-
331  /**
-
332  * Check if ion variable copies should be avoided
-
333  */
-
334  bool optimize_ion_variable_copies() const;
-
335 
-
336 
-
337  /**
-
338  * Print memory allocation routine
+
269  * For the C++ backend no additional namespace is required
+
270  */
+
271  virtual void print_backend_namespace_start();
+
272 
+
273 
+
274  /**
+
275  * Prints the end of namespace for the backend-specific code
+
276  *
+
277  * For the C++ backend no additional namespace is required
+
278  */
+
279  virtual void print_backend_namespace_stop();
+
280 
+
281 
+
282  /**
+
283  * Print backend specific includes (none needed for C++ backend)
+
284  */
+
285  virtual void print_backend_includes();
+
286 
+
287 
+
288  /**
+
289  * Check if ion variable copies should be avoided
+
290  */
+
291  bool optimize_ion_variable_copies() const override;
+
292 
+
293 
+
294  /**
+
295  * Print memory allocation routine
+
296  */
+
297  virtual void print_memory_allocation_routine() const;
+
298 
+
299 
+
300  /**
+
301  * Print backend specific abort routine
+
302  */
+
303  virtual void print_abort_routine() const;
+
304 
+
305 
+
306  /**
+
307  * Print declarations of the functions used by \ref
+
308  * print_instance_struct_copy_to_device and \ref
+
309  * print_instance_struct_delete_from_device.
+
310  */
+ +
312 
+
313  /**
+
314  * Print the definitions of the functions used by \ref
+
315  * print_instance_struct_copy_to_device and \ref
+
316  * print_instance_struct_delete_from_device. Declarations of these functions
+
317  * are printed by \ref print_instance_struct_transfer_routine_declarations.
+
318  *
+
319  * This updates the (pointer) member variables in the device copy of the
+
320  * instance struct to contain device pointers, which is why you must pass a
+
321  * list of names of those member variables.
+
322  *
+
323  * \param ptr_members List of instance struct member names.
+
324  */
+ +
326  std::vector<std::string> const& /* ptr_members */) {}
+
327 
+
328 
+
329  /**
+
330  * Transfer the instance struct to the device. This calls a function
+
331  * declared by \ref print_instance_struct_transfer_routine_declarations.
+
332  */
+ +
334 
+
335 
+
336  /**
+
337  * Delete the instance struct from the device. This calls a function
+
338  * declared by \ref print_instance_struct_transfer_routine_declarations.
339  */
-
340  virtual void print_memory_allocation_routine() const;
+
341 
-
342 
-
343  /**
-
344  * Print backend specific abort routine
-
345  */
-
346  virtual void print_abort_routine() const;
-
347 
-
348 
-
349  /**
-
350  * Print declarations of the functions used by \ref
-
351  * print_instance_struct_copy_to_device and \ref
-
352  * print_instance_struct_delete_from_device.
-
353  */
- -
355 
-
356  /**
-
357  * Print the definitions of the functions used by \ref
-
358  * print_instance_struct_copy_to_device and \ref
-
359  * print_instance_struct_delete_from_device. Declarations of these functions
-
360  * are printed by \ref print_instance_struct_transfer_routine_declarations.
-
361  *
-
362  * This updates the (pointer) member variables in the device copy of the
-
363  * instance struct to contain device pointers, which is why you must pass a
-
364  * list of names of those member variables.
-
365  *
-
366  * \param ptr_members List of instance struct member names.
-
367  */
- -
369  std::vector<std::string> const& /* ptr_members */) {}
-
370 
-
371 
-
372  /**
-
373  * Transfer the instance struct to the device. This calls a function
-
374  * declared by \ref print_instance_struct_transfer_routine_declarations.
-
375  */
- -
377 
-
378 
-
379  /**
-
380  * Delete the instance struct from the device. This calls a function
-
381  * declared by \ref print_instance_struct_transfer_routine_declarations.
-
382  */
- -
384 
-
385 
-
386  /****************************************************************************************/
-
387  /* Printing routines for code generation */
-
388  /****************************************************************************************/
-
389 
-
390 
-
391  /**
-
392  * Print top level (global scope) verbatim blocks
-
393  */
- -
395 
-
396 
-
397  /**
-
398  * Print function and procedures prototype declaration
+
342 
+
343  /****************************************************************************************/
+
344  /* Printing routines for code generation */
+
345  /****************************************************************************************/
+
346 
+
347 
+
348  /**
+
349  * Print top level (global scope) verbatim blocks
+
350  */
+ +
352 
+
353 
+
354  /**
+
355  * Print function and procedures prototype declaration
+
356  */
+
357  void print_function_prototypes() override;
+
358 
+
359 
+
360  /**
+
361  * Check if the given name exist in the symbol
+
362  * \return \c return a tuple <true, array_length> if variable
+
363  * is an array otherwise <false, 0>
+
364  */
+
365  std::tuple<bool, int> check_if_var_is_array(const std::string& name);
+
366 
+
367 
+
368  /**
+
369  * Print \c check\_function() for functions or procedure using table
+
370  * \param node The AST node representing a function or procedure block
+
371  */
+
372  void print_table_check_function(const ast::Block& node);
+
373 
+
374 
+
375  /**
+
376  * Print replacement function for function or procedure using table
+
377  * \param node The AST node representing a function or procedure block
+
378  */
+ +
380 
+
381 
+
382  /**
+
383  * Print check_table functions
+
384  */
+ +
386 
+
387 
+
388  /**
+
389  * Print nmodl function or procedure (common code)
+
390  * \param node the AST node representing the function or procedure in NMODL
+
391  * \param name the name of the function or procedure
+
392  */
+
393  void print_function_or_procedure(const ast::Block& node, const std::string& name) override;
+
394 
+
395 
+
396  /**
+
397  * Common helper function to help printing function or procedure blocks
+
398  * \param node the AST node representing the function or procedure in NMODL
399  */
-
400  void print_function_prototypes() override;
+
400  void print_function_procedure_helper(const ast::Block& node) override;
401 
402 
403  /**
-
404  * Check if the given name exist in the symbol
-
405  * \return \c return a tuple <true, array_length> if variable
-
406  * is an array otherwise <false, 0>
-
407  */
-
408  std::tuple<bool, int> check_if_var_is_array(const std::string& name);
-
409 
-
410 
-
411  /**
-
412  * Print \c check\_function() for functions or procedure using table
-
413  * \param node The AST node representing a function or procedure block
-
414  */
-
415  void print_table_check_function(const ast::Block& node);
-
416 
-
417 
-
418  /**
-
419  * Print replacement function for function or procedure using table
-
420  * \param node The AST node representing a function or procedure block
-
421  */
- +
404  * Print NMODL procedure in target backend code
+
405  * \param node
+
406  */
+
407  virtual void print_procedure(const ast::ProcedureBlock& node) override;
+
408 
+
409 
+
410  /**
+
411  * Print NMODL function in target backend code
+
412  * \param node
+
413  */
+
414  void print_function(const ast::FunctionBlock& node) override;
+
415 
+
416 
+
417  /**
+
418  * Print NMODL function_table in target backend code
+
419  * \param node
+
420  */
+ +
422 
423 
-
424 
-
425  /**
-
426  * Print check_table functions
-
427  */
- -
429 
-
430 
-
431  /**
-
432  * Print nmodl function or procedure (common code)
-
433  * \param node the AST node representing the function or procedure in NMODL
-
434  * \param name the name of the function or procedure
-
435  */
-
436  void print_function_or_procedure(const ast::Block& node, const std::string& name) override;
-
437 
-
438 
-
439  /**
-
440  * Common helper function to help printing function or procedure blocks
-
441  * \param node the AST node representing the function or procedure in NMODL
-
442  */
-
443  void print_function_procedure_helper(const ast::Block& node) override;
-
444 
-
445 
-
446  /**
-
447  * Print NMODL procedure in target backend code
-
448  * \param node
-
449  */
-
450  virtual void print_procedure(const ast::ProcedureBlock& node) override;
-
451 
-
452 
-
453  /**
-
454  * Print NMODL function in target backend code
-
455  * \param node
-
456  */
-
457  void print_function(const ast::FunctionBlock& node) override;
-
458 
-
459 
-
460  /**
-
461  * Print NMODL function_table in target backend code
-
462  * \param node
-
463  */
- -
465 
-
466 
-
467  bool is_functor_const(const ast::StatementBlock& variable_block,
-
468  const ast::StatementBlock& functor_block);
-
469 
-
470 
-
471  /**
-
472  * \brief Based on the \c EigenNewtonSolverBlock passed print the definition needed for its
-
473  * functor
-
474  *
-
475  * \param node \c EigenNewtonSolverBlock for which to print the functor
-
476  */
- -
478 
-
479 
-
480  virtual void print_eigen_linear_solver(const std::string& float_type, int N);
-
481 
+
424  bool is_functor_const(const ast::StatementBlock& variable_block,
+
425  const ast::StatementBlock& functor_block);
+
426 
+
427 
+
428  /**
+
429  * \brief Based on the \c EigenNewtonSolverBlock passed print the definition needed for its
+
430  * functor
+
431  *
+
432  * \param node \c EigenNewtonSolverBlock for which to print the functor
+
433  */
+ +
435 
+
436 
+
437  virtual void print_eigen_linear_solver(const std::string& float_type, int N);
+
438 
+
439 
+
440  /****************************************************************************************/
+
441  /* Code-specific helper routines */
+
442  /****************************************************************************************/
+
443 
+
444 
+
445  /**
+
446  * Arguments for functions that are defined and used internally.
+
447  * \return the method arguments
+
448  */
+
449  std::string internal_method_arguments() override;
+
450 
+
451 
+
452  /**
+
453  * Parameters for internally defined functions
+
454  * \return the method parameters
+
455  */
+ +
457 
+
458 
+
459  /**
+
460  * Arguments for external functions called from generated code
+
461  * \return A string representing the arguments passed to an external function
+
462  */
+
463  const char* external_method_arguments() noexcept override;
+
464 
+
465 
+
466  /**
+
467  * Parameters for functions in generated code that are called back from external code
+
468  *
+
469  * Functions registered in NEURON during initialization for callback must adhere to a prescribed
+
470  * calling convention. This method generates the string representing the function parameters for
+
471  * these externally called functions.
+
472  * \param table
+
473  * \return A string representing the parameters of the function
+
474  */
+
475  const char* external_method_parameters(bool table = false) noexcept override;
+
476 
+
477 
+
478  /**
+
479  * Arguments for "_threadargs_" macro in neuron implementation
+
480  */
+
481  std::string nrn_thread_arguments() const override;
482 
-
483  /****************************************************************************************/
-
484  /* Code-specific helper routines */
-
485  /****************************************************************************************/
-
486 
-
487 
-
488  /**
-
489  * Arguments for functions that are defined and used internally.
-
490  * \return the method arguments
-
491  */
-
492  std::string internal_method_arguments() override;
-
493 
-
494 
-
495  /**
-
496  * Parameters for internally defined functions
-
497  * \return the method parameters
-
498  */
- -
500 
-
501 
-
502  /**
-
503  * Arguments for external functions called from generated code
-
504  * \return A string representing the arguments passed to an external function
-
505  */
-
506  const char* external_method_arguments() noexcept override;
-
507 
-
508 
-
509  /**
-
510  * Parameters for functions in generated code that are called back from external code
-
511  *
-
512  * Functions registered in NEURON during initialization for callback must adhere to a prescribed
-
513  * calling convention. This method generates the string representing the function parameters for
-
514  * these externally called functions.
-
515  * \param table
-
516  * \return A string representing the parameters of the function
-
517  */
-
518  const char* external_method_parameters(bool table = false) noexcept override;
-
519 
-
520 
-
521  /**
-
522  * Arguments for "_threadargs_" macro in neuron implementation
-
523  */
-
524  std::string nrn_thread_arguments() const override;
-
525 
-
526 
-
527  /**
-
528  * Arguments for "_threadargs_" macro in neuron implementation
-
529  */
-
530  std::string nrn_thread_internal_arguments() override;
-
531 
-
532 
-
533  /**
-
534  * Replace commonly used verbatim variables
-
535  * \param name A variable name to be checked and possibly updated
-
536  * \return The possibly replace variable name
-
537  */
-
538  std::string replace_if_verbatim_variable(std::string name);
-
539 
-
540 
-
541  /**
-
542  * Process a verbatim block for possible variable renaming
-
543  * \param text The verbatim code to be processed
-
544  * \return The code with all variables renamed as needed
+
483 
+
484  /**
+
485  * Arguments for "_threadargs_" macro in neuron implementation
+
486  */
+
487  std::string nrn_thread_internal_arguments() override;
+
488 
+
489 
+
490  /**
+
491  * Replace commonly used verbatim variables
+
492  * \param name A variable name to be checked and possibly updated
+
493  * \return The possibly replace variable name
+
494  */
+
495  std::string replace_if_verbatim_variable(std::string name);
+
496 
+
497 
+
498  /**
+
499  * Process a verbatim block for possible variable renaming
+
500  * \param text The verbatim code to be processed
+
501  * \return The code with all variables renamed as needed
+
502  */
+
503  std::string process_verbatim_text(std::string const& text) override;
+
504 
+
505 
+
506  /**
+
507  * Arguments for register_mech or point_register_mech function
+
508  */
+
509  std::string register_mechanism_arguments() const override;
+
510 
+
511 
+
512  /**
+
513  * Generate Function call statement for nrn_wrote_conc
+
514  * \param ion_name The name of the ion variable
+
515  * \param concentration The name of the concentration variable
+
516  * \param index
+
517  * \return The string representing the function call
+
518  */
+
519  std::string conc_write_statement(const std::string& ion_name,
+
520  const std::string& concentration,
+
521  int index) override;
+
522 
+
523  /****************************************************************************************/
+
524  /* Code-specific printing routines for code generations */
+
525  /****************************************************************************************/
+
526 
+
527 
+
528  /**
+
529  * Print the getter method for index position of first pointer variable
+
530  *
+
531  */
+ +
533 
+
534 
+
535  /**
+
536  * Print the getter method for index position of first RANDOM variable
+
537  *
+
538  */
+ +
540 
+
541 
+
542  /**
+
543  * Print the getter methods for float and integer variables count
+
544  *
545  */
-
546  std::string process_verbatim_text(std::string const& text) override;
+
547 
548 
549  /**
-
550  * Arguments for register_mech or point_register_mech function
-
551  */
-
552  std::string register_mechanism_arguments() const override;
-
553 
-
554 
-
555  /**
-
556  * Return ion variable name and corresponding ion read variable name
-
557  * \param name The ion variable name
-
558  * \return The ion read variable name
+
550  * Print the getter method for getting number of arguments for net_receive
+
551  *
+
552  */
+ +
554 
+
555 
+
556  /**
+
557  * Print the getter method for returning mechtype
+
558  *
559  */
-
560  static std::pair<std::string, std::string> read_ion_variable_name(const std::string& name);
+
560  void print_mech_type_getter();
561 
562 
563  /**
-
564  * Return ion variable name and corresponding ion write variable name
-
565  * \param name The ion variable name
-
566  * \return The ion write variable name
-
567  */
-
568  static std::pair<std::string, std::string> write_ion_variable_name(const std::string& name);
-
569 
-
570 
-
571  /**
-
572  * Generate Function call statement for nrn_wrote_conc
-
573  * \param ion_name The name of the ion variable
-
574  * \param concentration The name of the concentration variable
-
575  * \param index
-
576  * \return The string representing the function call
-
577  */
-
578  std::string conc_write_statement(const std::string& ion_name,
-
579  const std::string& concentration,
-
580  int index);
+
564  * Print the getter method for returning membrane list from NrnThread
+
565  *
+
566  */
+
567  void print_memb_list_getter();
+
568 
+
569 
+
570  /**
+
571  * Prints the start of the \c coreneuron namespace
+
572  */
+
573  void print_namespace_start() override;
+
574 
+
575 
+
576  /**
+
577  * Prints the end of the \c coreneuron namespace
+
578  */
+
579  void print_namespace_stop() override;
+
580 
581 
582  /**
-
583  * Process shadow update statement
+
583  * Print the getter method for thread variables and ids
584  *
-
585  * If the statement requires reduction then add it to vector of reduction statement and return
-
586  * statement using shadow update
-
587  *
-
588  * \param statement The statement that might require shadow updates
-
589  * \param type The target backend code block type
-
590  * \return The generated target backend code
-
591  */
-
592  std::string process_shadow_update_statement(const ShadowUseStatement& statement,
-
593  BlockType type);
-
594 
-
595 
-
596  /****************************************************************************************/
-
597  /* Code-specific printing routines for code generations */
-
598  /****************************************************************************************/
-
599 
-
600 
-
601  /**
-
602  * Print the getter method for index position of first pointer variable
-
603  *
-
604  */
- -
606 
-
607 
-
608  /**
-
609  * Print the getter method for index position of first RANDOM variable
-
610  *
-
611  */
- -
613 
-
614 
-
615  /**
-
616  * Print the getter methods for float and integer variables count
-
617  *
-
618  */
- -
620 
-
621 
-
622  /**
-
623  * Print the getter method for getting number of arguments for net_receive
-
624  *
-
625  */
- -
627 
-
628 
-
629  /**
-
630  * Print the getter method for returning mechtype
-
631  *
-
632  */
-
633  void print_mech_type_getter();
-
634 
-
635 
-
636  /**
-
637  * Print the getter method for returning membrane list from NrnThread
-
638  *
-
639  */
-
640  void print_memb_list_getter();
-
641 
-
642 
-
643  /**
-
644  * Prints the start of the \c coreneuron namespace
+
585  */
+
586  void print_thread_getters();
+
587 
+
588 
+
589  /****************************************************************************************/
+
590  /* Routines for returning variable name */
+
591  /****************************************************************************************/
+
592 
+
593 
+
594  /**
+
595  * Determine the name of a \c float variable given its symbol
+
596  *
+
597  * This function typically returns the accessor expression in backend code for the given symbol.
+
598  * Since the model variables are stored in data arrays and accessed by offset, this function
+
599  * will return the C++ string representing the array access at the correct offset
+
600  *
+
601  * \param symbol The symbol of a variable for which we want to obtain its name
+
602  * \param use_instance Should the variable be accessed via instance or data array
+
603  * \return The backend code string representing the access to the given variable
+
604  * symbol
+
605  */
+
606  std::string float_variable_name(const SymbolType& symbol, bool use_instance) const override;
+
607 
+
608 
+
609  /**
+
610  * Determine the name of an \c int variable given its symbol
+
611  *
+
612  * This function typically returns the accessor expression in backend code for the given symbol.
+
613  * Since the model variables are stored in data arrays and accessed by offset, this function
+
614  * will return the C++ string representing the array access at the correct offset
+
615  *
+
616  * \param symbol The symbol of a variable for which we want to obtain its name
+
617  * \param name The name of the index variable
+
618  * \param use_instance Should the variable be accessed via instance or data array
+
619  * \return The backend code string representing the access to the given variable
+
620  * symbol
+
621  */
+
622  std::string int_variable_name(const IndexVariableInfo& symbol,
+
623  const std::string& name,
+
624  bool use_instance) const override;
+
625 
+
626 
+
627  /**
+
628  * Determine the variable name for a global variable given its symbol
+
629  * \param symbol The symbol of a variable for which we want to obtain its name
+
630  * \param use_instance Should the variable be accessed via the (host-only)
+
631  * global variable or the instance-specific copy (also available on GPU).
+
632  * \return The C++ string representing the access to the global variable
+
633  */
+
634  std::string global_variable_name(const SymbolType& symbol,
+
635  bool use_instance = true) const override;
+
636 
+
637 
+
638  /**
+
639  * Determine variable name in the structure of mechanism properties
+
640  *
+
641  * \param name Variable name that is being printed
+
642  * \param use_instance Should the variable be accessed via instance or data array
+
643  * \return The C++ string representing the access to the variable in the neuron
+
644  * thread structure
645  */
-
646  void print_namespace_start() override;
+
646  std::string get_variable_name(const std::string& name, bool use_instance = true) const override;
647 
-
648 
-
649  /**
-
650  * Prints the end of the \c coreneuron namespace
-
651  */
-
652  void print_namespace_stop() override;
-
653 
-
654 
-
655  /**
-
656  * Print the getter method for thread variables and ids
-
657  *
-
658  */
-
659  void print_thread_getters();
-
660 
-
661 
-
662  /****************************************************************************************/
-
663  /* Routines for returning variable name */
-
664  /****************************************************************************************/
-
665 
-
666 
-
667  /**
-
668  * Determine the updated name if the ion variable has been optimized
-
669  * \param name The ion variable name
-
670  * \return The updated name of the variable has been optimized (e.g. \c ena --> \c ion_ena)
-
671  */
-
672  std::string update_if_ion_variable_name(const std::string& name) const;
+
648 
+
649  /****************************************************************************************/
+
650  /* Main printing routines for code generation */
+
651  /****************************************************************************************/
+
652 
+
653 
+
654  /**
+
655  * Print top file header printed in generated code
+
656  */
+
657  void print_backend_info() override;
+
658 
+
659 
+
660  /**
+
661  * Print standard C/C++ includes
+
662  */
+
663  void print_standard_includes() override;
+
664 
+
665 
+
666  /**
+
667  * Print includes from coreneuron
+
668  */
+ +
670 
+
671 
+
672  void print_sdlists_init(bool print_initializers) override;
673 
674 
675  /**
-
676  * Determine the name of a \c float variable given its symbol
+
676  * Print the structure that wraps all global variables used in the NMODL
677  *
-
678  * This function typically returns the accessor expression in backend code for the given symbol.
-
679  * Since the model variables are stored in data arrays and accessed by offset, this function
-
680  * will return the C++ string representing the array access at the correct offset
-
681  *
-
682  * \param symbol The symbol of a variable for which we want to obtain its name
-
683  * \param use_instance Should the variable be accessed via instance or data array
-
684  * \return The backend code string representing the access to the given variable
-
685  * symbol
-
686  */
-
687  std::string float_variable_name(const SymbolType& symbol, bool use_instance) const override;
-
688 
-
689 
-
690  /**
-
691  * Determine the name of an \c int variable given its symbol
-
692  *
-
693  * This function typically returns the accessor expression in backend code for the given symbol.
-
694  * Since the model variables are stored in data arrays and accessed by offset, this function
-
695  * will return the C++ string representing the array access at the correct offset
-
696  *
-
697  * \param symbol The symbol of a variable for which we want to obtain its name
-
698  * \param name The name of the index variable
-
699  * \param use_instance Should the variable be accessed via instance or data array
-
700  * \return The backend code string representing the access to the given variable
-
701  * symbol
-
702  */
-
703  std::string int_variable_name(const IndexVariableInfo& symbol,
-
704  const std::string& name,
-
705  bool use_instance) const override;
-
706 
-
707 
-
708  /**
-
709  * Determine the variable name for a global variable given its symbol
-
710  * \param symbol The symbol of a variable for which we want to obtain its name
-
711  * \param use_instance Should the variable be accessed via the (host-only)
-
712  * global variable or the instance-specific copy (also available on GPU).
-
713  * \return The C++ string representing the access to the global variable
-
714  */
-
715  std::string global_variable_name(const SymbolType& symbol,
-
716  bool use_instance = true) const override;
-
717 
-
718 
-
719  /**
-
720  * Determine variable name in the structure of mechanism properties
-
721  *
-
722  * \param name Variable name that is being printed
-
723  * \param use_instance Should the variable be accessed via instance or data array
-
724  * \return The C++ string representing the access to the variable in the neuron
-
725  * thread structure
-
726  */
-
727  std::string get_variable_name(const std::string& name, bool use_instance = true) const override;
-
728 
+
678  * \param print_initializers Whether to include default values in the struct
+
679  * definition (true: int foo{42}; false: int foo;)
+
680  */
+
681  void print_mechanism_global_var_structure(bool print_initializers) override;
+
682 
+
683 
+
684  /**
+
685  * Print byte arrays that register scalar and vector variables for hoc interface
+
686  *
+
687  */
+
688  void print_global_variables_for_hoc() override;
+
689 
+
690 
+
691  /**
+
692  * Print the mechanism registration function
+
693  *
+
694  */
+
695  void print_mechanism_register() override;
+
696 
+
697 
+
698  /**
+
699  * Print thread related memory allocation and deallocation callbacks
+
700  */
+ +
702 
+
703 
+
704  /**
+
705  * Print structure of ion variables used for local copies
+
706  */
+ +
708 
+
709 
+
710  /**
+
711  * Print constructor of ion variables
+
712  * \param members The ion variable names
+
713  */
+
714  virtual void print_ion_var_constructor(const std::vector<std::string>& members);
+
715 
+
716 
+
717  /**
+
718  * Print the ion variable struct
+
719  */
+
720  virtual void print_ion_variable();
+
721 
+
722 
+
723  /**
+
724  * Print the pragma annotation to update global variables from host to the device
+
725  *
+
726  * \note This is not used for the C++ backend
+
727  */
+
729 
-
730  /****************************************************************************************/
-
731  /* Main printing routines for code generation */
-
732  /****************************************************************************************/
-
733 
-
734 
-
735  /**
-
736  * Print top file header printed in generated code
-
737  */
-
738  void print_backend_info() override;
-
739 
-
740 
-
741  /**
-
742  * Print standard C/C++ includes
-
743  */
-
744  void print_standard_includes() override;
-
745 
-
746 
-
747  /**
-
748  * Print includes from coreneuron
-
749  */
- -
751 
+
730 
+
731  /**
+
732  * Print the function that initialize range variable with different data type
+
733  */
+ +
735 
+
736 
+
737  /**
+
738  * Returns floating point type for given range variable symbol
+
739  * \param symbol A range variable symbol
+
740  */
+
741  std::string get_range_var_float_type(const SymbolType& symbol);
+
742 
+
743 
+
744  /**
+
745  * Print initial block statements
+
746  *
+
747  * Generate the target backend code corresponding to the NMODL initial block statements
+
748  *
+
749  * \param node The AST Node representing a NMODL initial block
+
750  */
+
751  void print_initial_block(const ast::InitialBlock* node);
752 
-
753  void print_sdlists_init(bool print_initializers) override;
-
754 
-
755 
-
756  /**
-
757  * Print the structure that wraps all global variables used in the NMODL
-
758  *
-
759  * \param print_initializers Whether to include default values in the struct
-
760  * definition (true: int foo{42}; false: int foo;)
-
761  */
-
762  void print_mechanism_global_var_structure(bool print_initializers) override;
-
763 
-
764 
-
765  /**
-
766  * Print byte arrays that register scalar and vector variables for hoc interface
-
767  *
-
768  */
-
769  void print_global_variables_for_hoc() override;
-
770 
-
771 
-
772  /**
-
773  * Print the mechanism registration function
-
774  *
-
775  */
-
776  void print_mechanism_register() override;
-
777 
-
778 
-
779  /**
-
780  * Print thread related memory allocation and deallocation callbacks
-
781  */
- -
783 
-
784 
-
785  /**
-
786  * Print structure of ion variables used for local copies
+
753 
+
754  /**
+
755  * Print common code for global functions like nrn_init, nrn_cur and nrn_state
+
756  * \param type The target backend code block type
+
757  */
+ +
759  const std::string& function_name = "") override;
+
760 
+
761 
+
762  /**
+
763  * Print the \c nrn\_init function definition
+
764  * \param skip_init_check \c true to generate code executing the initialization conditionally
+
765  */
+
766  void print_nrn_init(bool skip_init_check = true);
+
767 
+
768 
+
769  /**
+
770  * Print NMODL before / after block in target backend code
+
771  * \param node AST node of type before/after type being printed
+
772  * \param block_id Index of the before/after block
+
773  */
+
774  virtual void print_before_after_block(const ast::Block* node, size_t block_id);
+
775 
+
776 
+
777  /**
+
778  * Print nrn_constructor function definition
+
779  *
+
780  */
+
781  void print_nrn_constructor() override;
+
782 
+
783 
+
784  /**
+
785  * Print nrn_destructor function definition
+
786  *
787  */
- +
788  void print_nrn_destructor() override;
789 
790 
791  /**
-
792  * Print constructor of ion variables
-
793  * \param members The ion variable names
-
794  */
-
795  virtual void print_ion_var_constructor(const std::vector<std::string>& members);
-
796 
-
797 
-
798  /**
-
799  * Print the ion variable struct
-
800  */
-
801  virtual void print_ion_variable();
-
802 
-
803 
-
804  /**
-
805  * Print the pragma annotation to update global variables from host to the device
-
806  *
-
807  * \note This is not used for the C++ backend
-
808  */
- -
810 
-
811 
-
812  /**
-
813  * Print the function that initialize range variable with different data type
-
814  */
- -
816 
-
817 
-
818  /**
-
819  * Returns floating point type for given range variable symbol
-
820  * \param symbol A range variable symbol
-
821  */
-
822  std::string get_range_var_float_type(const SymbolType& symbol);
-
823 
-
824 
-
825  /**
-
826  * Print initial block statements
-
827  *
-
828  * Generate the target backend code corresponding to the NMODL initial block statements
-
829  *
-
830  * \param node The AST Node representing a NMODL initial block
-
831  */
-
832  void print_initial_block(const ast::InitialBlock* node);
-
833 
-
834 
-
835  /**
-
836  * Print common code for global functions like nrn_init, nrn_cur and nrn_state
-
837  * \param type The target backend code block type
-
838  */
- -
840  const std::string& function_name = "") override;
-
841 
-
842 
-
843  /**
-
844  * Print the \c nrn\_init function definition
-
845  * \param skip_init_check \c true to generate code executing the initialization conditionally
-
846  */
-
847  void print_nrn_init(bool skip_init_check = true);
-
848 
-
849 
-
850  /**
-
851  * Print NMODL before / after block in target backend code
-
852  * \param node AST node of type before/after type being printed
-
853  * \param block_id Index of the before/after block
-
854  */
-
855  virtual void print_before_after_block(const ast::Block* node, size_t block_id);
-
856 
-
857 
-
858  /**
-
859  * Print nrn_constructor function definition
-
860  *
-
861  */
-
862  void print_nrn_constructor() override;
-
863 
-
864 
-
865  /**
-
866  * Print nrn_destructor function definition
-
867  *
-
868  */
-
869  void print_nrn_destructor() override;
-
870 
-
871 
-
872  /**
-
873  * Go through the map of \c EigenNewtonSolverBlock s and their corresponding functor names
-
874  * and print the functor definitions before the definitions of the functions of the generated
-
875  * file
-
876  *
-
877  */
- -
879 
-
880 
-
881  /**
-
882  * Print nrn_alloc function definition
-
883  *
+
792  * Go through the map of \c EigenNewtonSolverBlock s and their corresponding functor names
+
793  * and print the functor definitions before the definitions of the functions of the generated
+
794  * file
+
795  *
+
796  */
+ +
798 
+
799 
+
800  /**
+
801  * Print nrn_alloc function definition
+
802  *
+
803  */
+
804  void print_nrn_alloc() override;
+
805 
+
806 
+
807  /**
+
808  * Print watch activate function
+
809  *
+
810  */
+
811  void print_watch_activate();
+
812 
+
813 
+
814  /**
+
815  * Print watch activate function
+
816  */
+
817  void print_watch_check();
+
818 
+
819 
+
820  /**
+
821  * Print the common code section for net receive related methods
+
822  *
+
823  * \param node The AST node representing the corresponding NMODL block
+
824  * \param need_mech_inst \c true if a local \c inst variable needs to be defined in generated
+
825  * code
+
826  */
+
827  void print_net_receive_common_code(const ast::Block& node, bool need_mech_inst = true);
+
828 
+
829 
+
830  /**
+
831  * Print call to \c net\_send
+
832  * \param node The AST node representing the function call
+
833  */
+
834  void print_net_send_call(const ast::FunctionCall& node) override;
+
835 
+
836 
+
837  /**
+
838  * Print call to net\_move
+
839  * \param node The AST node representing the function call
+
840  */
+
841  void print_net_move_call(const ast::FunctionCall& node) override;
+
842 
+
843 
+
844  /**
+
845  * Print call to net\_event
+
846  * \param node The AST node representing the function call
+
847  */
+
848  void print_net_event_call(const ast::FunctionCall& node) override;
+
849 
+
850 
+
851  /**
+
852  * Print initial block in the net receive block
+
853  */
+
854  void print_net_init();
+
855 
+
856 
+
857  /**
+
858  * Print send event move block used in net receive as well as watch
+
859  */
+
860  void print_send_event_move();
+
861 
+
862 
+
863  /**
+
864  * Generate the target backend code for the \c net\_receive\_buffering function delcaration
+
865  * \return The target code string
+
866  */
+
867  virtual std::string net_receive_buffering_declaration();
+
868 
+
869 
+
870  /**
+
871  * Print the target backend code for defining and checking a local \c Memb\_list variable
+
872  */
+
873  virtual void print_get_memb_list();
+
874 
+
875 
+
876  /**
+
877  * Print the code for the main \c net\_receive loop
+
878  */
+
879  virtual void print_net_receive_loop_begin();
+
880 
+
881 
+
882  /**
+
883  * Print the code for closing the main \c net\_receive loop
884  */
-
885  void print_nrn_alloc() override;
+
885  virtual void print_net_receive_loop_end();
886 
887 
888  /**
-
889  * Print watch activate function
+
889  * Print kernel for buffering net_receive events
890  *
-
891  */
-
892  void print_watch_activate();
-
893 
-
894 
-
895  /**
-
896  * Print watch activate function
-
897  */
-
898  void print_watch_check();
-
899 
-
900 
-
901  /**
-
902  * Print the common code section for net receive related methods
-
903  *
-
904  * \param node The AST node representing the corresponding NMODL block
-
905  * \param need_mech_inst \c true if a local \c inst variable needs to be defined in generated
-
906  * code
-
907  */
-
908  void print_net_receive_common_code(const ast::Block& node, bool need_mech_inst = true);
-
909 
-
910 
-
911  /**
-
912  * Print call to \c net\_send
-
913  * \param node The AST node representing the function call
-
914  */
-
915  void print_net_send_call(const ast::FunctionCall& node) override;
-
916 
-
917 
-
918  /**
-
919  * Print call to net\_move
-
920  * \param node The AST node representing the function call
-
921  */
-
922  void print_net_move_call(const ast::FunctionCall& node) override;
-
923 
-
924 
-
925  /**
-
926  * Print call to net\_event
-
927  * \param node The AST node representing the function call
-
928  */
-
929  void print_net_event_call(const ast::FunctionCall& node) override;
-
930 
-
931 
-
932  /**
-
933  * Print initial block in the net receive block
-
934  */
-
935  void print_net_init();
-
936 
-
937 
-
938  /**
-
939  * Print send event move block used in net receive as well as watch
-
940  */
-
941  void print_send_event_move();
-
942 
-
943 
-
944  /**
-
945  * Generate the target backend code for the \c net\_receive\_buffering function delcaration
-
946  * \return The target code string
-
947  */
-
948  virtual std::string net_receive_buffering_declaration();
-
949 
-
950 
-
951  /**
-
952  * Print the target backend code for defining and checking a local \c Memb\_list variable
-
953  */
-
954  virtual void print_get_memb_list();
-
955 
-
956 
-
957  /**
-
958  * Print the code for the main \c net\_receive loop
-
959  */
-
960  virtual void print_net_receive_loop_begin();
-
961 
-
962 
-
963  /**
-
964  * Print the code for closing the main \c net\_receive loop
-
965  */
-
966  virtual void print_net_receive_loop_end();
-
967 
-
968 
-
969  /**
-
970  * Print kernel for buffering net_receive events
-
971  *
-
972  * This kernel is only needed for accelerator backends where \c net\_receive needs to be
-
973  * executed in two stages as the actual communication must be done in the host code. \param
-
974  * need_mech_inst \c true if the generated code needs a local inst variable to be defined
-
975  */
-
976  void print_net_receive_buffering(bool need_mech_inst = true);
-
977 
-
978 
-
979  /**
-
980  * Print the code related to the update of NetSendBuffer_t cnt. For GPU this needs to be done
-
981  * with atomic operation, on CPU it's not needed.
-
982  *
-
983  */
-
984  virtual void print_net_send_buffering_cnt_update() const;
-
985 
-
986 
-
987  /**
-
988  * Print statement that grows NetSendBuffering_t structure if needed.
-
989  * This function should be overridden for backends that cannot dynamically reallocate the buffer
-
990  */
-
991  virtual void print_net_send_buffering_grow();
-
992 
-
993 
-
994  /**
-
995  * Print kernel for buffering net_send events
-
996  *
-
997  * This kernel is only needed for accelerator backends where \c net\_send needs to be executed
-
998  * in two stages as the actual communication must be done in the host code.
-
999  */
-
1000  void print_net_send_buffering();
-
1001 
-
1002 
-
1003  /**
-
1004  * Print \c net\_receive kernel function definition
-
1005  */
-
1006  void print_net_receive_kernel();
-
1007 
-
1008 
-
1009  /**
-
1010  * Print \c net\_receive function definition
-
1011  */
-
1012  void print_net_receive();
-
1013 
-
1014 
-
1015  /**
-
1016  * Print derivative kernel when \c derivimplicit method is used
-
1017  *
-
1018  * \param block The corresponding AST node representing an NMODL \c derivimplicit block
-
1019  */
-
1020  void print_derivimplicit_kernel(const ast::Block& block);
-
1021 
-
1022 
-
1023  /**
-
1024  * Print code block to transfer newtonspace structure to device
-
1025  */
-
1026  virtual void print_newtonspace_transfer_to_device() const;
-
1027 
-
1028 
-
1029  /****************************************************************************************/
-
1030  /* Print nrn_state routine */
-
1031  /****************************************************************************************/
-
1032 
-
1033 
-
1034  /**
-
1035  * Print nrn_state / state update function definition
-
1036  */
-
1037  void print_nrn_state() override;
-
1038 
-
1039 
-
1040  /****************************************************************************************/
-
1041  /* Print nrn_cur related routines */
-
1042  /****************************************************************************************/
+
891  * This kernel is only needed for accelerator backends where \c net\_receive needs to be
+
892  * executed in two stages as the actual communication must be done in the host code. \param
+
893  * need_mech_inst \c true if the generated code needs a local inst variable to be defined
+
894  */
+
895  void print_net_receive_buffering(bool need_mech_inst = true);
+
896 
+
897 
+
898  /**
+
899  * Print the code related to the update of NetSendBuffer_t cnt. For GPU this needs to be done
+
900  * with atomic operation, on CPU it's not needed.
+
901  *
+
902  */
+
903  virtual void print_net_send_buffering_cnt_update() const;
+
904 
+
905 
+
906  /**
+
907  * Print statement that grows NetSendBuffering_t structure if needed.
+
908  * This function should be overridden for backends that cannot dynamically reallocate the buffer
+
909  */
+
910  virtual void print_net_send_buffering_grow();
+
911 
+
912 
+
913  /**
+
914  * Print kernel for buffering net_send events
+
915  *
+
916  * This kernel is only needed for accelerator backends where \c net\_send needs to be executed
+
917  * in two stages as the actual communication must be done in the host code.
+
918  */
+ +
920 
+
921 
+
922  /**
+
923  * Print \c net\_receive kernel function definition
+
924  */
+ +
926 
+
927 
+
928  /**
+
929  * Print \c net\_receive function definition
+
930  */
+
931  void print_net_receive();
+
932 
+
933 
+
934  /**
+
935  * Print derivative kernel when \c derivimplicit method is used
+
936  *
+
937  * \param block The corresponding AST node representing an NMODL \c derivimplicit block
+
938  */
+
939  void print_derivimplicit_kernel(const ast::Block& block);
+
940 
+
941 
+
942  /**
+
943  * Print code block to transfer newtonspace structure to device
+
944  */
+
945  virtual void print_newtonspace_transfer_to_device() const;
+
946 
+
947 
+
948  /****************************************************************************************/
+
949  /* Print nrn_state routine */
+
950  /****************************************************************************************/
+
951 
+
952 
+
953  /**
+
954  * Print nrn_state / state update function definition
+
955  */
+
956  void print_nrn_state() override;
+
957 
+
958 
+
959  /****************************************************************************************/
+
960  /* Print nrn_cur related routines */
+
961  /****************************************************************************************/
+
962 
+
963 
+
964  /**
+
965  * Print the \c nrn_current kernel
+
966  *
+
967  * \note nrn_cur_kernel will have two calls to nrn_current if no conductance keywords specified
+
968  * \param node the AST node representing the NMODL breakpoint block
+
969  */
+
970  void print_nrn_current(const ast::BreakpointBlock& node) override;
+
971 
+
972 
+
973  /**
+
974  * Print the \c nrn\_cur kernel with NMODL \c conductance keyword provisions
+
975  *
+
976  * If the NMODL \c conductance keyword is used in the \c breakpoint block, then
+
977  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
+
978  *
+
979  * \param node the AST node representing the NMODL breakpoint block
+
980  */
+
981  void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock& node) override;
+
982 
+
983 
+
984  /**
+
985  * Print the \c nrn\_cur kernel without NMODL \c conductance keyword provisions
+
986  *
+
987  * If the NMODL \c conductance keyword is \b not used in the \c breakpoint block, then
+
988  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
+
989  */
+
990  void print_nrn_cur_non_conductance_kernel() override;
+
991 
+
992 
+
993  /**
+
994  * Print main body of nrn_cur function
+
995  * \param node the AST node representing the NMODL breakpoint block
+
996  */
+
997  void print_nrn_cur_kernel(const ast::BreakpointBlock& node) override;
+
998 
+
999 
+
1000  /**
+
1001  * Print fast membrane current calculation code
+
1002  */
+
1003  virtual void print_fast_imem_calculation() override;
+
1004 
+
1005 
+
1006  /**
+
1007  * Print nrn_cur / current update function definition
+
1008  */
+
1009  void print_nrn_cur() override;
+
1010 
+
1011 
+
1012  /****************************************************************************************/
+
1013  /* Main code printing entry points */
+
1014  /****************************************************************************************/
+
1015 
+
1016 
+
1017  /**
+
1018  * Print all includes
+
1019  *
+
1020  */
+
1021  void print_headers_include() override;
+
1022 
+
1023 
+
1024  /**
+
1025  * Print start of namespaces
+
1026  *
+
1027  */
+
1028  void print_namespace_begin() override;
+
1029 
+
1030 
+
1031  /**
+
1032  * Print end of namespaces
+
1033  *
+
1034  */
+
1035  void print_namespace_end() override;
+
1036 
+
1037 
+
1038  /**
+
1039  * Print common getters
+
1040  *
+
1041  */
+
1042  void print_common_getters();
1043 
1044 
1045  /**
-
1046  * Print the \c nrn_current kernel
-
1047  *
-
1048  * \note nrn_cur_kernel will have two calls to nrn_current if no conductance keywords specified
-
1049  * \param node the AST node representing the NMODL breakpoint block
-
1050  */
-
1051  void print_nrn_current(const ast::BreakpointBlock& node) override;
-
1052 
-
1053 
-
1054  /**
-
1055  * Print the \c nrn\_cur kernel with NMODL \c conductance keyword provisions
-
1056  *
-
1057  * If the NMODL \c conductance keyword is used in the \c breakpoint block, then
-
1058  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
-
1059  *
-
1060  * \param node the AST node representing the NMODL breakpoint block
-
1061  */
-
1062  void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock& node) override;
-
1063 
-
1064 
-
1065  /**
-
1066  * Print the \c nrn\_cur kernel without NMODL \c conductance keyword provisions
-
1067  *
-
1068  * If the NMODL \c conductance keyword is \b not used in the \c breakpoint block, then
-
1069  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
-
1070  */
-
1071  void print_nrn_cur_non_conductance_kernel() override;
-
1072 
-
1073 
-
1074  /**
-
1075  * Print main body of nrn_cur function
-
1076  * \param node the AST node representing the NMODL breakpoint block
-
1077  */
-
1078  void print_nrn_cur_kernel(const ast::BreakpointBlock& node) override;
-
1079 
-
1080 
-
1081  /**
-
1082  * Print fast membrane current calculation code
-
1083  */
-
1084  virtual void print_fast_imem_calculation() override;
-
1085 
-
1086 
-
1087  /**
-
1088  * Print nrn_cur / current update function definition
-
1089  */
-
1090  void print_nrn_cur() override;
-
1091 
-
1092 
-
1093  /****************************************************************************************/
-
1094  /* Main code printing entry points */
-
1095  /****************************************************************************************/
-
1096 
-
1097 
-
1098  /**
-
1099  * Print all includes
-
1100  *
-
1101  */
-
1102  void print_headers_include() override;
-
1103 
-
1104 
-
1105  /**
-
1106  * Print start of namespaces
-
1107  *
-
1108  */
-
1109  void print_namespace_begin() override;
-
1110 
-
1111 
-
1112  /**
-
1113  * Print end of namespaces
-
1114  *
-
1115  */
-
1116  void print_namespace_end() override;
-
1117 
-
1118 
-
1119  /**
-
1120  * Print common getters
-
1121  *
-
1122  */
-
1123  void print_common_getters();
-
1124 
-
1125 
-
1126  /**
-
1127  * Print all classes
-
1128  * \param print_initializers Whether to include default values.
-
1129  */
-
1130  void print_data_structures(bool print_initializers) override;
-
1131 
-
1132 
-
1133  /**
-
1134  * Set v_unused (voltage) for NRN_PRCELLSTATE feature
-
1135  */
-
1136  void print_v_unused() const override;
-
1137 
-
1138 
-
1139  /**
-
1140  * Set g_unused (conductance) for NRN_PRCELLSTATE feature
-
1141  */
-
1142  void print_g_unused() const override;
-
1143 
-
1144 
-
1145  /**
-
1146  * Print all compute functions for every backend
-
1147  *
-
1148  */
-
1149  virtual void print_compute_functions() override;
-
1150 
-
1151 
-
1152  /**
-
1153  * Print entry point to code generation
-
1154  *
-
1155  */
-
1156  virtual void print_codegen_routines() override;
-
1157 
-
1158 
-
1159  /****************************************************************************************/
-
1160  /* Overloaded visitor routines */
-
1161  /****************************************************************************************/
-
1162 
-
1163 
-
1164  void visit_derivimplicit_callback(const ast::DerivimplicitCallback& node) override;
-
1165  void visit_eigen_newton_solver_block(const ast::EigenNewtonSolverBlock& node) override;
-
1166  void visit_eigen_linear_solver_block(const ast::EigenLinearSolverBlock& node) override;
-
1167  void visit_for_netcon(const ast::ForNetcon& node) override;
-
1168  virtual void visit_watch_statement(const ast::WatchStatement& node) override;
-
1169 
-
1170 
-
1171  /**
-
1172  * Print prototype declarations of functions or procedures
-
1173  * \tparam T The AST node type of the node (must be of nmodl::ast::Ast or subclass)
-
1174  * \param node The AST node representing the function or procedure block
-
1175  * \param name A user defined name for the function
-
1176  */
-
1177  template <typename T>
-
1178  void print_function_declaration(const T& node, const std::string& name);
-
1179 
-
1180 
-
1181  public:
-
1182  /**
-
1183  * \brief Constructs the C++ code generator visitor
-
1184  *
-
1185  * This constructor instantiates an NMODL C++ code generator and allows writing generated code
-
1186  * directly to a file in \c [output_dir]/[mod_filename].cpp.
-
1187  *
-
1188  * \note No code generation is performed at this stage. Since the code
-
1189  * generator classes are all based on \c AstVisitor the AST must be visited using e.g. \c
-
1190  * visit_program in order to generate the C++ code corresponding to the AST.
-
1191  *
-
1192  * \param mod_filename The name of the model for which code should be generated.
-
1193  * It is used for constructing an output filename.
-
1194  * \param output_dir The directory where target C++ file should be generated.
-
1195  * \param float_type The float type to use in the generated code. The string will be used
-
1196  * as-is in the target code. This defaults to \c double.
-
1197  */
- -
1199  const std::string& output_dir,
-
1200  std::string float_type,
-
1201  const bool optimize_ionvar_copies)
- -
1203 
-
1204  /**
-
1205  * \copybrief nmodl::codegen::CodegenCoreneuronCppVisitor
-
1206  *
-
1207  * This constructor instantiates an NMODL C++ code generator and allows writing generated code
-
1208  * into an output stream.
-
1209  *
-
1210  * \note No code generation is performed at this stage. Since the code
-
1211  * generator classes are all based on \c AstVisitor the AST must be visited using e.g. \c
-
1212  * visit_program in order to generate the C++ code corresponding to the AST.
-
1213  *
-
1214  * \param mod_filename The name of the model for which code should be generated.
-
1215  * It is used for constructing an output filename.
-
1216  * \param stream The output stream onto which to write the generated code
-
1217  * \param float_type The float type to use in the generated code. The string will be used
-
1218  * as-is in the target code. This defaults to \c double.
-
1219  */
- -
1221  std::ostream& stream,
-
1222  std::string float_type,
-
1223  const bool optimize_ionvar_copies)
- -
1225 
-
1226 
-
1227  /****************************************************************************************/
-
1228  /* Public printing routines for code generation for use in unit tests */
-
1229  /****************************************************************************************/
-
1230 
-
1231 
-
1232  /**
-
1233  * Print the function that initialize instance structure
-
1234  */
- -
1236 
-
1237 
-
1238  /**
-
1239  * Print the structure that wraps all range and int variables required for the NMODL
-
1240  *
-
1241  * \param print_initializers Whether or not default values for variables
-
1242  * be included in the struct declaration.
-
1243  */
-
1244  void print_mechanism_range_var_structure(bool print_initializers) override;
-
1245 };
-
1246 
-
1247 
-
1248 /**
-
1249  * \details If there is an argument with name (say alpha) same as range variable (say alpha),
-
1250  * we want to avoid it being printed as instance->alpha. And hence we disable variable
-
1251  * name lookup during prototype declaration. Note that the name of procedure can be
-
1252  * different in case of table statement.
-
1253  */
-
1254 template <typename T>
- -
1256  const std::string& name) {
- -
1258  auto type = default_float_data_type();
-
1259 
-
1260  // internal and user provided arguments
-
1261  auto internal_params = internal_method_parameters();
-
1262  const auto& params = node.get_parameters();
-
1263  for (const auto& param: params) {
-
1264  internal_params.emplace_back("", type, "", param.get()->get_node_name());
-
1265  }
-
1266 
-
1267  // procedures have "int" return type by default
-
1268  const char* return_type = "int";
-
1269  if (node.is_function_block()) {
-
1270  return_type = default_float_data_type();
-
1271  }
-
1272 
- -
1274  printer->add_indent();
-
1275  printer->fmt_text("inline {} {}({})",
-
1276  return_type,
-
1277  method_name(name),
-
1278  get_parameter_str(internal_params));
-
1279 
- -
1281 }
-
1282 
-
1283 /** \} */ // end of codegen_backends
-
1284 
-
1285 } // namespace codegen
-
1286 } // namespace nmodl
+
1046  * Print all classes
+
1047  * \param print_initializers Whether to include default values.
+
1048  */
+
1049  void print_data_structures(bool print_initializers) override;
+
1050 
+
1051 
+
1052  /**
+
1053  * Set v_unused (voltage) for NRN_PRCELLSTATE feature
+
1054  */
+
1055  void print_v_unused() const override;
+
1056 
+
1057 
+
1058  /**
+
1059  * Set g_unused (conductance) for NRN_PRCELLSTATE feature
+
1060  */
+
1061  void print_g_unused() const override;
+
1062 
+
1063 
+
1064  /**
+
1065  * Print all compute functions for every backend
+
1066  *
+
1067  */
+
1068  virtual void print_compute_functions() override;
+
1069 
+
1070 
+
1071  /**
+
1072  * Print entry point to code generation
+
1073  *
+
1074  */
+
1075  virtual void print_codegen_routines() override;
+
1076 
+
1077 
+
1078  /****************************************************************************************/
+
1079  /* Overloaded visitor routines */
+
1080  /****************************************************************************************/
+
1081 
+
1082 
+
1083  void visit_derivimplicit_callback(const ast::DerivimplicitCallback& node) override;
+
1084  void visit_eigen_newton_solver_block(const ast::EigenNewtonSolverBlock& node) override;
+
1085  void visit_eigen_linear_solver_block(const ast::EigenLinearSolverBlock& node) override;
+
1086  void visit_for_netcon(const ast::ForNetcon& node) override;
+
1087  virtual void visit_watch_statement(const ast::WatchStatement& node) override;
+
1088 
+
1089 
+
1090  /**
+
1091  * Print prototype declarations of functions or procedures
+
1092  * \tparam T The AST node type of the node (must be of nmodl::ast::Ast or subclass)
+
1093  * \param node The AST node representing the function or procedure block
+
1094  * \param name A user defined name for the function
+
1095  */
+
1096  template <typename T>
+
1097  void print_function_declaration(const T& node, const std::string& name);
+
1098 
+
1099 
+
1100  public:
+
1101  /**
+
1102  * \brief Constructs the C++ code generator visitor
+
1103  *
+
1104  * This constructor instantiates an NMODL C++ code generator and allows writing generated code
+
1105  * directly to a file in \c [output_dir]/[mod_filename].cpp.
+
1106  *
+
1107  * \note No code generation is performed at this stage. Since the code
+
1108  * generator classes are all based on \c AstVisitor the AST must be visited using e.g. \c
+
1109  * visit_program in order to generate the C++ code corresponding to the AST.
+
1110  *
+
1111  * \param mod_filename The name of the model for which code should be generated.
+
1112  * It is used for constructing an output filename.
+
1113  * \param output_dir The directory where target C++ file should be generated.
+
1114  * \param float_type The float type to use in the generated code. The string will be used
+
1115  * as-is in the target code. This defaults to \c double.
+
1116  */
+ +
1118  const std::string& output_dir,
+
1119  std::string float_type,
+
1120  const bool optimize_ionvar_copies)
+ +
1122 
+
1123  /**
+
1124  * \copybrief nmodl::codegen::CodegenCoreneuronCppVisitor
+
1125  *
+
1126  * This constructor instantiates an NMODL C++ code generator and allows writing generated code
+
1127  * into an output stream.
+
1128  *
+
1129  * \note No code generation is performed at this stage. Since the code
+
1130  * generator classes are all based on \c AstVisitor the AST must be visited using e.g. \c
+
1131  * visit_program in order to generate the C++ code corresponding to the AST.
+
1132  *
+
1133  * \param mod_filename The name of the model for which code should be generated.
+
1134  * It is used for constructing an output filename.
+
1135  * \param stream The output stream onto which to write the generated code
+
1136  * \param float_type The float type to use in the generated code. The string will be used
+
1137  * as-is in the target code. This defaults to \c double.
+
1138  */
+ +
1140  std::ostream& stream,
+
1141  std::string float_type,
+
1142  const bool optimize_ionvar_copies)
+ +
1144 
+
1145 
+
1146  /****************************************************************************************/
+
1147  /* Public printing routines for code generation for use in unit tests */
+
1148  /****************************************************************************************/
+
1149 
+
1150 
+
1151  /**
+
1152  * Print the function that initialize instance structure
+
1153  */
+ +
1155 
+
1156 
+
1157  /**
+
1158  * Print the structure that wraps all range and int variables required for the NMODL
+
1159  *
+
1160  * \param print_initializers Whether or not default values for variables
+
1161  * be included in the struct declaration.
+
1162  */
+
1163  void print_mechanism_range_var_structure(bool print_initializers) override;
+
1164 };
+
1165 
+
1166 
+
1167 /**
+
1168  * \details If there is an argument with name (say alpha) same as range variable (say alpha),
+
1169  * we want to avoid it being printed as instance->alpha. And hence we disable variable
+
1170  * name lookup during prototype declaration. Note that the name of procedure can be
+
1171  * different in case of table statement.
+
1172  */
+
1173 template <typename T>
+ +
1175  const std::string& name) {
+ +
1177  auto type = default_float_data_type();
+
1178 
+
1179  // internal and user provided arguments
+
1180  auto internal_params = internal_method_parameters();
+
1181  const auto& params = node.get_parameters();
+
1182  for (const auto& param: params) {
+
1183  internal_params.emplace_back("", type, "", param.get()->get_node_name());
+
1184  }
+
1185 
+
1186  // procedures have "int" return type by default
+
1187  const char* return_type = "int";
+
1188  if (node.is_function_block()) {
+
1189  return_type = default_float_data_type();
+
1190  }
+
1191 
+ +
1193  printer->add_indent();
+
1194  printer->fmt_text("inline {} {}({})",
+
1195  return_type,
+
1196  method_name(name),
+
1197  get_parameter_str(internal_params));
+
1198 
+ +
1200 }
+
1201 
+
1202 /** \} */ // end of codegen_backends
+
1203 
+
1204 } // namespace codegen
+
1205 } // namespace nmodl
-
virtual void print_procedure(const ast::ProcedureBlock &node) override
Print NMODL procedure in target backend code.
-
virtual void print_device_method_annotation()
Print the backend specific device method annotation.
-
void print_coreneuron_includes()
Print includes from coreneuron.
-
virtual std::string net_receive_buffering_declaration()
Generate the target backend code for the net_receive_buffering function delcaration.
-
virtual bool nrn_cur_reduction_loop_required()
Check if reduction block in nrn_cur required.
-
virtual void print_backend_namespace_start()
Prints the start of namespace for the backend-specific code.
-
void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
-
void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
-
virtual void print_net_send_buf_count_update_to_host() const
Print the code to update NetSendBuffer_t count from device to host.
+
virtual void print_procedure(const ast::ProcedureBlock &node) override
Print NMODL procedure in target backend code.
+
virtual void print_device_method_annotation()
Print the backend specific device method annotation.
+
void print_coreneuron_includes()
Print includes from coreneuron.
+
virtual std::string net_receive_buffering_declaration()
Generate the target backend code for the net_receive_buffering function delcaration.
+
virtual bool nrn_cur_reduction_loop_required()
Check if reduction block in nrn_cur required.
+
virtual void print_backend_namespace_start()
Prints the start of namespace for the backend-specific code.
+
void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
+
void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
+
virtual void print_net_send_buf_count_update_to_host() const
Print the code to update NetSendBuffer_t count from device to host.
Visitor for printing C++ code compatible with legacy api of CoreNEURON
-
void print_function_prototypes() override
Print function and procedures prototype declaration.
-
void print_functors_definitions()
Go through the map of EigenNewtonSolverBlock s and their corresponding functor names and print the fu...
-
void print_namespace_stop() override
Prints the end of the coreneuron namespace.
+
void print_function_prototypes() override
Print function and procedures prototype declaration.
+
void print_functors_definitions()
Go through the map of EigenNewtonSolverBlock s and their corresponding functor names and print the fu...
+
void print_namespace_stop() override
Prints the end of the coreneuron namespace.
Helper to represent information about index/int variables.
-
void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
-
virtual void print_ion_variable()
Print the ion variable struct.
-
void print_derivimplicit_kernel(const ast::Block &block)
Print derivative kernel when derivimplicit method is used.
-
virtual void print_device_stream_wait() const
Print the code to synchronise/wait on stream specific to NrnThread.
-
static std::pair< std::string, std::string > read_ion_variable_name(const std::string &name)
Return ion variable name and corresponding ion read variable name.
-
virtual void print_instance_struct_delete_from_device()
Delete the instance struct from the device.
-
virtual void print_net_send_buf_count_update_to_device() const
Print the code to update NetSendBuffer_t count from host to device.
+
void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
+
virtual void print_ion_variable()
Print the ion variable struct.
+
void print_derivimplicit_kernel(const ast::Block &block)
Print derivative kernel when derivimplicit method is used.
+
virtual void print_device_stream_wait() const
Print the code to synchronise/wait on stream specific to NrnThread.
+
virtual void print_instance_struct_delete_from_device()
Delete the instance struct from the device.
+
virtual void print_net_send_buf_count_update_to_device() const
Print the code to update NetSendBuffer_t count from host to device.
codegen::CodegenInfo info
All ast information for code generation.
-
void print_functor_definition(const ast::EigenNewtonSolverBlock &node)
Based on the EigenNewtonSolverBlock passed print the definition needed for its functor.
-
std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
Determine the variable name for a global variable given its symbol.
+
void print_functor_definition(const ast::EigenNewtonSolverBlock &node)
Based on the EigenNewtonSolverBlock passed print the definition needed for its functor.
+
std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
Determine the variable name for a global variable given its symbol.
-
void visit_eigen_linear_solver_block(const ast::EigenLinearSolverBlock &node) override
visit node of type ast::EigenLinearSolverBlock
-
virtual void print_newtonspace_transfer_to_device() const
Print code block to transfer newtonspace structure to device.
+
void visit_eigen_linear_solver_block(const ast::EigenLinearSolverBlock &node) override
visit node of type ast::EigenLinearSolverBlock
+
virtual void print_newtonspace_transfer_to_device() const
Print code block to transfer newtonspace structure to device.
int thread_data_index
thread_data_index indicates number of threads being allocated.
-
void print_namespace_end() override
Print end of namespaces.
-
void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
-
virtual void print_net_receive_loop_begin()
Print the code for the main net_receive loop.
+
void print_namespace_end() override
Print end of namespaces.
+
void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
+
virtual void print_net_receive_loop_begin()
Print the code for the main net_receive loop.
bool optimize_ionvar_copies
Flag to indicate if visitor should avoid ion variable copies.
-
virtual void print_kernel_data_present_annotation_block_begin()
Print accelerator annotations indicating data presence on device.
+
virtual void print_kernel_data_present_annotation_block_begin()
Print accelerator annotations indicating data presence on device.
-
void print_backend_info() override
Print top file header printed in generated code.
-
void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
-
std::string update_if_ion_variable_name(const std::string &name) const
Determine the updated name if the ion variable has been optimized.
- -
std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
Determine the name of an int variable given its symbol.
-
std::tuple< bool, int > check_if_var_is_array(const std::string &name)
Check if the given name exist in the symbol.
-
void print_initial_block(const ast::InitialBlock *node)
Print initial block statements.
-
void print_net_receive_kernel()
Print net_receive kernel function definition.
-
void print_thread_getters()
Print the getter method for thread variables and ids.
+
void print_backend_info() override
Print top file header printed in generated code.
+
void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
+ +
std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
Determine the name of an int variable given its symbol.
+
std::tuple< bool, int > check_if_var_is_array(const std::string &name)
Check if the given name exist in the symbol.
+
void print_initial_block(const ast::InitialBlock *node)
Print initial block statements.
+
void print_net_receive_kernel()
Print net_receive kernel function definition.
+
void print_thread_getters()
Print the getter method for thread variables and ids.
std::string simulator_name() override
Name of the simulator the code was generated for.
-
void print_net_send_buffering()
Print kernel for buffering net_send events.
+
void print_net_send_buffering()
Print kernel for buffering net_send events.
encapsulates code generation backend implementations
Definition: ast_common.hpp:26
int num_thread_objects() const noexcept
Determine the number of threads to allocate.
-
virtual void print_fast_imem_calculation() override
Print fast membrane current calculation code.
-
void print_function_declaration(const T &node, const std::string &name)
Print prototype declarations of functions or procedures.
-
virtual void print_dt_update_to_device() const
Print the code to update dt from host to device.
-
virtual void print_net_init_acc_serial_annotation_block_end()
Print accelerator kernels end annotation for net_init kernel.
-
void print_net_init()
Print initial block in the net receive block.
-
void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
-
void print_nrn_destructor() override
Print nrn_destructor function definition.
-
void print_sdlists_init(bool print_initializers) override
+
virtual void print_fast_imem_calculation() override
Print fast membrane current calculation code.
+
void print_function_declaration(const T &node, const std::string &name)
Print prototype declarations of functions or procedures.
+
virtual void print_dt_update_to_device() const
Print the code to update dt from host to device.
+
virtual void print_net_init_acc_serial_annotation_block_end()
Print accelerator kernels end annotation for net_init kernel.
+
void print_net_init()
Print initial block in the net receive block.
+
void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
+
void print_nrn_destructor() override
Print nrn_destructor function definition.
+
void print_sdlists_init(bool print_initializers) override
Implement classes for representing symbol table at block and file scope.
-
std::vector< std::string > ion_read_statements(BlockType type) const
For a given output block type, return statements for all read ion variables.
- -
void print_send_event_move()
Print send event move block used in net receive as well as watch.
-
void print_table_replacement_function(const ast::Block &node)
Print replacement function for function or procedure using table.
-
std::string conc_write_statement(const std::string &ion_name, const std::string &concentration, int index)
Generate Function call statement for nrn_wrote_conc.
-
virtual void print_atomic_reduction_pragma() override
Print atomic update pragma for reduction statements.
-
virtual void print_instance_struct_copy_to_device()
Transfer the instance struct to the device.
-
void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
+ +
void print_send_event_move()
Print send event move block used in net receive as well as watch.
+
void print_table_replacement_function(const ast::Block &node)
Print replacement function for function or procedure using table.
+
virtual void print_atomic_reduction_pragma() override
Print atomic update pragma for reduction statements.
+
virtual void print_instance_struct_copy_to_device()
Transfer the instance struct to the device.
+
void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
parser::NmodlParser::symbol_type SymbolType
Definition: nmodl_utils.hpp:26
-
void print_function_or_procedure(const ast::Block &node, const std::string &name) override
Print nmodl function or procedure (common code)
-
void print_net_receive_common_code(const ast::Block &node, bool need_mech_inst=true)
Print the common code section for net receive related methods.
-
void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
+
void print_function_or_procedure(const ast::Block &node, const std::string &name) override
Print nmodl function or procedure (common code)
+
void print_net_receive_common_code(const ast::Block &node, bool need_mech_inst=true)
Print the common code section for net receive related methods.
+
void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
const char * default_float_data_type() const noexcept
Default data type for floating point elements.
-
void print_first_pointer_var_index_getter()
Print the getter method for index position of first pointer variable.
-
void print_setup_range_variable()
Print the function that initialize range variable with different data type.
-
std::string internal_method_arguments() override
Arguments for functions that are defined and used internally.
-
virtual void print_instance_struct_transfer_routine_declarations()
Print declarations of the functions used by print_instance_struct_copy_to_device and print_instance_s...
-
std::string nrn_thread_arguments() const override
Arguments for "_threadargs_" macro in neuron implementation.
+
std::string conc_write_statement(const std::string &ion_name, const std::string &concentration, int index) override
Generate Function call statement for nrn_wrote_conc.
+
void print_first_pointer_var_index_getter()
Print the getter method for index position of first pointer variable.
+
void print_setup_range_variable()
Print the function that initialize range variable with different data type.
+
std::string internal_method_arguments() override
Arguments for functions that are defined and used internally.
+
virtual void print_instance_struct_transfer_routine_declarations()
Print declarations of the functions used by print_instance_struct_copy_to_device and print_instance_s...
+
std::string nrn_thread_arguments() const override
Arguments for "_threadargs_" macro in neuron implementation.
Represent newton solver solution block based on Eigen.
-
void print_net_receive_arg_size_getter()
Print the getter method for getting number of arguments for net_receive.
-
bool is_functor_const(const ast::StatementBlock &variable_block, const ast::StatementBlock &functor_block)
Checks whether the functor_block generated by sympy solver modifies any variable outside its scope.
+
void print_net_receive_arg_size_getter()
Print the getter method for getting number of arguments for net_receive.
+
bool is_functor_const(const ast::StatementBlock &variable_block, const ast::StatementBlock &functor_block)
Checks whether the functor_block generated by sympy solver modifies any variable outside its scope.
Visitor for printing C++ code compatible with legacy api of CoreNEURON
Base class for all block scoped nodes.
Definition: block.hpp:41
Represents a INITIAL block in the NMODL.
-
virtual void print_nrn_cur_matrix_shadow_update()
Print the update to matrix elements with/without shadow vectors.
-
std::string register_mechanism_arguments() const override
Arguments for register_mech or point_register_mech function.
-
virtual void print_net_init_acc_serial_annotation_block_begin()
Print accelerator kernels begin annotation for net_init kernel.
-
virtual void print_deriv_advance_flag_transfer_to_device() const
Print the code to copy derivative advance flag to device.
-
void print_first_random_var_index_getter()
Print the getter method for index position of first RANDOM variable.
-
std::string process_shadow_update_statement(const ShadowUseStatement &statement, BlockType type)
Process shadow update statement.
+
virtual void print_nrn_cur_matrix_shadow_update()
Print the update to matrix elements with/without shadow vectors.
+
std::string register_mechanism_arguments() const override
Arguments for register_mech or point_register_mech function.
+
virtual void print_net_init_acc_serial_annotation_block_begin()
Print accelerator kernels begin annotation for net_init kernel.
+
virtual void print_deriv_advance_flag_transfer_to_device() const
Print the code to copy derivative advance flag to device.
+
void print_first_random_var_index_getter()
Print the getter method for index position of first RANDOM variable.
Represent WATCH statement in NMODL.
-
virtual void print_eigen_linear_solver(const std::string &float_type, int N)
-
virtual void print_before_after_block(const ast::Block *node, size_t block_id)
Print NMODL before / after block in target backend code.
+
virtual void print_eigen_linear_solver(const std::string &float_type, int N)
+
virtual void print_before_after_block(const ast::Block *node, size_t block_id)
Print NMODL before / after block in target backend code.
Represents a BREAKPOINT block in NMODL.
-
CodegenCoreneuronCppVisitor(std::string mod_filename, std::ostream &stream, std::string float_type, const bool optimize_ionvar_copies)
Visitor for printing C++ code compatible with legacy api of CoreNEURON
+
CodegenCoreneuronCppVisitor(std::string mod_filename, std::ostream &stream, std::string float_type, const bool optimize_ionvar_copies)
Visitor for printing C++ code compatible with legacy api of CoreNEURON
-
static std::pair< std::string, std::string > write_ion_variable_name(const std::string &name)
Return ion variable name and corresponding ion write variable name.
Helper class for printing C/C++ code.
-
void print_ion_var_structure()
Print structure of ion variables used for local copies.
-
ParamVector internal_method_parameters() override
Parameters for internally defined functions.
+
void print_ion_var_structure()
Print structure of ion variables used for local copies.
+
ParamVector internal_method_parameters() override
Parameters for internally defined functions.
int position_of_int_var(const std::string &name) const override
Determine the position in the data array for a given int variable.
-
virtual void print_channel_iteration_block_parallel_hint(BlockType type, const ast::Block *block)
Print pragma annotations for channel iterations.
-
virtual bool is_constant_variable(const std::string &name) const
Check if variable is qualified as constant.
-
void print_function_procedure_helper(const ast::Block &node) override
Common helper function to help printing function or procedure blocks.
-
const char * external_method_parameters(bool table=false) noexcept override
Parameters for functions in generated code that are called back from external code.
-
void visit_for_netcon(const ast::ForNetcon &node) override
visit node of type ast::ForNetcon
-
virtual void print_compute_functions() override
Print all compute functions for every backend.
-
void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
-
virtual void print_memory_allocation_routine() const
Print memory allocation routine.
-
void print_check_table_thread_function()
Print check_table functions.
-
void print_namespace_begin() override
Print start of namespaces.
+
virtual void print_channel_iteration_block_parallel_hint(BlockType type, const ast::Block *block)
Print pragma annotations for channel iterations.
+
virtual bool is_constant_variable(const std::string &name) const
Check if variable is qualified as constant.
+
void print_function_procedure_helper(const ast::Block &node) override
Common helper function to help printing function or procedure blocks.
+
const char * external_method_parameters(bool table=false) noexcept override
Parameters for functions in generated code that are called back from external code.
+
void visit_for_netcon(const ast::ForNetcon &node) override
visit node of type ast::ForNetcon
+
virtual void print_compute_functions() override
Print all compute functions for every backend.
+
void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
+
virtual void print_memory_allocation_routine() const
Print memory allocation routine.
+
void print_check_table_thread_function()
Print check_table functions.
+
void print_namespace_begin() override
Print start of namespaces.
virtual std::string backend_name() const override
Name of the code generation backend.
-
virtual void print_rhs_d_shadow_variables()
Print the setup method for setting matrix shadow vectors.
-
std::string process_verbatim_text(std::string const &text) override
Process a verbatim block for possible variable renaming.
-
void print_net_receive()
Print net_receive function definition.
+
virtual void print_rhs_d_shadow_variables()
Print the setup method for setting matrix shadow vectors.
+
std::string process_verbatim_text(std::string const &text) override
Process a verbatim block for possible variable renaming.
+
void print_net_receive()
Print net_receive function definition.
bool vectorize
true if mod file is vectorizable (which should be always true for coreneuron) But there are some bloc...
-
std::string breakpoint_current(std::string current) const
Determine the variable name for the "current" used in breakpoint block taking into account intermedia...
-
void print_function(const ast::FunctionBlock &node) override
Print NMODL function in target backend code.
-
void print_top_verbatim_blocks()
Print top level (global scope) verbatim blocks.
+
bool optimize_ion_variable_copies() const override
Check if ion variable copies should be avoided.
+
void print_function(const ast::FunctionBlock &node) override
Print NMODL function in target backend code.
+
void print_top_verbatim_blocks()
Print top level (global scope) verbatim blocks.
Various types to store code generation specific information.
-
std::vector< std::string > ion_read_statements_optimized(BlockType type) const
For a given output block type, return minimal statements for all read ion variables.
Represent linear solver solution block based on Eigen.
-
void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
-
void visit_eigen_newton_solver_block(const ast::EigenNewtonSolverBlock &node) override
visit node of type ast::EigenNewtonSolverBlock
-
void print_nrn_constructor() override
Print nrn_constructor function definition.
-
virtual void print_kernel_data_present_annotation_block_end()
Print matching block end of accelerator annotations for data presence on device.
-
virtual void print_instance_struct_transfer_routines(std::vector< std::string > const &)
Print the definitions of the functions used by print_instance_struct_copy_to_device and print_instanc...
-
void print_nrn_alloc() override
Print nrn_alloc function definition.
-
virtual void print_nrn_cur_matrix_shadow_reduction()
Print the reduction to matrix elements from shadow vectors.
-
void print_memb_list_getter()
Print the getter method for returning membrane list from NrnThread.
-
static std::string get_parameter_str(const ParamVector &params)
Generate the string representing the procedure parameter declaration.
- -
const char * external_method_arguments() noexcept override
Arguments for external functions called from generated code.
-
void print_instance_variable_setup()
Print the function that initialize instance structure.
-
void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
+
void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
+
void visit_eigen_newton_solver_block(const ast::EigenNewtonSolverBlock &node) override
visit node of type ast::EigenNewtonSolverBlock
+
void print_nrn_constructor() override
Print nrn_constructor function definition.
+
virtual void print_kernel_data_present_annotation_block_end()
Print matching block end of accelerator annotations for data presence on device.
+
virtual void print_instance_struct_transfer_routines(std::vector< std::string > const &)
Print the definitions of the functions used by print_instance_struct_copy_to_device and print_instanc...
+
void print_nrn_alloc() override
Print nrn_alloc function definition.
+
virtual void print_nrn_cur_matrix_shadow_reduction()
Print the reduction to matrix elements from shadow vectors.
+
void print_memb_list_getter()
Print the getter method for returning membrane list from NrnThread.
+
static std::string get_parameter_str(const ParamVector &params)
Generate the string representing the procedure parameter declaration.
+ +
const char * external_method_arguments() noexcept override
Arguments for external functions called from generated code.
+
void print_instance_variable_setup()
Print the function that initialize instance structure.
+
void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
Represents block encapsulating list of statements.
-
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
-
void print_namespace_start() override
Prints the start of the coreneuron namespace.
+
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
+
void print_namespace_start() override
Prints the start of the coreneuron namespace.
-
virtual void print_abort_routine() const
Print backend specific abort routine.
-
void print_table_check_function(const ast::Block &node)
Print check_function() for functions or procedure using table.
-
void print_nrn_cur() override
Print nrn_cur / current update function definition.
-
std::string get_range_var_float_type(const SymbolType &symbol)
Returns floating point type for given range variable symbol.
-
bool ion_variable_struct_required() const
Check if a structure for ion variables is required.
-
virtual void print_net_send_buffering_cnt_update() const
Print the code related to the update of NetSendBuffer_t cnt.
-
void print_thread_memory_callbacks()
Print thread related memory allocation and deallocation callbacks.
+
virtual void print_abort_routine() const
Print backend specific abort routine.
+
void print_table_check_function(const ast::Block &node)
Print check_function() for functions or procedure using table.
+
void print_nrn_cur() override
Print nrn_cur / current update function definition.
+
std::string get_range_var_float_type(const SymbolType &symbol)
Returns floating point type for given range variable symbol.
+
virtual void print_net_send_buffering_cnt_update() const
Print the code related to the update of NetSendBuffer_t cnt.
+
void print_thread_memory_callbacks()
Print thread related memory allocation and deallocation callbacks.
Represent a callback to NEURON's derivimplicit solver.
-
Represents ion write statement during code generation.
-
void print_net_receive_buffering(bool need_mech_inst=true)
Print kernel for buffering net_receive events.
-
virtual void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
+
void print_net_receive_buffering(bool need_mech_inst=true)
Print kernel for buffering net_receive events.
+
virtual void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
std::string float_type
Data type of floating point variables.
Implement logger based on spdlog library.
bool enable_variable_name_lookup
Variable name should be converted to instance name (but not for function arguments)
BlockType
Helper to represent various block types.
-
void print_mechanism_register() override
Print the mechanism registration function.
-
virtual void print_global_method_annotation()
Print backend specific global method annotation.
-
void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
-
std::string nrn_thread_internal_arguments() override
Arguments for "_threadargs_" macro in neuron implementation.
-
bool optimize_ion_variable_copies() const
Check if ion variable copies should be avoided.
-
virtual void print_device_atomic_capture_annotation() const
Print pragma annotation for increase and capture of variable in automatic way.
-
void visit_derivimplicit_callback(const ast::DerivimplicitCallback &node) override
visit node of type ast::DerivimplicitCallback
-
std::vector< ShadowUseStatement > ion_write_statements(BlockType type)
For a given output block type, return statements for writing back ion variables.
+
void print_mechanism_register() override
Print the mechanism registration function.
+
virtual void print_global_method_annotation()
Print backend specific global method annotation.
+
void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
+
std::string nrn_thread_internal_arguments() override
Arguments for "_threadargs_" macro in neuron implementation.
+
virtual void print_device_atomic_capture_annotation() const
Print pragma annotation for increase and capture of variable in automatic way.
+
void visit_derivimplicit_callback(const ast::DerivimplicitCallback &node) override
visit node of type ast::DerivimplicitCallback
Visitor for printing C++ code compatible with legacy api of CoreNEURON
-
virtual void print_get_memb_list()
Print the target backend code for defining and checking a local Memb_list variable.
-
void print_num_variable_getter()
Print the getter methods for float and integer variables count.
+
virtual void print_get_memb_list()
Print the target backend code for defining and checking a local Memb_list variable.
+
void print_num_variable_getter()
Print the getter methods for float and integer variables count.
std::string mod_filename
Name of mod file (without .mod suffix)
-
void print_standard_includes() override
Print standard C/C++ includes.
-
virtual void print_net_receive_loop_end()
Print the code for closing the main net_receive loop.
-
void print_mech_type_getter()
Print the getter method for returning mechtype.
-
std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
Determine the name of a float variable given its symbol.
-
virtual void print_global_variable_device_update_annotation()
Print the pragma annotation to update global variables from host to the device.
+
void print_standard_includes() override
Print standard C/C++ includes.
+
virtual void print_net_receive_loop_end()
Print the code for closing the main net_receive loop.
+
void print_mech_type_getter()
Print the getter method for returning mechtype.
+
std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
Determine the name of a float variable given its symbol.
+
virtual void print_global_variable_device_update_annotation()
Print the pragma annotation to update global variables from host to the device.
std::unique_ptr< CodePrinter > printer
Code printer object for target (C++)
-
void print_function_tables(const ast::FunctionTableBlock &node)
Print NMODL function_table in target backend code.
-
std::string method_name(const std::string &name) const
Constructs the name of a function or procedure.
-
virtual void visit_watch_statement(const ast::WatchStatement &node) override
visit node of type ast::WatchStatement
-
void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
-
virtual void print_backend_includes()
Print backend specific includes (none needed for C++ backend)
-
std::string process_verbatim_token(const std::string &token)
Process a token in a verbatim block for possible variable renaming.
-
void print_nrn_state() override
Print nrn_state / state update function definition.
-
virtual void print_codegen_routines() override
Print entry point to code generation.
- -
virtual void print_net_send_buffering_grow()
Print statement that grows NetSendBuffering_t structure if needed.
-
virtual void print_backend_namespace_stop()
Prints the end of namespace for the backend-specific code.
-
virtual void print_net_send_buf_update_to_host() const
Print the code to update NetSendBuffer_t from device to host.
-
void print_data_structures(bool print_initializers) override
Print all classes.
-
std::string replace_if_verbatim_variable(std::string name)
Replace commonly used verbatim variables.
-
virtual void print_ion_var_constructor(const std::vector< std::string > &members)
Print constructor of ion variables.
+
void print_function_tables(const ast::FunctionTableBlock &node)
Print NMODL function_table in target backend code.
+
std::string method_name(const std::string &name) const
Constructs the name of a function or procedure.
+
virtual void visit_watch_statement(const ast::WatchStatement &node) override
visit node of type ast::WatchStatement
+
void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
+
virtual void print_backend_includes()
Print backend specific includes (none needed for C++ backend)
+
std::string process_verbatim_token(const std::string &token)
Process a token in a verbatim block for possible variable renaming.
+
void print_nrn_state() override
Print nrn_state / state update function definition.
+
virtual void print_codegen_routines() override
Print entry point to code generation.
+ +
virtual void print_net_send_buffering_grow()
Print statement that grows NetSendBuffering_t structure if needed.
+
virtual void print_backend_namespace_stop()
Prints the end of namespace for the backend-specific code.
+
virtual void print_net_send_buf_update_to_host() const
Print the code to update NetSendBuffer_t from device to host.
+
void print_data_structures(bool print_initializers) override
Print all classes.
+
std::string replace_if_verbatim_variable(std::string name)
Replace commonly used verbatim variables.
+
virtual void print_ion_var_constructor(const std::vector< std::string > &members)
Print constructor of ion variables.
int position_of_float_var(const std::string &name) const override
Determine the position in the data array for a given float variable.
std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
A vector of parameters represented by a 4-tuple of strings:
Concrete visitor for all AST classes.
diff --git a/html/doxygen/codegen__cpp__visitor_8cpp_source.html b/html/doxygen/codegen__cpp__visitor_8cpp_source.html index 1b724a7f52..9822899c56 100644 --- a/html/doxygen/codegen__cpp__visitor_8cpp_source.html +++ b/html/doxygen/codegen__cpp__visitor_8cpp_source.html @@ -122,1034 +122,1230 @@
26 /* Common helper routines accross codegen functions */
27 /****************************************************************************************/
28 
-
29 
- -
31  std::string str;
-
32  bool is_first = true;
-
33  for (const auto& param: params) {
-
34  if (is_first) {
-
35  is_first = false;
-
36  } else {
-
37  str += ", ";
-
38  }
-
39  str += fmt::format("{}{} {}{}",
-
40  std::get<0>(param),
-
41  std::get<1>(param),
-
42  std::get<2>(param),
-
43  std::get<3>(param));
-
44  }
-
45  return str;
-
46 }
-
47 
-
48 
-
49 template <typename T>
-
50 bool CodegenCppVisitor::has_parameter_of_name(const T& node, const std::string& name) {
-
51  auto parameters = node->get_parameters();
-
52  return std::any_of(parameters.begin(),
-
53  parameters.end(),
-
54  [&name](const decltype(*parameters.begin()) arg) {
-
55  return arg->get_node_name() == name;
-
56  });
-
57 }
-
58 
-
59 
-
60 /**
-
61  * \details Certain statements like unit, comment, solve can/need to be skipped
-
62  * during code generation. Note that solve block is wrapped in expression
-
63  * statement and hence we have to check inner expression. It's also true
-
64  * for the initial block defined inside net receive block.
-
65  */
- -
67  // clang-format off
-
68  if (node.is_unit_state()
-
69  || node.is_line_comment()
-
70  || node.is_block_comment()
-
71  || node.is_solve_block()
-
72  || node.is_conductance_hint()
-
73  || node.is_table_statement()) {
-
74  return true;
-
75  }
-
76  // clang-format on
-
77  if (node.is_expression_statement()) {
-
78  auto expression = dynamic_cast<const ExpressionStatement*>(&node)->get_expression();
-
79  if (expression->is_solve_block()) {
-
80  return true;
-
81  }
-
82  if (expression->is_initial_block()) {
-
83  return true;
-
84  }
-
85  }
-
86  return false;
-
87 }
-
88 
-
89 
- -
91  if (net_receive_required() && !info.artificial_cell) {
-
92  if (info.net_event_used || info.net_send_used || info.is_watch_used()) {
-
93  return true;
-
94  }
-
95  }
-
96  return false;
-
97 }
-
98 
-
99 
- -
101  return info.point_process && !info.artificial_cell && info.net_receive_node != nullptr;
-
102 }
+ +
30  return optimize_ion_variable_copies() && info.ion_has_write_variable();
+
31 }
+
32 
+
33 
+ +
35  std::string str;
+
36  bool is_first = true;
+
37  for (const auto& param: params) {
+
38  if (is_first) {
+
39  is_first = false;
+
40  } else {
+
41  str += ", ";
+
42  }
+
43  str += fmt::format("{}{} {}{}",
+
44  std::get<0>(param),
+
45  std::get<1>(param),
+
46  std::get<2>(param),
+
47  std::get<3>(param));
+
48  }
+
49  return str;
+
50 }
+
51 
+
52 
+
53 template <typename T>
+
54 bool CodegenCppVisitor::has_parameter_of_name(const T& node, const std::string& name) {
+
55  auto parameters = node->get_parameters();
+
56  return std::any_of(parameters.begin(),
+
57  parameters.end(),
+
58  [&name](const decltype(*parameters.begin()) arg) {
+
59  return arg->get_node_name() == name;
+
60  });
+
61 }
+
62 
+
63 
+
64 /**
+
65  * \details Certain statements like unit, comment, solve can/need to be skipped
+
66  * during code generation. Note that solve block is wrapped in expression
+
67  * statement and hence we have to check inner expression. It's also true
+
68  * for the initial block defined inside net receive block.
+
69  */
+ +
71  // clang-format off
+
72  if (node.is_unit_state()
+
73  || node.is_line_comment()
+
74  || node.is_block_comment()
+
75  || node.is_solve_block()
+
76  || node.is_conductance_hint()
+
77  || node.is_table_statement()) {
+
78  return true;
+
79  }
+
80  // clang-format on
+
81  if (node.is_expression_statement()) {
+
82  auto expression = dynamic_cast<const ExpressionStatement*>(&node)->get_expression();
+
83  if (expression->is_solve_block()) {
+
84  return true;
+
85  }
+
86  if (expression->is_initial_block()) {
+
87  return true;
+
88  }
+
89  }
+
90  return false;
+
91 }
+
92 
+
93 
+ +
95  if (net_receive_required() && !info.artificial_cell) {
+
96  if (info.net_event_used || info.net_send_used || info.is_watch_used()) {
+
97  return true;
+
98  }
+
99  }
+
100  return false;
+
101 }
+
102 
103 
-
104 
- -
106  if (info.artificial_cell) {
-
107  return false;
-
108  }
-
109  return info.nrn_state_block != nullptr || breakpoint_exist();
-
110 }
-
111 
-
112 
-
113 bool CodegenCppVisitor::nrn_cur_required() const noexcept {
-
114  return info.breakpoint_node != nullptr && !info.currents.empty();
-
115 }
+ +
105  return info.point_process && !info.artificial_cell && info.net_receive_node != nullptr;
+
106 }
+
107 
+
108 
+ +
110  if (info.artificial_cell) {
+
111  return false;
+
112  }
+
113  return info.nrn_state_block != nullptr || breakpoint_exist();
+
114 }
+
115 
116 
-
117 
- -
119  return info.net_receive_node != nullptr;
-
120 }
+
117 bool CodegenCppVisitor::nrn_cur_required() const noexcept {
+
118  return info.breakpoint_node != nullptr && !info.currents.empty();
+
119 }
+
120 
121 
-
122 
-
123 bool CodegenCppVisitor::breakpoint_exist() const noexcept {
-
124  return info.breakpoint_node != nullptr;
-
125 }
+ +
123  return info.net_receive_node != nullptr;
+
124 }
+
125 
126 
-
127 
- -
129  return net_receive_exist();
-
130 }
+
127 bool CodegenCppVisitor::breakpoint_exist() const noexcept {
+
128  return info.breakpoint_node != nullptr;
+
129 }
+
130 
131 
-
132 
-
133 /**
-
134  * \details When floating point data type is not default (i.e. double) then we
-
135  * have to copy old array to new type (for range variables).
-
136  */
- -
138  return codegen::naming::DEFAULT_FLOAT_TYPE != float_data_type();
-
139 }
-
140 
-
141 
-
142 // check if there is a function or procedure defined with given name
-
143 bool CodegenCppVisitor::defined_method(const std::string& name) const {
-
144  const auto& function = program_symtab->lookup(name);
-
145  auto properties = NmodlType::function_block | NmodlType::procedure_block;
-
146  return function && function->has_any_property(properties);
-
147 }
-
148 
- -
150  return codegen_float_variables.size();
+ +
133  return net_receive_exist();
+
134 }
+
135 
+
136 
+
137 /**
+
138  * \details When floating point data type is not default (i.e. double) then we
+
139  * have to copy old array to new type (for range variables).
+
140  */
+ +
142  return codegen::naming::DEFAULT_FLOAT_TYPE != float_data_type();
+
143 }
+
144 
+
145 
+
146 // check if there is a function or procedure defined with given name
+
147 bool CodegenCppVisitor::defined_method(const std::string& name) const {
+
148  const auto& function = program_symtab->lookup(name);
+
149  auto properties = NmodlType::function_block | NmodlType::procedure_block;
+
150  return function && function->has_any_property(properties);
151 }
152 
-
153 
- -
155  const auto count_semantics = [](int sum, const IndexSemantics& sem) { return sum += sem.size; };
-
156  return std::accumulate(info.semantics.begin(), info.semantics.end(), 0, count_semantics);
-
157 }
-
158 
-
159 
-
160 /**
-
161  * \details We can directly print value but if user specify value as integer then
-
162  * then it gets printed as an integer. To avoid this, we use below wrapper.
-
163  * If user has provided integer then it gets printed as 1.0 (similar to mod2c
-
164  * and neuron where ".0" is appended). Otherwise we print double variables as
-
165  * they are represented in the mod file by user. If the value is in scientific
-
166  * representation (1e+20, 1E-15) then keep it as it is.
-
167  */
-
168 std::string CodegenCppVisitor::format_double_string(const std::string& s_value) {
- -
170 }
-
171 
-
172 
-
173 std::string CodegenCppVisitor::format_float_string(const std::string& s_value) {
- -
175 }
+ +
154  return codegen_float_variables.size();
+
155 }
+
156 
+
157 
+ +
159  const auto count_semantics = [](int sum, const IndexSemantics& sem) { return sum += sem.size; };
+
160  return std::accumulate(info.semantics.begin(), info.semantics.end(), 0, count_semantics);
+
161 }
+
162 
+
163 
+
164 /**
+
165  * \details We can directly print value but if user specify value as integer then
+
166  * then it gets printed as an integer. To avoid this, we use below wrapper.
+
167  * If user has provided integer then it gets printed as 1.0 (similar to mod2c
+
168  * and neuron where ".0" is appended). Otherwise we print double variables as
+
169  * they are represented in the mod file by user. If the value is in scientific
+
170  * representation (1e+20, 1E-15) then keep it as it is.
+
171  */
+
172 std::string CodegenCppVisitor::format_double_string(const std::string& s_value) {
+ +
174 }
+
175 
176 
-
177 
-
178 /**
-
179  * \details Statements like if, else etc. don't need semicolon at the end.
-
180  * (Note that it's valid to have "extraneous" semicolon). Also, statement
-
181  * block can appear as statement using expression statement which need to
-
182  * be inspected.
-
183  */
- -
185  // clang-format off
-
186  if (node.is_if_statement()
-
187  || node.is_else_if_statement()
-
188  || node.is_else_statement()
-
189  || node.is_from_statement()
-
190  || node.is_verbatim()
-
191  || node.is_conductance_hint()
-
192  || node.is_while_statement()
-
193  || node.is_protect_statement()
-
194  || node.is_mutex_lock()
-
195  || node.is_mutex_unlock()) {
-
196  return false;
-
197  }
-
198  if (node.is_expression_statement()) {
-
199  auto expression = dynamic_cast<const ExpressionStatement&>(node).get_expression();
-
200  if (expression->is_statement_block()
-
201  || expression->is_eigen_newton_solver_block()
-
202  || expression->is_eigen_linear_solver_block()
-
203  || expression->is_solution_expression()
-
204  || expression->is_for_netcon()) {
-
205  return false;
-
206  }
-
207  }
-
208  // clang-format on
-
209  return true;
-
210 }
-
211 
-
212 
-
213 /****************************************************************************************/
-
214 /* Main printing routines for code generation */
-
215 /****************************************************************************************/
-
216 
-
217 
- -
219  // Assert some things that we assume when copying instances of this struct
-
220  // to the GPU and so on.
-
221  printer->fmt_line("static_assert(std::is_trivially_copy_constructible_v<{}>);",
-
222  global_struct());
-
223  printer->fmt_line("static_assert(std::is_trivially_move_constructible_v<{}>);",
-
224  global_struct());
-
225  printer->fmt_line("static_assert(std::is_trivially_copy_assignable_v<{}>);", global_struct());
-
226  printer->fmt_line("static_assert(std::is_trivially_move_assignable_v<{}>);", global_struct());
-
227  printer->fmt_line("static_assert(std::is_trivially_destructible_v<{}>);", global_struct());
-
228 }
-
229 
-
230 
- -
232  printer->add_line(global_struct(), ' ', global_struct_instance(), ';');
-
233 }
-
234 
-
235 
- -
237  const auto& name = node.get_node_name();
-
238 
-
239  // return C++ function name for RANDOM construct function
-
240  // e.g. nrnran123_negexp for random_negexp
-
241  auto get_renamed_random_function =
-
242  [&](const std::string& name) -> std::pair<std::string, bool> {
- -
244  return {codegen::naming::RANDOM_FUNCTIONS_MAPPING[name], true};
-
245  }
-
246  return {name, false};
-
247  };
-
248  std::string function_name;
-
249  bool is_random_function;
-
250  std::tie(function_name, is_random_function) = get_renamed_random_function(name);
+
177 std::string CodegenCppVisitor::format_float_string(const std::string& s_value) {
+ +
179 }
+
180 
+
181 
+
182 /**
+
183  * \details Statements like if, else etc. don't need semicolon at the end.
+
184  * (Note that it's valid to have "extraneous" semicolon). Also, statement
+
185  * block can appear as statement using expression statement which need to
+
186  * be inspected.
+
187  */
+ +
189  // clang-format off
+
190  if (node.is_if_statement()
+
191  || node.is_else_if_statement()
+
192  || node.is_else_statement()
+
193  || node.is_from_statement()
+
194  || node.is_verbatim()
+
195  || node.is_conductance_hint()
+
196  || node.is_while_statement()
+
197  || node.is_protect_statement()
+
198  || node.is_mutex_lock()
+
199  || node.is_mutex_unlock()) {
+
200  return false;
+
201  }
+
202  if (node.is_expression_statement()) {
+
203  auto expression = dynamic_cast<const ExpressionStatement&>(node).get_expression();
+
204  if (expression->is_statement_block()
+
205  || expression->is_eigen_newton_solver_block()
+
206  || expression->is_eigen_linear_solver_block()
+
207  || expression->is_solution_expression()
+
208  || expression->is_for_netcon()) {
+
209  return false;
+
210  }
+
211  }
+
212  // clang-format on
+
213  return true;
+
214 }
+
215 
+
216 /**
+
217  * \details Depending upon the block type, we have to print read/write ion variables
+
218  * during code generation. Depending on block/procedure being printed, this
+
219  * method return statements as vector. As different code backends could have
+
220  * different variable names, we rely on backend-specific read_ion_variable_name
+
221  * and write_ion_variable_name method which will be overloaded.
+
222  */
+
223 std::vector<std::string> CodegenCppVisitor::ion_read_statements(BlockType type) const {
+
224  if (optimize_ion_variable_copies()) {
+
225  return ion_read_statements_optimized(type);
+
226  }
+
227  std::vector<std::string> statements;
+
228  for (const auto& ion: info.ions) {
+
229  auto name = ion.name;
+
230  for (const auto& var: ion.reads) {
+
231  auto const iter = std::find(ion.implicit_reads.begin(), ion.implicit_reads.end(), var);
+
232  if (iter != ion.implicit_reads.end()) {
+
233  continue;
+
234  }
+
235  auto variable_names = read_ion_variable_name(var);
+
236  auto first = get_variable_name(variable_names.first);
+
237  auto second = get_variable_name(variable_names.second);
+
238  statements.push_back(fmt::format("{} = {};", first, second));
+
239  }
+
240  for (const auto& var: ion.writes) {
+
241  if (ion.is_ionic_conc(var)) {
+
242  auto variables = read_ion_variable_name(var);
+
243  auto first = get_variable_name(variables.first);
+
244  auto second = get_variable_name(variables.second);
+
245  statements.push_back(fmt::format("{} = {};", first, second));
+
246  }
+
247  }
+
248  }
+
249  return statements;
+
250 }
251 
-
252  if (defined_method(name)) {
-
253  function_name = method_name(name);
-
254  }
-
255 
-
256  if (is_net_send(name)) {
-
257  print_net_send_call(node);
-
258  return;
-
259  }
-
260 
-
261  if (is_net_move(name)) {
-
262  print_net_move_call(node);
-
263  return;
+
252 
+
253 std::vector<std::string> CodegenCppVisitor::ion_read_statements_optimized(BlockType type) const {
+
254  std::vector<std::string> statements;
+
255  for (const auto& ion: info.ions) {
+
256  for (const auto& var: ion.writes) {
+
257  if (ion.is_ionic_conc(var)) {
+
258  auto variables = read_ion_variable_name(var);
+
259  auto first = "ionvar." + variables.first;
+
260  const auto& second = get_variable_name(variables.second);
+
261  statements.push_back(fmt::format("{} = {};", first, second));
+
262  }
+
263  }
264  }
-
265 
-
266  if (is_net_event(name)) {
-
267  print_net_event_call(node);
-
268  return;
-
269  }
-
270 
-
271  const auto& arguments = node.get_arguments();
-
272  printer->add_text(function_name, '(');
-
273 
-
274  if (defined_method(name)) {
-
275  printer->add_text(internal_method_arguments());
-
276  if (!arguments.empty()) {
-
277  printer->add_text(", ");
-
278  }
-
279  }
-
280 
-
281  // first argument to random functions need to be type casted
-
282  // from void* to nrnran123_State*.
-
283  if (is_random_function && !arguments.empty()) {
-
284  printer->add_text("(nrnran123_State*)");
-
285  }
-
286 
-
287  print_vector_elements(arguments, ", ");
-
288  printer->add_text(')');
-
289 }
-
290 
-
291 
- -
293  printer->add_line("#ifndef NRN_PRCELLSTATE");
-
294  printer->add_line("#define NRN_PRCELLSTATE 0");
-
295  printer->add_line("#endif");
-
296 }
-
297 
+
265  return statements;
+
266 }
+
267 
+
268 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
+
269 std::vector<ShadowUseStatement> CodegenCppVisitor::ion_write_statements(BlockType type) {
+
270  std::vector<ShadowUseStatement> statements;
+
271  for (const auto& ion: info.ions) {
+
272  std::string concentration;
+
273  auto name = ion.name;
+
274  for (const auto& var: ion.writes) {
+
275  auto variable_names = write_ion_variable_name(var);
+
276  if (ion.is_ionic_current(var)) {
+
277  if (type == BlockType::Equation) {
+
278  auto current = breakpoint_current(var);
+
279  auto lhs = variable_names.first;
+
280  auto op = "+=";
+
281  auto rhs = get_variable_name(current);
+
282  if (info.point_process) {
+
283  auto area = get_variable_name(naming::NODE_AREA_VARIABLE);
+
284  rhs += fmt::format("*(1.e2/{})", area);
+
285  }
+
286  statements.push_back(ShadowUseStatement{lhs, op, rhs});
+
287  }
+
288  } else {
+
289  if (!ion.is_rev_potential(var)) {
+
290  concentration = var;
+
291  }
+
292  auto lhs = variable_names.first;
+
293  auto op = "=";
+
294  auto rhs = get_variable_name(variable_names.second);
+
295  statements.push_back(ShadowUseStatement{lhs, op, rhs});
+
296  }
+
297  }
298 
- -
300  auto variable_printer = [&](const std::vector<SymbolType>& variables) {
-
301  for (const auto& v: variables) {
-
302  auto name = v->get_name();
-
303  if (!info.point_process) {
-
304  name += "_" + info.mod_suffix;
-
305  }
-
306  if (v->is_array()) {
-
307  name += fmt::format("[{}]", v->get_length());
+
299  if (type == BlockType::Initial && !concentration.empty()) {
+
300  int index = 0;
+
301  if (ion.is_intra_cell_conc(concentration)) {
+
302  index = 1;
+
303  } else if (ion.is_extra_cell_conc(concentration)) {
+
304  index = 2;
+
305  } else {
+
306  /// \todo Unhandled case in neuron implementation
+
307  throw std::logic_error(fmt::format("codegen error for {} ion", ion.name));
308  }
-
309  printer->add_line(add_escape_quote(name), ",");
-
310  }
-
311  };
-
312 
-
313  printer->add_newline(2);
-
314  printer->add_line("/** channel information */");
-
315  printer->fmt_line("static const char *{}[] = {{", get_channel_info_var_name());
-
316  printer->increase_indent();
-
317  printer->add_line(add_escape_quote(nmodl_version()), ",");
-
318  printer->add_line(add_escape_quote(info.mod_suffix), ",");
-
319  variable_printer(info.range_parameter_vars);
-
320  printer->add_line("0,");
-
321  variable_printer(info.range_assigned_vars);
-
322  printer->add_line("0,");
-
323  variable_printer(info.range_state_vars);
-
324  printer->add_line("0,");
-
325  variable_printer(info.pointer_variables);
-
326  printer->add_line("0");
-
327  printer->decrease_indent();
-
328  printer->add_line("};");
-
329 }
-
330 
-
331 
-
332 /****************************************************************************************/
-
333 /* Printing routines for code generation */
-
334 /****************************************************************************************/
-
335 
-
336 
- -
338  bool open_brace,
-
339  bool close_brace) {
-
340  if (open_brace) {
-
341  printer->push_block();
-
342  }
-
343 
-
344  const auto& statements = node.get_statements();
-
345  for (const auto& statement: statements) {
-
346  if (statement_to_skip(*statement)) {
-
347  continue;
-
348  }
-
349  /// not necessary to add indent for verbatim block (pretty-printing)
-
350  if (!statement->is_verbatim() && !statement->is_mutex_lock() &&
-
351  !statement->is_mutex_unlock() && !statement->is_protect_statement()) {
-
352  printer->add_indent();
-
353  }
-
354  statement->accept(*this);
-
355  if (need_semicolon(*statement)) {
-
356  printer->add_text(';');
-
357  }
-
358  if (!statement->is_mutex_lock() && !statement->is_mutex_unlock()) {
-
359  printer->add_newline();
-
360  }
-
361  }
-
362 
-
363  if (close_brace) {
-
364  printer->pop_block_nl(0);
-
365  }
+
309  auto ion_type_name = fmt::format("{}_type", ion.name);
+
310  auto lhs = fmt::format("int {}", ion_type_name);
+
311  auto op = "=";
+
312  auto rhs = get_variable_name(ion_type_name);
+
313  statements.push_back(ShadowUseStatement{lhs, op, rhs});
+
314  auto statement = conc_write_statement(ion.name, concentration, index);
+
315  statements.push_back(ShadowUseStatement{statement, "", ""});
+
316  }
+
317  }
+
318  return statements;
+
319 }
+
320 
+
321 /**
+
322  * If mechanisms dependency level execution is enabled then certain updates
+
323  * like ionic current contributions needs to be atomically updated. In this
+
324  * case we first update current mechanism's shadow vector and then add statement
+
325  * to queue that will be used in reduction queue.
+
326  */
+ +
328  BlockType /* type */) {
+
329  // when there is no operator or rhs then that statement doesn't need shadow update
+
330  if (statement.op.empty() && statement.rhs.empty()) {
+
331  auto text = statement.lhs + ";";
+
332  return text;
+
333  }
+
334 
+
335  // return regular statement
+
336  auto lhs = get_variable_name(statement.lhs);
+
337  auto text = fmt::format("{} {} {};", lhs, statement.op, statement.rhs);
+
338  return text;
+
339 }
+
340 
+
341 
+
342 /**
+
343  * \details Current variable used in breakpoint block could be local variable.
+
344  * In this case, neuron has already renamed the variable name by prepending
+
345  * "_l". In our implementation, the variable could have been renamed by
+
346  * one of the pass. And hence, we search all local variables and check if
+
347  * the variable is renamed. Note that we have to look into the symbol table
+
348  * of statement block and not breakpoint.
+
349  */
+
350 std::string CodegenCppVisitor::breakpoint_current(std::string current) const {
+
351  auto breakpoint = info.breakpoint_node;
+
352  if (breakpoint == nullptr) {
+
353  return current;
+
354  }
+
355  auto symtab = breakpoint->get_statement_block()->get_symbol_table();
+
356  auto variables = symtab->get_variables_with_properties(NmodlType::local_var);
+
357  for (const auto& var: variables) {
+
358  auto renamed_name = var->get_name();
+
359  auto original_name = var->get_original_name();
+
360  if (current == original_name) {
+
361  current = renamed_name;
+
362  break;
+
363  }
+
364  }
+
365  return current;
366 }
367 
-
368 
-
369 /**
-
370  * \todo Issue with verbatim renaming. e.g. pattern.mod has info struct with
-
371  * index variable. If we use "index" instead of "indexes" as default argument
-
372  * then during verbatim replacement we don't know the index is which one. This
-
373  * is because verbatim renaming pass has already stripped out prefixes from
-
374  * the text.
-
375  */
- -
377  const auto& default_arguments = stringutils::split_string(nrn_thread_arguments(), ',');
-
378  for (const auto& dirty_arg: default_arguments) {
-
379  const auto& arg = stringutils::trim(dirty_arg);
-
380  RenameVisitor v(arg, "arg_" + arg);
-
381  for (const auto& function: info.functions) {
-
382  if (has_parameter_of_name(function, arg)) {
-
383  function->accept(v);
-
384  }
-
385  }
-
386  for (const auto& function: info.procedures) {
-
387  if (has_parameter_of_name(function, arg)) {
-
388  function->accept(v);
-
389  }
-
390  }
-
391  }
-
392 }
-
393 
+
368 
+
369 /****************************************************************************************/
+
370 /* Routines for returning variable name */
+
371 /****************************************************************************************/
+
372 
+
373 std::string CodegenCppVisitor::update_if_ion_variable_name(const std::string& name) const {
+
374  std::string result(name);
+
375  if (ion_variable_struct_required()) {
+
376  if (info.is_ion_read_variable(name)) {
+
377  result = naming::ION_VARNAME_PREFIX + name;
+
378  }
+
379  if (info.is_ion_write_variable(name)) {
+
380  result = "ionvar." + name;
+
381  }
+
382  if (info.is_current(name)) {
+
383  result = "ionvar." + name;
+
384  }
+
385  }
+
386  return result;
+
387 }
+
388 
+
389 
+
390 std::pair<std::string, std::string> CodegenCppVisitor::read_ion_variable_name(
+
391  const std::string& name) {
+
392  return {name, naming::ION_VARNAME_PREFIX + name};
+
393 }
394 
-
395 /****************************************************************************************/
-
396 /* Main code printing entry points */
-
397 /****************************************************************************************/
-
398 
-
399 
-
400 /**
-
401  * NMODL constants from unit database
-
402  *
-
403  */
- -
405  if (!info.factor_definitions.empty()) {
-
406  printer->add_newline(2);
-
407  printer->add_line("/** constants used in nmodl from UNITS */");
-
408  for (const auto& it: info.factor_definitions) {
-
409  const std::string format_string = "static const double {} = {};";
-
410  printer->fmt_line(format_string, it->get_node_name(), it->get_value()->get_value());
-
411  }
-
412  }
-
413 }
-
414 
-
415 
-
416 /****************************************************************************************/
-
417 /* Overloaded visitor routines */
-
418 /****************************************************************************************/
+
395 
+
396 std::pair<std::string, std::string> CodegenCppVisitor::write_ion_variable_name(
+
397  const std::string& name) {
+
398  return {naming::ION_VARNAME_PREFIX + name, name};
+
399 }
+
400 
+
401 
+
402 /****************************************************************************************/
+
403 /* Main printing routines for code generation */
+
404 /****************************************************************************************/
+
405 
+
406 
+ +
408  // Assert some things that we assume when copying instances of this struct
+
409  // to the GPU and so on.
+
410  printer->fmt_line("static_assert(std::is_trivially_copy_constructible_v<{}>);",
+
411  global_struct());
+
412  printer->fmt_line("static_assert(std::is_trivially_move_constructible_v<{}>);",
+
413  global_struct());
+
414  printer->fmt_line("static_assert(std::is_trivially_copy_assignable_v<{}>);", global_struct());
+
415  printer->fmt_line("static_assert(std::is_trivially_move_assignable_v<{}>);", global_struct());
+
416  printer->fmt_line("static_assert(std::is_trivially_destructible_v<{}>);", global_struct());
+
417 }
+
418 
419 
-
420 
-
421 extern const std::regex regex_special_chars{R"([-[\]{}()*+?.,\^$|#\s])"};
-
422 
-
423 
- -
425  std::string name = node.eval();
-
426  if (enable_variable_name_lookup) {
-
427  name = get_variable_name(name);
-
428  }
-
429  printer->add_text(name);
-
430 }
-
431 
-
432 
- -
434  const auto& value = node.get_value();
-
435  printer->add_text(std::to_string(value));
-
436 }
-
437 
-
438 
- -
440  printer->add_text(format_float_string(node.get_value()));
-
441 }
-
442 
-
443 
- -
445  printer->add_text(format_double_string(node.get_value()));
-
446 }
-
447 
-
448 
- -
450  printer->add_text(std::to_string(static_cast<int>(node.eval())));
-
451 }
-
452 
-
453 
- -
455  node.visit_children(*this);
-
456 }
-
457 
-
458 
- -
460  // do not print units
-
461 }
+ +
421  printer->add_line(global_struct(), ' ', global_struct_instance(), ';');
+
422 }
+
423 
+
424 
+ +
426  const auto& name = node.get_node_name();
+
427 
+
428  // return C++ function name for RANDOM construct function
+
429  // e.g. nrnran123_negexp for random_negexp
+
430  auto get_renamed_random_function =
+
431  [&](const std::string& name) -> std::pair<std::string, bool> {
+ +
433  return {codegen::naming::RANDOM_FUNCTIONS_MAPPING[name], true};
+
434  }
+
435  return {name, false};
+
436  };
+
437  std::string function_name;
+
438  bool is_random_function;
+
439  std::tie(function_name, is_random_function) = get_renamed_random_function(name);
+
440 
+
441  if (defined_method(name)) {
+
442  function_name = method_name(name);
+
443  }
+
444 
+
445  if (is_net_send(name)) {
+
446  print_net_send_call(node);
+
447  return;
+
448  }
+
449 
+
450  if (is_net_move(name)) {
+
451  print_net_move_call(node);
+
452  return;
+
453  }
+
454 
+
455  if (is_net_event(name)) {
+
456  print_net_event_call(node);
+
457  return;
+
458  }
+
459 
+
460  const auto& arguments = node.get_arguments();
+
461  printer->add_text(function_name, '(');
462 
-
463 
- -
465  throw std::runtime_error("PRIME encountered during code generation, ODEs not solved?");
-
466 }
-
467 
-
468 
-
469 /**
-
470  * \todo : Validate how @ is being handled in neuron implementation
-
471  */
- -
473  const auto& name = node.get_name();
-
474  const auto& at_index = node.get_at();
-
475  const auto& index = node.get_index();
-
476  name->accept(*this);
-
477  if (at_index) {
-
478  printer->add_text("@");
-
479  at_index->accept(*this);
-
480  }
-
481  if (index) {
-
482  printer->add_text("[");
-
483  printer->add_text("static_cast<int>(");
-
484  index->accept(*this);
-
485  printer->add_text(")");
-
486  printer->add_text("]");
-
487  }
-
488 }
-
489 
-
490 
- -
492  node.get_name()->accept(*this);
-
493  printer->add_text("[");
-
494  printer->add_text("static_cast<int>(");
-
495  node.get_length()->accept(*this);
-
496  printer->add_text(")");
-
497  printer->add_text("]");
-
498 }
-
499 
-
500 
- -
502  printer->add_text(local_var_type(), ' ');
-
503  print_vector_elements(node.get_variables(), ", ");
-
504 }
-
505 
-
506 
- -
508  printer->add_text("if (");
-
509  node.get_condition()->accept(*this);
-
510  printer->add_text(") ");
-
511  node.get_statement_block()->accept(*this);
-
512  print_vector_elements(node.get_elseifs(), "");
-
513  const auto& elses = node.get_elses();
-
514  if (elses) {
-
515  elses->accept(*this);
-
516  }
-
517 }
-
518 
+
463  if (defined_method(name)) {
+
464  printer->add_text(internal_method_arguments());
+
465  if (!arguments.empty()) {
+
466  printer->add_text(", ");
+
467  }
+
468  }
+
469 
+
470  // first argument to random functions need to be type casted
+
471  // from void* to nrnran123_State*.
+
472  if (is_random_function && !arguments.empty()) {
+
473  printer->add_text("(nrnran123_State*)");
+
474  }
+
475 
+
476  print_vector_elements(arguments, ", ");
+
477  printer->add_text(')');
+
478 }
+
479 
+
480 
+ +
482  printer->add_line("#ifndef NRN_PRCELLSTATE");
+
483  printer->add_line("#define NRN_PRCELLSTATE 0");
+
484  printer->add_line("#endif");
+
485 }
+
486 
+
487 
+ +
489  auto variable_printer = [&](const std::vector<SymbolType>& variables) {
+
490  for (const auto& v: variables) {
+
491  auto name = v->get_name();
+
492  if (!info.point_process) {
+
493  name += "_" + info.mod_suffix;
+
494  }
+
495  if (v->is_array()) {
+
496  name += fmt::format("[{}]", v->get_length());
+
497  }
+
498  printer->add_line(add_escape_quote(name), ",");
+
499  }
+
500  };
+
501 
+
502  printer->add_newline(2);
+
503  printer->add_line("/** channel information */");
+
504  printer->fmt_line("static const char *{}[] = {{", get_channel_info_var_name());
+
505  printer->increase_indent();
+
506  printer->add_line(add_escape_quote(nmodl_version()), ",");
+
507  printer->add_line(add_escape_quote(info.mod_suffix), ",");
+
508  variable_printer(info.range_parameter_vars);
+
509  printer->add_line("0,");
+
510  variable_printer(info.range_assigned_vars);
+
511  printer->add_line("0,");
+
512  variable_printer(info.range_state_vars);
+
513  printer->add_line("0,");
+
514  variable_printer(info.pointer_variables);
+
515  printer->add_line("0");
+
516  printer->decrease_indent();
+
517  printer->add_line("};");
+
518 }
519 
- -
521  printer->add_text(" else if (");
-
522  node.get_condition()->accept(*this);
-
523  printer->add_text(") ");
-
524  node.get_statement_block()->accept(*this);
-
525 }
-
526 
-
527 
- -
529  printer->add_text(" else ");
-
530  node.visit_children(*this);
-
531 }
+
520 
+
521 /****************************************************************************************/
+
522 /* Printing routines for code generation */
+
523 /****************************************************************************************/
+
524 
+
525 
+ +
527  bool open_brace,
+
528  bool close_brace) {
+
529  if (open_brace) {
+
530  printer->push_block();
+
531  }
532 
-
533 
- -
535  printer->add_text("while (");
-
536  node.get_condition()->accept(*this);
-
537  printer->add_text(") ");
-
538  node.get_statement_block()->accept(*this);
-
539 }
-
540 
-
541 
- -
543  auto name = node.get_node_name();
-
544  const auto& from = node.get_from();
-
545  const auto& to = node.get_to();
-
546  const auto& inc = node.get_increment();
-
547  const auto& block = node.get_statement_block();
-
548  printer->fmt_text("for (int {} = ", name);
-
549  from->accept(*this);
-
550  printer->fmt_text("; {} <= ", name);
-
551  to->accept(*this);
-
552  if (inc) {
-
553  printer->fmt_text("; {} += ", name);
-
554  inc->accept(*this);
-
555  } else {
-
556  printer->fmt_text("; {}++", name);
-
557  }
-
558  printer->add_text(") ");
-
559  block->accept(*this);
-
560 }
-
561 
-
562 
- -
564  printer->add_text("(");
-
565  node.get_expression()->accept(*this);
-
566  printer->add_text(")");
-
567 }
-
568 
-
569 
- -
571  auto op = node.get_op().eval();
-
572  const auto& lhs = node.get_lhs();
-
573  const auto& rhs = node.get_rhs();
-
574  if (op == "^") {
-
575  printer->add_text("pow(");
-
576  lhs->accept(*this);
-
577  printer->add_text(", ");
-
578  rhs->accept(*this);
-
579  printer->add_text(")");
-
580  } else {
-
581  lhs->accept(*this);
-
582  printer->add_text(" " + op + " ");
-
583  rhs->accept(*this);
-
584  }
-
585 }
-
586 
+
533  const auto& statements = node.get_statements();
+
534  for (const auto& statement: statements) {
+
535  if (statement_to_skip(*statement)) {
+
536  continue;
+
537  }
+
538  /// not necessary to add indent for verbatim block (pretty-printing)
+
539  if (!statement->is_verbatim() && !statement->is_mutex_lock() &&
+
540  !statement->is_mutex_unlock() && !statement->is_protect_statement()) {
+
541  printer->add_indent();
+
542  }
+
543  statement->accept(*this);
+
544  if (need_semicolon(*statement)) {
+
545  printer->add_text(';');
+
546  }
+
547  if (!statement->is_mutex_lock() && !statement->is_mutex_unlock()) {
+
548  printer->add_newline();
+
549  }
+
550  }
+
551 
+
552  if (close_brace) {
+
553  printer->pop_block_nl(0);
+
554  }
+
555 }
+
556 
+
557 
+
558 /**
+
559  * \todo Issue with verbatim renaming. e.g. pattern.mod has info struct with
+
560  * index variable. If we use "index" instead of "indexes" as default argument
+
561  * then during verbatim replacement we don't know the index is which one. This
+
562  * is because verbatim renaming pass has already stripped out prefixes from
+
563  * the text.
+
564  */
+ +
566  const auto& default_arguments = stringutils::split_string(nrn_thread_arguments(), ',');
+
567  for (const auto& dirty_arg: default_arguments) {
+
568  const auto& arg = stringutils::trim(dirty_arg);
+
569  RenameVisitor v(arg, "arg_" + arg);
+
570  for (const auto& function: info.functions) {
+
571  if (has_parameter_of_name(function, arg)) {
+
572  function->accept(v);
+
573  }
+
574  }
+
575  for (const auto& function: info.procedures) {
+
576  if (has_parameter_of_name(function, arg)) {
+
577  function->accept(v);
+
578  }
+
579  }
+
580  }
+
581 }
+
582 
+
583 
+
584 /****************************************************************************************/
+
585 /* Main code printing entry points */
+
586 /****************************************************************************************/
587 
- -
589  printer->add_text(node.eval());
-
590 }
-
591 
-
592 
- -
594  printer->add_text(" " + node.eval());
-
595 }
-
596 
-
597 
-
598 /**
-
599  * \details Statement block is top level construct (for every nmodl block).
-
600  * Sometime we want to analyse ast nodes even if code generation is
-
601  * false. Hence we visit children even if code generation is false.
-
602  */
- -
604  print_statement_block(node);
-
605 }
-
606 
-
607 
- -
609  print_function_call(node);
-
610 }
-
611 
-
612 
- -
614  const auto& text = node.get_statement()->eval();
-
615  const auto& result = process_verbatim_text(text);
-
616 
-
617  const auto& statements = stringutils::split_string(result, '\n');
-
618  for (const auto& statement: statements) {
-
619  const auto& trimed_stmt = stringutils::trim_newline(statement);
-
620  if (trimed_stmt.find_first_not_of(' ') != std::string::npos) {
-
621  printer->add_line(trimed_stmt);
-
622  }
-
623  }
-
624 }
-
625 
+
588 
+
589 /**
+
590  * NMODL constants from unit database
+
591  *
+
592  */
+ +
594  if (!info.factor_definitions.empty()) {
+
595  printer->add_newline(2);
+
596  printer->add_line("/** constants used in nmodl from UNITS */");
+
597  for (const auto& it: info.factor_definitions) {
+
598  const std::string format_string = "static const double {} = {};";
+
599  printer->fmt_line(format_string, it->get_node_name(), it->get_value()->get_value());
+
600  }
+
601  }
+
602 }
+
603 
+
604 
+
605 /****************************************************************************************/
+
606 /* Overloaded visitor routines */
+
607 /****************************************************************************************/
+
608 
+
609 
+
610 extern const std::regex regex_special_chars{R"([-[\]{}()*+?.,\^$|#\s])"};
+
611 
+
612 
+ +
614  std::string name = node.eval();
+
615  if (enable_variable_name_lookup) {
+
616  name = get_variable_name(name);
+
617  }
+
618  printer->add_text(name);
+
619 }
+
620 
+
621 
+ +
623  const auto& value = node.get_value();
+
624  printer->add_text(std::to_string(value));
+
625 }
626 
- -
628  // dt change statement should be pulled outside already
-
629 }
-
630 
+
627 
+ +
629  printer->add_text(format_float_string(node.get_value()));
+
630 }
631 
- -
633  print_atomic_reduction_pragma();
-
634  printer->add_indent();
-
635  node.get_expression()->accept(*this);
-
636  printer->add_text(";");
-
637 }
-
638 
-
639 
- -
641  printer->fmt_line("#pragma omp critical ({})", info.mod_suffix);
-
642  printer->add_indent();
-
643  printer->push_block();
-
644 }
-
645 
+
632 
+ +
634  printer->add_text(format_double_string(node.get_value()));
+
635 }
+
636 
+
637 
+ +
639  printer->add_text(std::to_string(static_cast<int>(node.eval())));
+
640 }
+
641 
+
642 
+ +
644  node.visit_children(*this);
+
645 }
646 
- -
648  printer->pop_block();
-
649 }
-
650 
+
647 
+ +
649  // do not print units
+
650 }
651 
- -
653  auto block = node.get_node_to_solve().get();
-
654  if (block->is_statement_block()) {
-
655  auto statement_block = dynamic_cast<ast::StatementBlock*>(block);
-
656  print_statement_block(*statement_block, false, false);
-
657  } else {
-
658  block->accept(*this);
-
659  }
-
660 }
-
661 
-
662 
-
663 /**
-
664  * \details Once variables are populated, update index semantics to register with coreneuron
-
665  */
-
666 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
- -
668  int index = 0;
-
669  info.semantics.clear();
-
670 
-
671  if (info.point_process) {
-
672  info.semantics.emplace_back(index++, naming::AREA_SEMANTIC, 1);
-
673  info.semantics.emplace_back(index++, naming::POINT_PROCESS_SEMANTIC, 1);
-
674  }
-
675  for (const auto& ion: info.ions) {
-
676  for (auto i = 0; i < ion.reads.size(); ++i) {
-
677  info.semantics.emplace_back(index++, ion.name + "_ion", 1);
-
678  }
-
679  for (const auto& var: ion.writes) {
-
680  /// add if variable is not present in the read list
-
681  if (std::find(ion.reads.begin(), ion.reads.end(), var) == ion.reads.end()) {
-
682  info.semantics.emplace_back(index++, ion.name + "_ion", 1);
-
683  }
-
684  if (ion.is_ionic_current(var)) {
-
685  info.semantics.emplace_back(index++, ion.name + "_ion", 1);
-
686  }
-
687  }
-
688  if (ion.need_style) {
-
689  info.semantics.emplace_back(index++, fmt::format("{}_ion", ion.name), 1);
-
690  info.semantics.emplace_back(index++, fmt::format("#{}_ion", ion.name), 1);
-
691  }
-
692  }
-
693  for (auto& var: info.pointer_variables) {
-
694  if (info.first_pointer_var_index == -1) {
-
695  info.first_pointer_var_index = index;
-
696  }
-
697  int size = var->get_length();
-
698  if (var->has_any_property(NmodlType::pointer_var)) {
-
699  info.semantics.emplace_back(index, naming::POINTER_SEMANTIC, size);
-
700  } else {
-
701  info.semantics.emplace_back(index, naming::CORE_POINTER_SEMANTIC, size);
-
702  }
-
703  index += size;
-
704  }
-
705 
-
706  for (auto& var: info.random_variables) {
-
707  if (info.first_random_var_index == -1) {
-
708  info.first_random_var_index = index;
-
709  }
-
710  int size = var->get_length();
-
711  info.semantics.emplace_back(index, naming::RANDOM_SEMANTIC, size);
-
712  index += size;
-
713  }
-
714 
-
715  if (info.diam_used) {
-
716  info.semantics.emplace_back(index++, naming::DIAM_VARIABLE, 1);
-
717  }
-
718 
-
719  if (info.area_used) {
-
720  info.semantics.emplace_back(index++, naming::AREA_VARIABLE, 1);
-
721  }
+
652 
+ +
654  throw std::runtime_error("PRIME encountered during code generation, ODEs not solved?");
+
655 }
+
656 
+
657 
+
658 /**
+
659  * \todo : Validate how @ is being handled in neuron implementation
+
660  */
+ +
662  const auto& name = node.get_name();
+
663  const auto& at_index = node.get_at();
+
664  const auto& index = node.get_index();
+
665  name->accept(*this);
+
666  if (at_index) {
+
667  printer->add_text("@");
+
668  at_index->accept(*this);
+
669  }
+
670  if (index) {
+
671  printer->add_text("[");
+
672  printer->add_text("static_cast<int>(");
+
673  index->accept(*this);
+
674  printer->add_text(")");
+
675  printer->add_text("]");
+
676  }
+
677 }
+
678 
+
679 
+ +
681  node.get_name()->accept(*this);
+
682  printer->add_text("[");
+
683  printer->add_text("static_cast<int>(");
+
684  node.get_length()->accept(*this);
+
685  printer->add_text(")");
+
686  printer->add_text("]");
+
687 }
+
688 
+
689 
+ +
691  printer->add_text(local_var_type(), ' ');
+
692  print_vector_elements(node.get_variables(), ", ");
+
693 }
+
694 
+
695 
+ +
697  printer->add_text("if (");
+
698  node.get_condition()->accept(*this);
+
699  printer->add_text(") ");
+
700  node.get_statement_block()->accept(*this);
+
701  print_vector_elements(node.get_elseifs(), "");
+
702  const auto& elses = node.get_elses();
+
703  if (elses) {
+
704  elses->accept(*this);
+
705  }
+
706 }
+
707 
+
708 
+ +
710  printer->add_text(" else if (");
+
711  node.get_condition()->accept(*this);
+
712  printer->add_text(") ");
+
713  node.get_statement_block()->accept(*this);
+
714 }
+
715 
+
716 
+ +
718  printer->add_text(" else ");
+
719  node.visit_children(*this);
+
720 }
+
721 
722 
-
723  if (info.net_send_used) {
-
724  info.semantics.emplace_back(index++, naming::NET_SEND_SEMANTIC, 1);
-
725  }
-
726 
-
727  /*
-
728  * Number of semantics for watch is one greater than number of
-
729  * actual watch statements in the mod file
-
730  */
-
731  if (!info.watch_statements.empty()) {
-
732  for (int i = 0; i < info.watch_statements.size() + 1; i++) {
-
733  info.semantics.emplace_back(index++, naming::WATCH_SEMANTIC, 1);
-
734  }
-
735  }
-
736 
-
737  if (info.for_netcon_used) {
-
738  info.semantics.emplace_back(index++, naming::FOR_NETCON_SEMANTIC, 1);
-
739  }
-
740 }
-
741 
-
742 
-
743 std::vector<CodegenCppVisitor::SymbolType> CodegenCppVisitor::get_float_variables() const {
-
744  // sort with definition order
-
745  auto comparator = [](const SymbolType& first, const SymbolType& second) -> bool {
-
746  return first->get_definition_order() < second->get_definition_order();
-
747  };
-
748 
-
749  auto assigned = info.assigned_vars;
-
750  auto states = info.state_vars;
+ +
724  printer->add_text("while (");
+
725  node.get_condition()->accept(*this);
+
726  printer->add_text(") ");
+
727  node.get_statement_block()->accept(*this);
+
728 }
+
729 
+
730 
+ +
732  auto name = node.get_node_name();
+
733  const auto& from = node.get_from();
+
734  const auto& to = node.get_to();
+
735  const auto& inc = node.get_increment();
+
736  const auto& block = node.get_statement_block();
+
737  printer->fmt_text("for (int {} = ", name);
+
738  from->accept(*this);
+
739  printer->fmt_text("; {} <= ", name);
+
740  to->accept(*this);
+
741  if (inc) {
+
742  printer->fmt_text("; {} += ", name);
+
743  inc->accept(*this);
+
744  } else {
+
745  printer->fmt_text("; {}++", name);
+
746  }
+
747  printer->add_text(") ");
+
748  block->accept(*this);
+
749 }
+
750 
751 
-
752  // each state variable has corresponding Dstate variable
-
753  for (const auto& state: states) {
-
754  auto name = "D" + state->get_name();
-
755  auto symbol = make_symbol(name);
-
756  if (state->is_array()) {
-
757  symbol->set_as_array(state->get_length());
-
758  }
-
759  symbol->set_definition_order(state->get_definition_order());
-
760  assigned.push_back(symbol);
-
761  }
-
762  std::sort(assigned.begin(), assigned.end(), comparator);
-
763 
-
764  auto variables = info.range_parameter_vars;
-
765  variables.insert(variables.end(),
-
766  info.range_assigned_vars.begin(),
-
767  info.range_assigned_vars.end());
-
768  variables.insert(variables.end(), info.range_state_vars.begin(), info.range_state_vars.end());
-
769  variables.insert(variables.end(), assigned.begin(), assigned.end());
-
770 
-
771  if (info.vectorize) {
-
772  variables.push_back(make_symbol(naming::VOLTAGE_UNUSED_VARIABLE));
+ +
753  printer->add_text("(");
+
754  node.get_expression()->accept(*this);
+
755  printer->add_text(")");
+
756 }
+
757 
+
758 
+ +
760  auto op = node.get_op().eval();
+
761  const auto& lhs = node.get_lhs();
+
762  const auto& rhs = node.get_rhs();
+
763  if (op == "^") {
+
764  printer->add_text("pow(");
+
765  lhs->accept(*this);
+
766  printer->add_text(", ");
+
767  rhs->accept(*this);
+
768  printer->add_text(")");
+
769  } else {
+
770  lhs->accept(*this);
+
771  printer->add_text(" " + op + " ");
+
772  rhs->accept(*this);
773  }
-
774 
-
775  if (breakpoint_exist()) {
-
776  std::string name = info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
- -
778 
-
779  // make sure conductance variable like `g` is not already defined
-
780  if (auto r = std::find_if(variables.cbegin(),
-
781  variables.cend(),
-
782  [&](const auto& s) { return name == s->get_name(); });
-
783  r == variables.cend()) {
-
784  variables.push_back(make_symbol(name));
-
785  }
-
786  }
-
787 
-
788  if (net_receive_exist()) {
-
789  variables.push_back(make_symbol(naming::T_SAVE_VARIABLE));
-
790  }
-
791  return variables;
-
792 }
-
793 
-
794 
-
795 /**
-
796  * IndexVariableInfo has following constructor arguments:
-
797  * - symbol
-
798  * - is_vdata (false)
-
799  * - is_index (false
-
800  * - is_integer (false)
-
801  *
-
802  * Which variables are constant qualified?
-
803  *
-
804  * - node area is read only
-
805  * - read ion variables are read only
-
806  * - style_ionname is index / offset
-
807  */
-
808 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
-
809 std::vector<IndexVariableInfo> CodegenCppVisitor::get_int_variables() {
-
810  std::vector<IndexVariableInfo> variables;
-
811  if (info.point_process) {
-
812  variables.emplace_back(make_symbol(naming::NODE_AREA_VARIABLE));
-
813  variables.back().is_constant = true;
-
814  /// note that this variable is not printed in neuron implementation
-
815  if (info.artificial_cell) {
-
816  variables.emplace_back(make_symbol(naming::POINT_PROCESS_VARIABLE), true);
-
817  } else {
-
818  variables.emplace_back(make_symbol(naming::POINT_PROCESS_VARIABLE), false, false, true);
-
819  variables.back().is_constant = true;
-
820  }
-
821  }
-
822 
-
823  for (auto& ion: info.ions) {
-
824  bool need_style = false;
-
825  std::unordered_map<std::string, int> ion_vars; // used to keep track of the variables to
-
826  // not have doubles between read/write. Same
-
827  // name variables are allowed
-
828  // See if we need to add extra readion statements to match NEURON with SoA data
-
829  auto const has_var = [&ion](const char* suffix) -> bool {
-
830  auto const pred = [name = ion.name + suffix](auto const& x) { return x == name; };
-
831  return std::any_of(ion.reads.begin(), ion.reads.end(), pred) ||
-
832  std::any_of(ion.writes.begin(), ion.writes.end(), pred);
-
833  };
-
834  auto const add_implicit_read = [&ion](const char* suffix) {
-
835  auto name = ion.name + suffix;
-
836  ion.reads.push_back(name);
-
837  ion.implicit_reads.push_back(std::move(name));
-
838  };
-
839  bool const have_ionin{has_var("i")}, have_ionout{has_var("o")};
-
840  if (have_ionin && !have_ionout) {
-
841  add_implicit_read("o");
-
842  } else if (have_ionout && !have_ionin) {
-
843  add_implicit_read("i");
-
844  }
-
845  for (const auto& var: ion.reads) {
-
846  const std::string name = naming::ION_VARNAME_PREFIX + var;
-
847  variables.emplace_back(make_symbol(name));
-
848  variables.back().is_constant = true;
-
849  ion_vars[name] = static_cast<int>(variables.size() - 1);
-
850  }
+
774 }
+
775 
+
776 
+ +
778  printer->add_text(node.eval());
+
779 }
+
780 
+
781 
+ +
783  printer->add_text(" " + node.eval());
+
784 }
+
785 
+
786 
+
787 /**
+
788  * \details Statement block is top level construct (for every nmodl block).
+
789  * Sometime we want to analyse ast nodes even if code generation is
+
790  * false. Hence we visit children even if code generation is false.
+
791  */
+ +
793  print_statement_block(node);
+
794 }
+
795 
+
796 
+ +
798  print_function_call(node);
+
799 }
+
800 
+
801 
+ +
803  const auto& text = node.get_statement()->eval();
+
804  const auto& result = process_verbatim_text(text);
+
805 
+
806  const auto& statements = stringutils::split_string(result, '\n');
+
807  for (const auto& statement: statements) {
+
808  const auto& trimed_stmt = stringutils::trim_newline(statement);
+
809  if (trimed_stmt.find_first_not_of(' ') != std::string::npos) {
+
810  printer->add_line(trimed_stmt);
+
811  }
+
812  }
+
813 }
+
814 
+
815 
+ +
817  // dt change statement should be pulled outside already
+
818 }
+
819 
+
820 
+ +
822  print_atomic_reduction_pragma();
+
823  printer->add_indent();
+
824  node.get_expression()->accept(*this);
+
825  printer->add_text(";");
+
826 }
+
827 
+
828 
+ +
830  printer->fmt_line("#pragma omp critical ({})", info.mod_suffix);
+
831  printer->add_indent();
+
832  printer->push_block();
+
833 }
+
834 
+
835 
+ +
837  printer->pop_block();
+
838 }
+
839 
+
840 
+ +
842  auto block = node.get_node_to_solve().get();
+
843  if (block->is_statement_block()) {
+
844  auto statement_block = dynamic_cast<ast::StatementBlock*>(block);
+
845  print_statement_block(*statement_block, false, false);
+
846  } else {
+
847  block->accept(*this);
+
848  }
+
849 }
+
850 
851 
-
852  /// symbol for di_ion_dv var
-
853  std::shared_ptr<symtab::Symbol> ion_di_dv_var = nullptr;
-
854 
-
855  for (const auto& var: ion.writes) {
-
856  const std::string name = naming::ION_VARNAME_PREFIX + var;
-
857 
-
858  const auto ion_vars_it = ion_vars.find(name);
-
859  if (ion_vars_it != ion_vars.end()) {
-
860  variables[ion_vars_it->second].is_constant = false;
-
861  } else {
-
862  variables.emplace_back(make_symbol(naming::ION_VARNAME_PREFIX + var));
-
863  }
-
864  if (ion.is_ionic_current(var)) {
-
865  ion_di_dv_var = make_symbol(std::string(naming::ION_VARNAME_PREFIX) + "di" +
-
866  ion.name + "dv");
-
867  }
-
868  if (ion.is_intra_cell_conc(var) || ion.is_extra_cell_conc(var)) {
-
869  need_style = true;
-
870  }
-
871  }
-
872 
-
873  /// insert after read/write variables but before style ion variable
-
874  if (ion_di_dv_var != nullptr) {
-
875  variables.emplace_back(ion_di_dv_var);
+
852 /**
+
853  * \details Once variables are populated, update index semantics to register with coreneuron
+
854  */
+
855 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
+ +
857  int index = 0;
+
858  info.semantics.clear();
+
859 
+
860  if (info.point_process) {
+
861  info.semantics.emplace_back(index++, naming::AREA_SEMANTIC, 1);
+
862  info.semantics.emplace_back(index++, naming::POINT_PROCESS_SEMANTIC, 1);
+
863  }
+
864  for (const auto& ion: info.ions) {
+
865  for (auto i = 0; i < ion.reads.size(); ++i) {
+
866  info.semantics.emplace_back(index++, ion.name + "_ion", 1);
+
867  }
+
868  for (const auto& var: ion.writes) {
+
869  /// add if variable is not present in the read list
+
870  if (std::find(ion.reads.begin(), ion.reads.end(), var) == ion.reads.end()) {
+
871  info.semantics.emplace_back(index++, ion.name + "_ion", 1);
+
872  }
+
873  if (ion.is_ionic_current(var)) {
+
874  info.semantics.emplace_back(index++, ion.name + "_ion", 1);
+
875  }
876  }
-
877 
-
878  if (need_style) {
-
879  variables.emplace_back(make_symbol(naming::ION_VARNAME_PREFIX + ion.name + "_erev"));
-
880  variables.emplace_back(make_symbol("style_" + ion.name), false, true);
-
881  variables.back().is_constant = true;
-
882  }
-
883  }
-
884 
-
885  for (const auto& var: info.pointer_variables) {
-
886  auto name = var->get_name();
+
877  if (ion.need_style) {
+
878  info.semantics.emplace_back(index++, fmt::format("{}_ion", ion.name), 1);
+
879  info.semantics.emplace_back(index++, fmt::format("#{}_ion", ion.name), 1);
+
880  }
+
881  }
+
882  for (auto& var: info.pointer_variables) {
+
883  if (info.first_pointer_var_index == -1) {
+
884  info.first_pointer_var_index = index;
+
885  }
+
886  int size = var->get_length();
887  if (var->has_any_property(NmodlType::pointer_var)) {
-
888  variables.emplace_back(make_symbol(name));
+
888  info.semantics.emplace_back(index, naming::POINTER_SEMANTIC, size);
889  } else {
-
890  variables.emplace_back(make_symbol(name), true);
+
890  info.semantics.emplace_back(index, naming::CORE_POINTER_SEMANTIC, size);
891  }
-
892  }
-
893 
-
894  for (const auto& var: info.random_variables) {
-
895  auto name = var->get_name();
-
896  variables.emplace_back(make_symbol(name), true);
-
897  variables.back().symbol->add_properties(NmodlType::random_var);
-
898  }
-
899 
-
900  if (info.diam_used) {
-
901  variables.emplace_back(make_symbol(naming::DIAM_VARIABLE));
+
892  index += size;
+
893  }
+
894 
+
895  for (auto& var: info.random_variables) {
+
896  if (info.first_random_var_index == -1) {
+
897  info.first_random_var_index = index;
+
898  }
+
899  int size = var->get_length();
+
900  info.semantics.emplace_back(index, naming::RANDOM_SEMANTIC, size);
+
901  index += size;
902  }
903 
-
904  if (info.area_used) {
-
905  variables.emplace_back(make_symbol(naming::AREA_VARIABLE));
+
904  if (info.diam_used) {
+
905  info.semantics.emplace_back(index++, naming::DIAM_VARIABLE, 1);
906  }
907 
-
908  // for non-artificial cell, when net_receive buffering is enabled
-
909  // then tqitem is an offset
-
910  if (info.net_send_used) {
-
911  if (info.artificial_cell) {
-
912  variables.emplace_back(make_symbol(naming::TQITEM_VARIABLE), true);
-
913  } else {
-
914  variables.emplace_back(make_symbol(naming::TQITEM_VARIABLE), false, false, true);
-
915  variables.back().is_constant = true;
-
916  }
-
917  info.tqitem_index = static_cast<int>(variables.size() - 1);
-
918  }
-
919 
-
920  /**
-
921  * \note Variables for watch statements : there is one extra variable
-
922  * used in coreneuron compared to actual watch statements for compatibility
-
923  * with neuron (which uses one extra Datum variable)
-
924  */
-
925  if (!info.watch_statements.empty()) {
-
926  for (int i = 0; i < info.watch_statements.size() + 1; i++) {
-
927  variables.emplace_back(make_symbol(fmt::format("watch{}", i)), false, false, true);
-
928  }
-
929  }
-
930  return variables;
-
931 }
-
932 
-
933 
- -
935  program_symtab = node.get_symbol_table();
-
936 
- -
938  info = v.analyze(node);
-
939  info.mod_file = mod_filename;
+
908  if (info.area_used) {
+
909  info.semantics.emplace_back(index++, naming::AREA_VARIABLE, 1);
+
910  }
+
911 
+
912  if (info.net_send_used) {
+
913  info.semantics.emplace_back(index++, naming::NET_SEND_SEMANTIC, 1);
+
914  }
+
915 
+
916  /*
+
917  * Number of semantics for watch is one greater than number of
+
918  * actual watch statements in the mod file
+
919  */
+
920  if (!info.watch_statements.empty()) {
+
921  for (int i = 0; i < info.watch_statements.size() + 1; i++) {
+
922  info.semantics.emplace_back(index++, naming::WATCH_SEMANTIC, 1);
+
923  }
+
924  }
+
925 
+
926  if (info.for_netcon_used) {
+
927  info.semantics.emplace_back(index++, naming::FOR_NETCON_SEMANTIC, 1);
+
928  }
+
929 }
+
930 
+
931 
+
932 std::vector<CodegenCppVisitor::SymbolType> CodegenCppVisitor::get_float_variables() const {
+
933  // sort with definition order
+
934  auto comparator = [](const SymbolType& first, const SymbolType& second) -> bool {
+
935  return first->get_definition_order() < second->get_definition_order();
+
936  };
+
937 
+
938  auto assigned = info.assigned_vars;
+
939  auto states = info.state_vars;
940 
-
941  if (!info.vectorize) {
-
942  logger->warn(
-
943  "CodegenCoreneuronCppVisitor : MOD file uses non-thread safe constructs of NMODL");
-
944  }
-
945 
-
946  codegen_float_variables = get_float_variables();
-
947  codegen_int_variables = get_int_variables();
-
948 
-
949  update_index_semantics();
-
950  rename_function_arguments();
-
951 }
+
941  // each state variable has corresponding Dstate variable
+
942  for (const auto& state: states) {
+
943  auto name = "D" + state->get_name();
+
944  auto symbol = make_symbol(name);
+
945  if (state->is_array()) {
+
946  symbol->set_as_array(state->get_length());
+
947  }
+
948  symbol->set_definition_order(state->get_definition_order());
+
949  assigned.push_back(symbol);
+
950  }
+
951  std::sort(assigned.begin(), assigned.end(), comparator);
952 
- -
954  if (type == BlockType::Initial) {
-
955  return method_name(naming::NRN_INIT_METHOD);
-
956  }
-
957  if (type == BlockType::Constructor) {
-
958  return method_name(naming::NRN_CONSTRUCTOR_METHOD);
-
959  }
-
960  if (type == BlockType::Destructor) {
-
961  return method_name(naming::NRN_DESTRUCTOR_METHOD);
+
953  auto variables = info.range_parameter_vars;
+
954  variables.insert(variables.end(),
+
955  info.range_assigned_vars.begin(),
+
956  info.range_assigned_vars.end());
+
957  variables.insert(variables.end(), info.range_state_vars.begin(), info.range_state_vars.end());
+
958  variables.insert(variables.end(), assigned.begin(), assigned.end());
+
959 
+
960  if (info.vectorize) {
+
961  variables.push_back(make_symbol(naming::VOLTAGE_UNUSED_VARIABLE));
962  }
-
963  if (type == BlockType::State) {
-
964  return method_name(naming::NRN_STATE_METHOD);
-
965  }
-
966  if (type == BlockType::Equation) {
-
967  return method_name(naming::NRN_CUR_METHOD);
-
968  }
-
969  if (type == BlockType::Watch) {
-
970  return method_name(naming::NRN_WATCH_CHECK_METHOD);
-
971  }
-
972  throw std::logic_error("compute_method_name not implemented");
-
973 }
-
974 
-
975 
- -
977  setup(node);
-
978  print_codegen_routines();
-
979 }
-
980 
-
981 } // namespace codegen
-
982 } // namespace nmodl
+
963 
+
964  if (breakpoint_exist()) {
+
965  std::string name = info.vectorize ? naming::CONDUCTANCE_UNUSED_VARIABLE
+ +
967 
+
968  // make sure conductance variable like `g` is not already defined
+
969  if (auto r = std::find_if(variables.cbegin(),
+
970  variables.cend(),
+
971  [&](const auto& s) { return name == s->get_name(); });
+
972  r == variables.cend()) {
+
973  variables.push_back(make_symbol(name));
+
974  }
+
975  }
+
976 
+
977  if (net_receive_exist()) {
+
978  variables.push_back(make_symbol(naming::T_SAVE_VARIABLE));
+
979  }
+
980  return variables;
+
981 }
+
982 
+
983 
+
984 /**
+
985  * IndexVariableInfo has following constructor arguments:
+
986  * - symbol
+
987  * - is_vdata (false)
+
988  * - is_index (false
+
989  * - is_integer (false)
+
990  *
+
991  * Which variables are constant qualified?
+
992  *
+
993  * - node area is read only
+
994  * - read ion variables are read only
+
995  * - style_ionname is index / offset
+
996  */
+
997 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
+
998 std::vector<IndexVariableInfo> CodegenCppVisitor::get_int_variables() {
+
999  std::vector<IndexVariableInfo> variables;
+
1000  if (info.point_process) {
+
1001  variables.emplace_back(make_symbol(naming::NODE_AREA_VARIABLE));
+
1002  variables.back().is_constant = true;
+
1003  /// note that this variable is not printed in neuron implementation
+
1004  if (info.artificial_cell) {
+
1005  variables.emplace_back(make_symbol(naming::POINT_PROCESS_VARIABLE), true);
+
1006  } else {
+
1007  variables.emplace_back(make_symbol(naming::POINT_PROCESS_VARIABLE), false, false, true);
+
1008  variables.back().is_constant = true;
+
1009  }
+
1010  }
+
1011 
+
1012  for (auto& ion: info.ions) {
+
1013  bool need_style = false;
+
1014  std::unordered_map<std::string, int> ion_vars; // used to keep track of the variables to
+
1015  // not have doubles between read/write. Same
+
1016  // name variables are allowed
+
1017  // See if we need to add extra readion statements to match NEURON with SoA data
+
1018  auto const has_var = [&ion](const char* suffix) -> bool {
+
1019  auto const pred = [name = ion.name + suffix](auto const& x) { return x == name; };
+
1020  return std::any_of(ion.reads.begin(), ion.reads.end(), pred) ||
+
1021  std::any_of(ion.writes.begin(), ion.writes.end(), pred);
+
1022  };
+
1023  auto const add_implicit_read = [&ion](const char* suffix) {
+
1024  auto name = ion.name + suffix;
+
1025  ion.reads.push_back(name);
+
1026  ion.implicit_reads.push_back(std::move(name));
+
1027  };
+
1028  bool const have_ionin{has_var("i")}, have_ionout{has_var("o")};
+
1029  if (have_ionin && !have_ionout) {
+
1030  add_implicit_read("o");
+
1031  } else if (have_ionout && !have_ionin) {
+
1032  add_implicit_read("i");
+
1033  }
+
1034  for (const auto& var: ion.reads) {
+
1035  const std::string name = naming::ION_VARNAME_PREFIX + var;
+
1036  variables.emplace_back(make_symbol(name));
+
1037  variables.back().is_constant = true;
+
1038  ion_vars[name] = static_cast<int>(variables.size() - 1);
+
1039  }
+
1040 
+
1041  /// symbol for di_ion_dv var
+
1042  std::shared_ptr<symtab::Symbol> ion_di_dv_var = nullptr;
+
1043 
+
1044  for (const auto& var: ion.writes) {
+
1045  const std::string name = naming::ION_VARNAME_PREFIX + var;
+
1046 
+
1047  const auto ion_vars_it = ion_vars.find(name);
+
1048  if (ion_vars_it != ion_vars.end()) {
+
1049  variables[ion_vars_it->second].is_constant = false;
+
1050  } else {
+
1051  variables.emplace_back(make_symbol(naming::ION_VARNAME_PREFIX + var));
+
1052  }
+
1053  if (ion.is_ionic_current(var)) {
+
1054  ion_di_dv_var = make_symbol(std::string(naming::ION_VARNAME_PREFIX) + "di" +
+
1055  ion.name + "dv");
+
1056  }
+
1057  if (ion.is_intra_cell_conc(var) || ion.is_extra_cell_conc(var)) {
+
1058  need_style = true;
+
1059  }
+
1060  }
+
1061 
+
1062  /// insert after read/write variables but before style ion variable
+
1063  if (ion_di_dv_var != nullptr) {
+
1064  variables.emplace_back(ion_di_dv_var);
+
1065  }
+
1066 
+
1067  if (need_style) {
+
1068  variables.emplace_back(make_symbol(naming::ION_VARNAME_PREFIX + ion.name + "_erev"));
+
1069  variables.emplace_back(make_symbol("style_" + ion.name), false, true);
+
1070  variables.back().is_constant = true;
+
1071  }
+
1072  }
+
1073 
+
1074  for (const auto& var: info.pointer_variables) {
+
1075  auto name = var->get_name();
+
1076  if (var->has_any_property(NmodlType::pointer_var)) {
+
1077  variables.emplace_back(make_symbol(name));
+
1078  } else {
+
1079  variables.emplace_back(make_symbol(name), true);
+
1080  }
+
1081  }
+
1082 
+
1083  for (const auto& var: info.random_variables) {
+
1084  auto name = var->get_name();
+
1085  variables.emplace_back(make_symbol(name), true);
+
1086  variables.back().symbol->add_properties(NmodlType::random_var);
+
1087  }
+
1088 
+
1089  if (info.diam_used) {
+
1090  variables.emplace_back(make_symbol(naming::DIAM_VARIABLE));
+
1091  }
+
1092 
+
1093  if (info.area_used) {
+
1094  variables.emplace_back(make_symbol(naming::AREA_VARIABLE));
+
1095  }
+
1096 
+
1097  // for non-artificial cell, when net_receive buffering is enabled
+
1098  // then tqitem is an offset
+
1099  if (info.net_send_used) {
+
1100  if (info.artificial_cell) {
+
1101  variables.emplace_back(make_symbol(naming::TQITEM_VARIABLE), true);
+
1102  } else {
+
1103  variables.emplace_back(make_symbol(naming::TQITEM_VARIABLE), false, false, true);
+
1104  variables.back().is_constant = true;
+
1105  }
+
1106  info.tqitem_index = static_cast<int>(variables.size() - 1);
+
1107  }
+
1108 
+
1109  /**
+
1110  * \note Variables for watch statements : there is one extra variable
+
1111  * used in coreneuron compared to actual watch statements for compatibility
+
1112  * with neuron (which uses one extra Datum variable)
+
1113  */
+
1114  if (!info.watch_statements.empty()) {
+
1115  for (int i = 0; i < info.watch_statements.size() + 1; i++) {
+
1116  variables.emplace_back(make_symbol(fmt::format("watch{}", i)), false, false, true);
+
1117  }
+
1118  }
+
1119  return variables;
+
1120 }
+
1121 
+
1122 
+ +
1124  program_symtab = node.get_symbol_table();
+
1125 
+ +
1127  info = v.analyze(node);
+
1128  info.mod_file = mod_filename;
+
1129 
+
1130  if (!info.vectorize) {
+
1131  logger->warn(
+
1132  "CodegenCoreneuronCppVisitor : MOD file uses non-thread safe constructs of NMODL");
+
1133  }
+
1134 
+
1135  codegen_float_variables = get_float_variables();
+
1136  codegen_int_variables = get_int_variables();
+
1137 
+
1138  update_index_semantics();
+
1139  rename_function_arguments();
+
1140 }
+
1141 
+ +
1143  if (type == BlockType::Initial) {
+
1144  return method_name(naming::NRN_INIT_METHOD);
+
1145  }
+
1146  if (type == BlockType::Constructor) {
+
1147  return method_name(naming::NRN_CONSTRUCTOR_METHOD);
+
1148  }
+
1149  if (type == BlockType::Destructor) {
+
1150  return method_name(naming::NRN_DESTRUCTOR_METHOD);
+
1151  }
+
1152  if (type == BlockType::State) {
+
1153  return method_name(naming::NRN_STATE_METHOD);
+
1154  }
+
1155  if (type == BlockType::Equation) {
+
1156  return method_name(naming::NRN_CUR_METHOD);
+
1157  }
+
1158  if (type == BlockType::Watch) {
+
1159  return method_name(naming::NRN_WATCH_CHECK_METHOD);
+
1160  }
+
1161  throw std::logic_error("compute_method_name not implemented");
+
1162 }
+
1163 
+
1164 
+ +
1166  setup(node);
+
1167  print_codegen_routines();
+
1168 }
+
1169 
+
1170 } // namespace codegen
+
1171 } // namespace nmodl
std::string get_node_name() const override
Return name of the node.
Definition: ast.cpp:7061
std::shared_ptr< Expression > get_length() const noexcept
Getter for member variable IndexedName::length.
-
static bool need_semicolon(const ast::Statement &node)
Check if a semicolon is required at the end of given statement.
+
bool ion_variable_struct_required() const
Check if a structure for ion variables is required.
+
static bool need_semicolon(const ast::Statement &node)
Check if a semicolon is required at the end of given statement.
-
void update_index_semantics()
populate all index semantics needed for registration with coreneuron
+
void update_index_semantics()
populate all index semantics needed for registration with coreneuron
std::string format_double_string< CodegenCppVisitor >(const std::string &s_value)
const LocalVarVector & get_variables() const noexcept
Getter for member variable LocalListStatement::variables.
static constexpr char RANDOM_SEMANTIC[]
semantic type for RANDOM variable
Represents a C code block.
Definition: verbatim.hpp:38
static constexpr char NET_SEND_SEMANTIC[]
semantic type for net send call
-
void visit_name(const ast::Name &node) override
visit node of type ast::Name
-
bool has_parameter_of_name(const T &node, const std::string &name)
Check if function or procedure node has parameter with given name.
-
int int_variables_size() const
Number of integer variables in the model.
+
void visit_name(const ast::Name &node) override
visit node of type ast::Name
+
bool has_parameter_of_name(const T &node, const std::string &name)
Check if function or procedure node has parameter with given name.
+
int int_variables_size() const
Number of integer variables in the model.
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:795
-
void visit_if_statement(const ast::IfStatement &node) override
visit node of type ast::IfStatement
-
void visit_else_statement(const ast::ElseStatement &node) override
visit node of type ast::ElseStatement
-
bool breakpoint_exist() const noexcept
Check if breakpoint node exist.
+
void visit_if_statement(const ast::IfStatement &node) override
visit node of type ast::IfStatement
+
std::vector< ShadowUseStatement > ion_write_statements(BlockType type)
For a given output block type, return statements for writing back ion variables.
+
void visit_else_statement(const ast::ElseStatement &node) override
visit node of type ast::ElseStatement
+
bool breakpoint_exist() const noexcept
Check if breakpoint node exist.
@ Destructor
destructor block
Represents a double variable.
Definition: double.hpp:53
+
static std::pair< std::string, std::string > write_ion_variable_name(const std::string &name)
Return ion variable name and corresponding ion write variable name.
static constexpr char POINT_PROCESS_VARIABLE[]
inbuilt neuron variable for point process
-
bool net_receive_exist() const noexcept
Check if net_receive node exist.
+
bool net_receive_exist() const noexcept
Check if net_receive node exist.
std::shared_ptr< symtab::Symbol > SymbolType
static constexpr char VOLTAGE_UNUSED_VARIABLE[]
range variable for voltage when unused (for vectorized model)
static constexpr char NRN_WATCH_CHECK_METHOD[]
nrn_watch_check method in generated c++ file
virtual bool is_conductance_hint() const noexcept
Check if the ast node is an instance of ast::ConductanceHint.
Definition: ast.cpp:224
-
int float_variables_size() const
Number of float variables in the model.
-
void visit_from_statement(const ast::FromStatement &node) override
visit node of type ast::FromStatement
-
virtual void print_global_var_struct_assertions() const
Print static assertions about the global variable struct.
-
void print_mechanism_info()
Print backend code for byte array that has mechanism information (to be registered with NEURON/CoreNE...
-
void visit_prime_name(const ast::PrimeName &node) override
visit node of type ast::PrimeName
+
int float_variables_size() const
Number of float variables in the model.
+
void visit_from_statement(const ast::FromStatement &node) override
visit node of type ast::FromStatement
+
virtual void print_global_var_struct_assertions() const
Print static assertions about the global variable struct.
+
void print_mechanism_info()
Print backend code for byte array that has mechanism information (to be registered with NEURON/CoreNE...
+
void visit_prime_name(const ast::PrimeName &node) override
visit node of type ast::PrimeName
+ +
encapsulates code generation backend implementations
Definition: ast_common.hpp:26
@ index
index / int variables
static constexpr char NRN_CONSTRUCTOR_METHOD[]
nrn_constructor method in generated code
std::string format_float_string< CodegenCppVisitor >(const std::string &s_value)
int get_value() const noexcept
Getter for member variable Integer::value.
Definition: integer.hpp:157
std::shared_ptr< Identifier > get_name() const noexcept
Getter for member variable IndexedName::name.
-
bool range_variable_setup_required() const noexcept
Check if setup_range_variable function is required.
+
bool range_variable_setup_required() const noexcept
Check if setup_range_variable function is required.
Represent MUTEXLOCK statement in NMODL.
Definition: mutex_lock.hpp:38
-
void print_statement_block(const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)
Print any statement block in nmodl with option to (not) print braces.
+
void print_statement_block(const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)
Print any statement block in nmodl with option to (not) print braces.
const std::string & get_value() const noexcept
Getter for member variable Double::value.
Definition: double.hpp:158
virtual bool is_protect_statement() const noexcept
Check if the ast node is an instance of ast::ProtectStatement.
Definition: ast.cpp:228
-
void visit_binary_expression(const ast::BinaryExpression &node) override
visit node of type ast::BinaryExpression
+
void visit_binary_expression(const ast::BinaryExpression &node) override
visit node of type ast::BinaryExpression
Represents a variable.
Definition: var_name.hpp:43
Represents an integer variable.
Definition: integer.hpp:49
-
std::vector< SymbolType > get_float_variables() const
Determine all float variables required during code generation.
+
std::vector< SymbolType > get_float_variables() const
Determine all float variables required during code generation.
virtual bool is_expression_statement() const noexcept
Check if the ast node is an instance of ast::ExpressionStatement.
Definition: ast.cpp:226
static constexpr char NODE_AREA_VARIABLE[]
inbuilt neuron variable for area of the compartment
-
void visit_paren_expression(const ast::ParenExpression &node) override
visit node of type ast::ParenExpression
-
bool net_receive_buffering_required() const noexcept
Check if net receive/send buffering kernels required.
+
void visit_paren_expression(const ast::ParenExpression &node) override
visit node of type ast::ParenExpression
+
bool net_receive_buffering_required() const noexcept
Check if net receive/send buffering kernels required.
+
std::string update_if_ion_variable_name(const std::string &name) const
Determine the updated name if the ion variable has been optimized.
void visit_children(visitor::Visitor &v) override
visit children i.e.
Definition: ast.cpp:9855
std::shared_ptr< Expression > get_index() const noexcept
Getter for member variable VarName::index.
Definition: var_name.hpp:182
logger_type logger
Definition: logger.cpp:34
-
void visit_mutex_unlock(const ast::MutexUnlock &node) override
visit node of type ast::MutexUnlock
+ +
void visit_mutex_unlock(const ast::MutexUnlock &node) override
visit node of type ast::MutexUnlock
std::shared_ptr< String > get_statement() const noexcept
Getter for member variable Verbatim::statement.
Definition: verbatim.hpp:157
-
void visit_unit(const ast::Unit &node) override
visit node of type ast::Unit
+
void visit_unit(const ast::Unit &node) override
visit node of type ast::Unit
std::shared_ptr< Expression > get_rhs() const noexcept
Getter for member variable BinaryExpression::rhs.
bool eval() const
Return value of the ast node.
Definition: boolean.hpp:243
-
void visit_update_dt(const ast::UpdateDt &node) override
visit node of type ast::UpdateDt
+
void visit_update_dt(const ast::UpdateDt &node) override
visit node of type ast::UpdateDt
Helper visitor to gather AST information to help code generation.
std::shared_ptr< Expression > get_increment() const noexcept
Getter for member variable FromStatement::increment.
static constexpr char CONDUCTANCE_VARIABLE[]
range variable for conductance
std::shared_ptr< Integer > get_at() const noexcept
Getter for member variable VarName::at.
Definition: var_name.hpp:173
static std::string trim_newline(std::string text)
static constexpr char DEFAULT_FLOAT_TYPE[]
default float variable type
-
std::vector< IndexVariableInfo > get_int_variables()
Determine all int variables required during code generation.
+
std::vector< IndexVariableInfo > get_int_variables()
Determine all int variables required during code generation.
Visitor for printing C++ code compatible with legacy api of CoreNEURON
const StatementVector & get_statements() const noexcept
Getter for member variable StatementBlock::statements.
-
void visit_function_call(const ast::FunctionCall &node) override
visit node of type ast::FunctionCall
+
void visit_function_call(const ast::FunctionCall &node) override
visit node of type ast::FunctionCall
const ElseIfStatementVector & get_elseifs() const noexcept
Getter for member variable IfStatement::elseifs.
virtual bool is_mutex_lock() const noexcept
Check if the ast node is an instance of ast::MutexLock.
Definition: ast.cpp:242
std::shared_ptr< Expression > get_condition() const noexcept
Getter for member variable IfStatement::condition.
@@ -1163,42 +1359,44 @@
virtual bool is_verbatim() const noexcept
Check if the ast node is an instance of ast::Verbatim.
Definition: ast.cpp:282
Represents specific element of an array variable.
std::string eval() const
Return value of the ast node.
Definition: string.hpp:237
-
const std::regex regex_special_chars
+
const std::regex regex_special_chars
std::shared_ptr< Expression > get_from() const noexcept
Getter for member variable FromStatement::from.
-
void setup(const ast::Program &node)
Setup the target backend code generator.
-
void visit_unary_operator(const ast::UnaryOperator &node) override
visit node of type ast::UnaryOperator
+
void setup(const ast::Program &node)
Setup the target backend code generator.
+
void visit_unary_operator(const ast::UnaryOperator &node) override
visit node of type ast::UnaryOperator
static constexpr char POINT_PROCESS_SEMANTIC[]
semantic type for point process variable
-
void visit_mutex_lock(const ast::MutexLock &node) override
visit node of type ast::MutexLock
-
void visit_boolean(const ast::Boolean &node) override
visit node of type ast::Boolean
+
void visit_mutex_lock(const ast::MutexLock &node) override
visit node of type ast::MutexLock
+
void visit_boolean(const ast::Boolean &node) override
visit node of type ast::Boolean
virtual bool is_else_if_statement() const noexcept
Check if the ast node is an instance of ast::ElseIfStatement.
Definition: ast.cpp:236
-
bool nrn_cur_required() const noexcept
Check if nrn_cur function is required.
+
bool nrn_cur_required() const noexcept
Check if nrn_cur function is required.
virtual bool is_table_statement() const noexcept
Check if the ast node is an instance of ast::TableStatement.
Definition: ast.cpp:258
+
std::vector< std::string > ion_read_statements_optimized(BlockType type) const
For a given output block type, return minimal statements for all read ion variables.
@ Constructor
constructor block
Represent MUTEXUNLOCK statement in NMODL.
-
void visit_double(const ast::Double &node) override
visit node of type ast::Double
-
bool net_send_buffer_required() const noexcept
Check if net_send_buffer is required.
-
void visit_float(const ast::Float &node) override
visit node of type ast::Float
-
void visit_string(const ast::String &node) override
visit node of type ast::String
+
void visit_double(const ast::Double &node) override
visit node of type ast::Double
+
bool net_send_buffer_required() const noexcept
Check if net_send_buffer is required.
+
void visit_float(const ast::Float &node) override
visit node of type ast::Float
+
void visit_string(const ast::String &node) override
visit node of type ast::String
Represent semantic information for index variable.
std::string to_string(const T &obj)
virtual bool is_block_comment() const noexcept
Check if the ast node is an instance of ast::BlockComment.
Definition: ast.cpp:286
std::string format_float_string(const std::string &s_value)
Handles the float constants format being printed in the generated code.
-
void visit_solution_expression(const ast::SolutionExpression &node) override
visit node of type ast::SolutionExpression
+
void visit_solution_expression(const ast::SolutionExpression &node) override
visit node of type ast::SolutionExpression
static constexpr char NRN_INIT_METHOD[]
nrn_init method in generated code
const ExpressionVector & get_arguments() const noexcept
Getter for member variable FunctionCall::arguments.
static constexpr char POINTER_SEMANTIC[]
semantic type for pointer variable
-
virtual void print_global_var_struct_decl()
Instantiate global var instance.
+
virtual void print_global_var_struct_decl()
Instantiate global var instance.
static constexpr char AREA_SEMANTIC[]
semantic type for area variable
-
void visit_var_name(const ast::VarName &node) override
+
void visit_var_name(const ast::VarName &node) override
std::string mod_file
name of mod file
-
void print_nmodl_constants()
Print the nmodl constants used in backend code.
+
void print_nmodl_constants()
Print the nmodl constants used in backend code.
std::shared_ptr< Expression > get_expression() const noexcept
Getter for member variable ParenExpression::expression.
const BinaryOperator & get_op() const noexcept
Getter for member variable BinaryExpression::op.
virtual bool is_from_statement() const noexcept
Check if the ast node is an instance of ast::FromStatement.
Definition: ast.cpp:230
Represents a prime variable (for ODE)
Definition: prime_name.hpp:48
+
static std::pair< std::string, std::string > read_ion_variable_name(const std::string &name)
Return ion variable name and corresponding ion read variable name.
std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
Getter for member variable ElseIfStatement::statement_block.
Blindly rename given variable to new name
static constexpr char NRN_CUR_METHOD[]
nrn_cur method in generated code
@@ -1212,76 +1410,80 @@
virtual bool is_mutex_unlock() const noexcept
Check if the ast node is an instance of ast::MutexUnlock.
Definition: ast.cpp:244
codegen::CodegenInfo analyze(const ast::Program &node)
run visitor and return information for code generation
std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
Getter for member variable WhileStatement::statement_block.
-
void visit_integer(const ast::Integer &node) override
visit node of type ast::Integer
+
void visit_integer(const ast::Integer &node) override
visit node of type ast::Integer
Statement to indicate a change in timestep in a given block.
Definition: update_dt.hpp:38
-
std::string format_float_string(const std::string &value)
Convert a given float value to its string representation.
+
std::string format_float_string(const std::string &value)
Convert a given float value to its string representation.
std::shared_ptr< Expression > get_node_to_solve() const noexcept
Getter for member variable SolutionExpression::node_to_solve.
static std::vector< std::string > split_string(const std::string &text, char delimiter)
Split a text in a list of words, using a given delimiter character.
-
static std::string get_parameter_str(const ParamVector &params)
Generate the string representing the procedure parameter declaration.
+
static std::string get_parameter_str(const ParamVector &params)
Generate the string representing the procedure parameter declaration.
std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
Getter for member variable IfStatement::statement_block.
Represents block encapsulating list of statements.
virtual bool is_unit_state() const noexcept
Check if the ast node is an instance of ast::UnitState.
Definition: ast.cpp:210
NmodlType
NMODL variable properties.
-
bool net_receive_required() const noexcept
Check if net_receive function is required.
+
bool net_receive_required() const noexcept
Check if net_receive function is required.
static constexpr char CORE_POINTER_SEMANTIC[]
semantic type for core pointer variable
-
void rename_function_arguments()
Rename function/procedure arguments that conflict with default arguments.
-
void visit_local_list_statement(const ast::LocalListStatement &node) override
visit node of type ast::LocalListStatement
-
void visit_protect_statement(const ast::ProtectStatement &node) override
visit node of type ast::ProtectStatement
+
void rename_function_arguments()
Rename function/procedure arguments that conflict with default arguments.
+
void visit_local_list_statement(const ast::LocalListStatement &node) override
visit node of type ast::LocalListStatement
+
void visit_protect_statement(const ast::ProtectStatement &node) override
visit node of type ast::ProtectStatement
+
Represents ion write statement during code generation.
static constexpr char WATCH_SEMANTIC[]
semantic type for watch statement
Operator used in ast::BinaryExpression.
-
bool defined_method(const std::string &name) const
Check if given method is defined in this model.
+
bool defined_method(const std::string &name) const
Check if given method is defined in this model.
std::shared_ptr< Expression > get_condition() const noexcept
Getter for member variable ElseIfStatement::condition.
-
virtual void print_function_call(const ast::FunctionCall &node)
Print call to internal or external function.
+
virtual void print_function_call(const ast::FunctionCall &node)
Print call to internal or external function.
Represent solution of a block in the AST.
+
std::string process_shadow_update_statement(const ShadowUseStatement &statement, BlockType type)
Process shadow update statement.
Helper visitor to gather AST information to help code generation.
BlockType
Helper to represent various block types.
std::shared_ptr< Identifier > get_name() const noexcept
Getter for member variable VarName::name.
Definition: var_name.hpp:164
symtab::SymbolTable * get_symbol_table() const override
Return associated symbol table for the current ast node.
Definition: program.hpp:153
static constexpr char NRN_STATE_METHOD[]
nrn_state method in generated code
-
void visit_binary_operator(const ast::BinaryOperator &node) override
visit node of type ast::BinaryOperator
+
std::string breakpoint_current(std::string current) const
Determine the variable name for the "current" used in breakpoint block taking into account intermedia...
+
void visit_binary_operator(const ast::BinaryOperator &node) override
visit node of type ast::BinaryOperator
virtual bool is_solve_block() const noexcept
Check if the ast node is an instance of ast::SolveBlock.
Definition: ast.cpp:148
-
void visit_else_if_statement(const ast::ElseIfStatement &node) override
visit node of type ast::ElseIfStatement
+
void visit_else_if_statement(const ast::ElseIfStatement &node) override
visit node of type ast::ElseIfStatement
std::shared_ptr< ElseStatement > get_elses() const noexcept
Getter for member variable IfStatement::elses.
std::shared_ptr< Expression > get_lhs() const noexcept
Getter for member variable BinaryExpression::lhs.
virtual bool is_line_comment() const noexcept
Check if the ast node is an instance of ast::LineComment.
Definition: ast.cpp:284
-
std::string compute_method_name(BlockType type) const
+
std::string compute_method_name(BlockType type) const
static constexpr char AREA_VARIABLE[]
similar to node_area but user can explicitly declare it as area
Represents a name.
Definition: name.hpp:44
virtual bool is_while_statement() const noexcept
Check if the ast node is an instance of ast::WhileStatement.
Definition: ast.cpp:232
-
void visit_program(const ast::Program &program) override
Main and only member function to call after creating an instance of this class.
+
void visit_program(const ast::Program &program) override
Main and only member function to call after creating an instance of this class.
virtual bool is_else_statement() const noexcept
Check if the ast node is an instance of ast::ElseStatement.
Definition: ast.cpp:238
std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
Getter for member variable FromStatement::statement_block.
Represents top level AST node for whole NMODL input.
Definition: program.hpp:39
-
void visit_indexed_name(const ast::IndexedName &node) override
visit node of type ast::IndexedName
+
void visit_indexed_name(const ast::IndexedName &node) override
visit node of type ast::IndexedName
std::shared_ptr< Expression > get_to() const noexcept
Getter for member variable FromStatement::to.
static constexpr char T_SAVE_VARIABLE[]
variable t indicating last execution time of net receive block
-
void print_prcellstate_macros() const
Print declaration of macro NRN_PRCELLSTATE for debugging.
+
void print_prcellstate_macros() const
Print declaration of macro NRN_PRCELLSTATE for debugging.
static constexpr char FOR_NETCON_SEMANTIC[]
semantic type for for_netcon statement
std::string format_double_string(const std::string &s_value)
Handles the double constants format being printed in the generated code.
Blindly rename given variable to new name
@ State
derivative block
-
bool nrn_state_required() const noexcept
Check if nrn_state function is required.
+
bool nrn_state_required() const noexcept
Check if nrn_state function is required.
static constexpr char DIAM_VARIABLE[]
inbuilt neuron variable for diameter of the compartment
-
void visit_verbatim(const ast::Verbatim &node) override
visit node of type ast::Verbatim
+
void visit_verbatim(const ast::Verbatim &node) override
visit node of type ast::Verbatim
Represents binary expression in the NMODL.
static constexpr char NRN_DESTRUCTOR_METHOD[]
nrn_destructor method in generated code
static constexpr char CONDUCTANCE_UNUSED_VARIABLE[]
range variable when conductance is not used (for vectorized model)
-
static bool statement_to_skip(const ast::Statement &node)
Check if given statement should be skipped during code generation.
-
std::string format_double_string(const std::string &value)
Convert a given double value to its string representation.
+
static bool statement_to_skip(const ast::Statement &node)
Check if given statement should be skipped during code generation.
+
std::vector< std::string > ion_read_statements(BlockType type) const
For a given output block type, return statements for all read ion variables.
+
std::string format_double_string(const std::string &value)
Convert a given double value to its string representation.
std::shared_ptr< Expression > get_expression() const noexcept
Getter for member variable ProtectStatement::expression.
Represents a string.
Definition: string.hpp:52
Auto generated AST classes declaration.
std::string get_node_name() const override
Return name of the node.
Definition: ast.cpp:9196
-
void visit_while_statement(const ast::WhileStatement &node) override
visit node of type ast::WhileStatement
+
void visit_while_statement(const ast::WhileStatement &node) override
visit node of type ast::WhileStatement
std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
A vector of parameters represented by a 4-tuple of strings:
static constexpr char ION_VARNAME_PREFIX[]
prefix for ion variable
std::shared_ptr< Expression > get_condition() const noexcept
Getter for member variable WhileStatement::condition.
-
void visit_statement_block(const ast::StatementBlock &node) override
+
void visit_statement_block(const ast::StatementBlock &node) override
virtual void print_nrn_constructor()=0
Print nrn_constructor function definition.
+
bool ion_variable_struct_required() const
Check if a structure for ion variables is required.
bool is_last(Iter iter, const Cont &cont)
Check if the iterator is pointing to last element in the container.
-
static bool need_semicolon(const ast::Statement &node)
Check if a semicolon is required at the end of given statement.
+
static bool need_semicolon(const ast::Statement &node)
Check if a semicolon is required at the end of given statement.
-
void update_index_semantics()
populate all index semantics needed for registration with coreneuron
-
CodegenCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies)
This constructor is private, only the derived classes' public constructors are public.
+
void update_index_semantics()
populate all index semantics needed for registration with coreneuron
+
CodegenCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies)
This constructor is private, only the derived classes' public constructors are public.
virtual std::string register_mechanism_arguments() const =0
Arguments for register_mech or point_register_mech function.
virtual void print_g_unused() const =0
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
bool is_index
if this is pure index (e.g.
Represents a C code block.
Definition: verbatim.hpp:38
-
void visit_name(const ast::Name &node) override
visit node of type ast::Name
-
bool has_parameter_of_name(const T &node, const std::string &name)
Check if function or procedure node has parameter with given name.
-
int int_variables_size() const
Number of integer variables in the model.
+
void visit_name(const ast::Name &node) override
visit node of type ast::Name
+
bool has_parameter_of_name(const T &node, const std::string &name)
Check if function or procedure node has parameter with given name.
+
int int_variables_size() const
Number of integer variables in the model.
virtual void print_sdlists_init(bool print_initializers)=0
-
void visit_if_statement(const ast::IfStatement &node) override
visit node of type ast::IfStatement
+
void visit_if_statement(const ast::IfStatement &node) override
visit node of type ast::IfStatement
@ global
global variables
-
void visit_else_statement(const ast::ElseStatement &node) override
visit node of type ast::ElseStatement
+
std::vector< ShadowUseStatement > ion_write_statements(BlockType type)
For a given output block type, return statements for writing back ion variables.
+
void visit_else_statement(const ast::ElseStatement &node) override
visit node of type ast::ElseStatement
Helper to represent information about index/int variables.
-
bool breakpoint_exist() const noexcept
Check if breakpoint node exist.
+
bool breakpoint_exist() const noexcept
Check if breakpoint node exist.
Concrete constant visitor for all AST classes.
virtual void print_nrn_current(const ast::BreakpointBlock &node)=0
Print the nrn_current kernel.
@ Destructor
destructor block
@@ -1355,23 +1458,25 @@
std::string global_struct_instance() const
Name of the (host-only) global instance of global_struct
Represents a double variable.
Definition: double.hpp:53
+
static std::pair< std::string, std::string > write_ion_variable_name(const std::string &name)
Return ion variable name and corresponding ion write variable name.
virtual int position_of_float_var(const std::string &name) const =0
Determine the position in the data array for a given float variable.
const char * operator_for_d() const noexcept
Operator for diagonal vector update (matrix update)
bool optimize_ionvar_copies
Flag to indicate if visitor should avoid ion variable copies.
-
bool net_receive_exist() const noexcept
Check if net_receive node exist.
+
bool net_receive_exist() const noexcept
Check if net_receive node exist.
std::shared_ptr< symtab::Symbol > SymbolType
@ thread
thread variables
+
virtual bool optimize_ion_variable_copies() const =0
Check if ion variable copies should be avoided.
std::string nmodl_version() const noexcept
Return Nmodl language version.
bool printing_top_verbatim_blocks
true if currently printing top level verbatim blocks
-
int float_variables_size() const
Number of float variables in the model.
+
int float_variables_size() const
Number of float variables in the model.
bool is_constant
if the variable is qualified as constant (this is property of IndexVariable)
-
void visit_from_statement(const ast::FromStatement &node) override
visit node of type ast::FromStatement
-
virtual void print_global_var_struct_assertions() const
Print static assertions about the global variable struct.
+
void visit_from_statement(const ast::FromStatement &node) override
visit node of type ast::FromStatement
+
virtual void print_global_var_struct_assertions() const
Print static assertions about the global variable struct.
bool printing_net_init
true if currently initial block of net_receive being printed
-
void print_mechanism_info()
Print backend code for byte array that has mechanism information (to be registered with NEURON/CoreNE...
+
void print_mechanism_info()
Print backend code for byte array that has mechanism information (to be registered with NEURON/CoreNE...
virtual void print_global_function_common_code(BlockType type, const std::string &function_name="")=0
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
virtual void print_standard_includes()=0
Print standard C/C++ includes.
-
void visit_prime_name(const ast::PrimeName &node) override
visit node of type ast::PrimeName
+
void visit_prime_name(const ast::PrimeName &node) override
visit node of type ast::PrimeName
virtual void print_nrn_cur_non_conductance_kernel()=0
Print the nrn_cur kernel without NMODL conductance keyword provisions.
virtual void print_function_procedure_helper(const ast::Block &node)=0
Common helper function to help printing function or procedure blocks.
@@ -1382,46 +1487,47 @@
virtual void print_function(const ast::FunctionBlock &node)=0
Print NMODL function in target backend code.
Implement classes for representing symbol table at block and file scope.
virtual std::string nrn_thread_arguments() const =0
Arguments for "_threadargs_" macro in neuron implementation.
-
bool range_variable_setup_required() const noexcept
Check if setup_range_variable function is required.
+
bool range_variable_setup_required() const noexcept
Check if setup_range_variable function is required.
Represent MUTEXLOCK statement in NMODL.
Definition: mutex_lock.hpp:38
-
void print_statement_block(const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)
Print any statement block in nmodl with option to (not) print braces.
+
void print_statement_block(const ast::StatementBlock &node, bool open_brace=true, bool close_brace=true)
Print any statement block in nmodl with option to (not) print braces.
virtual std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const =0
Determine the variable name for a global variable given its symbol.
-
void visit_binary_expression(const ast::BinaryExpression &node) override
visit node of type ast::BinaryExpression
+
void visit_binary_expression(const ast::BinaryExpression &node) override
visit node of type ast::BinaryExpression
Represents a variable.
Definition: var_name.hpp:43
Represents an integer variable.
Definition: integer.hpp:49
@ BlockTypeEnd
fake ending block type for loops on the enums. Keep it at the end
-
std::vector< SymbolType > get_float_variables() const
Determine all float variables required during code generation.
+
std::vector< SymbolType > get_float_variables() const
Determine all float variables required during code generation.
virtual void print_net_move_call(const ast::FunctionCall &node)=0
Print call to net_move.
const char * default_int_data_type() const noexcept
Default data type for integer (offset) elements.
std::string mod_suffix
name of the suffix
parser::NmodlParser::symbol_type SymbolType
Definition: nmodl_utils.hpp:26
Represent information collected from AST for code generation.
-
void visit_paren_expression(const ast::ParenExpression &node) override
visit node of type ast::ParenExpression
+
void visit_paren_expression(const ast::ParenExpression &node) override
visit node of type ast::ParenExpression
const char * default_float_data_type() const noexcept
Default data type for floating point elements.
-
bool net_receive_buffering_required() const noexcept
Check if net receive/send buffering kernels required.
+
bool net_receive_buffering_required() const noexcept
Check if net receive/send buffering kernels required.
+
std::string update_if_ion_variable_name(const std::string &name) const
Determine the updated name if the ion variable has been optimized.
virtual void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node)=0
Print the nrn_cur kernel with NMODL conductance keyword provisions.
-
void visit_mutex_unlock(const ast::MutexUnlock &node) override
visit node of type ast::MutexUnlock
+
void visit_mutex_unlock(const ast::MutexUnlock &node) override
visit node of type ast::MutexUnlock
bool is_integer
if this is an integer (e.g.
virtual std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const =0
Determine the name of an int variable given its symbol.
-
void visit_unit(const ast::Unit &node) override
visit node of type ast::Unit
-
void visit_update_dt(const ast::UpdateDt &node) override
visit node of type ast::UpdateDt
-
void print_vector_elements(const std::vector< T > &elements, const std::string &separator, const std::string &prefix="")
Print the items in a vector as a list.
+
void visit_unit(const ast::Unit &node) override
visit node of type ast::Unit
+
void visit_update_dt(const ast::UpdateDt &node) override
visit node of type ast::UpdateDt
+
void print_vector_elements(const std::vector< T > &elements, const std::string &separator, const std::string &prefix="")
Print the items in a vector as a list.
IndexVariableInfo(std::shared_ptr< symtab::Symbol > symbol, bool is_vdata=false, bool is_index=false, bool is_integer=false)
static constexpr char DEFAULT_FLOAT_TYPE[]
default float variable type
-
std::vector< IndexVariableInfo > get_int_variables()
Determine all int variables required during code generation.
+
std::vector< IndexVariableInfo > get_int_variables()
Determine all int variables required during code generation.
virtual std::string nrn_thread_internal_arguments()=0
Arguments for "_threadargs_" macro in neuron implementation.
-
void visit_function_call(const ast::FunctionCall &node) override
visit node of type ast::FunctionCall
+
void visit_function_call(const ast::FunctionCall &node) override
visit node of type ast::FunctionCall
Base class for all block scoped nodes.
Definition: block.hpp:41
virtual int position_of_int_var(const std::string &name) const =0
Determine the position in the data array for a given int variable.
symtab::SymbolTable * program_symtab
Symbol table for the program.
@ Equation
breakpoint block
MemberType
Helper to represent various variables types.
-
bool is_net_move(const std::string &name) const noexcept
Checks if given function name is net_move.
+
bool is_net_move(const std::string &name) const noexcept
Checks if given function name is net_move.
Represents a float variable.
Definition: float.hpp:44
virtual void print_mechanism_global_var_structure(bool print_initializers)=0
Print the structure that wraps all global variables used in the NMODL.
Represents a BREAKPOINT block in NMODL.
@@ -1430,121 +1536,127 @@
Represents specific element of an array variable.
virtual std::string simulator_name()=0
Name of the simulator the code was generated for.
-
void setup(const ast::Program &node)
Setup the target backend code generator.
-
void visit_unary_operator(const ast::UnaryOperator &node) override
visit node of type ast::UnaryOperator
-
void visit_mutex_lock(const ast::MutexLock &node) override
visit node of type ast::MutexLock
+
void setup(const ast::Program &node)
Setup the target backend code generator.
+
void visit_unary_operator(const ast::UnaryOperator &node) override
visit node of type ast::UnaryOperator
+
void visit_mutex_lock(const ast::MutexLock &node) override
visit node of type ast::MutexLock
virtual void print_net_event_call(const ast::FunctionCall &node)=0
Print call to net_event.
-
void visit_boolean(const ast::Boolean &node) override
visit node of type ast::Boolean
-
bool nrn_cur_required() const noexcept
Check if nrn_cur function is required.
+
void visit_boolean(const ast::Boolean &node) override
visit node of type ast::Boolean
+
bool nrn_cur_required() const noexcept
Check if nrn_cur function is required.
+
std::vector< std::string > ion_read_statements_optimized(BlockType type) const
For a given output block type, return minimal statements for all read ion variables.
virtual void print_net_send_call(const ast::FunctionCall &node)=0
Print call to net_send.
@ Constructor
constructor block
virtual void print_codegen_routines()=0
Print entry point to code generation.
Represent MUTEXUNLOCK statement in NMODL.
+
virtual std::string conc_write_statement(const std::string &ion_name, const std::string &concentration, int index)=0
Generate Function call statement for nrn_wrote_conc.
Helper class for printing C/C++ code.
-
void visit_double(const ast::Double &node) override
visit node of type ast::Double
-
bool net_send_buffer_required() const noexcept
Check if net_send_buffer is required.
+
void visit_double(const ast::Double &node) override
visit node of type ast::Double
+
bool net_send_buffer_required() const noexcept
Check if net_send_buffer is required.
static constexpr char NMODL_VERSION[]
nmodl language version
std::vector< IndexVariableInfo > codegen_int_variables
All int variables for the model.
-
void visit_float(const ast::Float &node) override
visit node of type ast::Float
-
void visit_string(const ast::String &node) override
visit node of type ast::String
+
void visit_float(const ast::Float &node) override
visit node of type ast::Float
+
void visit_string(const ast::String &node) override
visit node of type ast::String
@ NetReceive
net_receive block
-
void visit_solution_expression(const ast::SolutionExpression &node) override
visit node of type ast::SolutionExpression
+
void visit_solution_expression(const ast::SolutionExpression &node) override
visit node of type ast::SolutionExpression
const char * local_var_type() const noexcept
Data type for the local variables.
virtual void print_backend_info()=0
Print top file header printed in generated code.
-
virtual void print_global_var_struct_decl()
Instantiate global var instance.
+
virtual void print_global_var_struct_decl()
Instantiate global var instance.
std::string get_channel_info_var_name() const noexcept
Name of channel info variable.
virtual void print_namespace_begin()=0
Print start of namespaces.
-
void visit_var_name(const ast::VarName &node) override
-
void print_nmodl_constants()
Print the nmodl constants used in backend code.
+
void visit_var_name(const ast::VarName &node) override
+
void print_nmodl_constants()
Print the nmodl constants used in backend code.
Represents a prime variable (for ODE)
Definition: prime_name.hpp:48
+
static std::pair< std::string, std::string > read_ion_variable_name(const std::string &name)
Return ion variable name and corresponding ion read variable name.
virtual void print_namespace_end()=0
Print end of namespaces.
Various types to store code generation specific information.
Represents a boolean variable.
Definition: boolean.hpp:42
static constexpr char DEFAULT_INTEGER_TYPE[]
default integer variable type
Represent symbol table for a NMODL block.
-
void visit_integer(const ast::Integer &node) override
visit node of type ast::Integer
+
void visit_integer(const ast::Integer &node) override
visit node of type ast::Integer
bool printing_net_receive
true if currently net_receive block being printed
virtual std::string process_verbatim_text(std::string const &text)=0
Process a verbatim block for possible variable renaming.
Statement to indicate a change in timestep in a given block.
Definition: update_dt.hpp:38
virtual void print_global_variables_for_hoc()=0
Print byte arrays that register scalar and vector variables for hoc interface.
-
std::string format_float_string(const std::string &value)
Convert a given float value to its string representation.
-
static std::string get_parameter_str(const ParamVector &params)
Generate the string representing the procedure parameter declaration.
+
std::string format_float_string(const std::string &value)
Convert a given float value to its string representation.
+
static std::string get_parameter_str(const ParamVector &params)
Generate the string representing the procedure parameter declaration.
virtual void print_nrn_cur()=0
Print nrn_cur / current update function definition.
-
bool is_net_send(const std::string &name) const noexcept
Checks if given function name is net_send.
+
bool is_net_send(const std::string &name) const noexcept
Checks if given function name is net_send.
Represents block encapsulating list of statements.
virtual void print_nrn_cur_kernel(const ast::BreakpointBlock &node)=0
Print main body of nrn_cur function.
-
bool net_receive_required() const noexcept
Check if net_receive function is required.
+
bool net_receive_required() const noexcept
Check if net_receive function is required.
virtual std::string float_variable_name(const SymbolType &symbol, bool use_instance) const =0
Determine the name of a float variable given its symbol.
virtual std::string internal_method_arguments()=0
Arguments for functions that are defined and used internally.
std::string global_struct() const
Name of structure that wraps global variables.
virtual const char * external_method_parameters(bool table=false) noexcept=0
Parameters for functions in generated code that are called back from external code.
bool electrode_current
if electrode current specified
-
void rename_function_arguments()
Rename function/procedure arguments that conflict with default arguments.
+
void rename_function_arguments()
Rename function/procedure arguments that conflict with default arguments.
virtual ParamVector internal_method_parameters()=0
Parameters for internally defined functions.
virtual void print_nrn_destructor()=0
Print nrn_destructor function definition.
-
void visit_local_list_statement(const ast::LocalListStatement &node) override
visit node of type ast::LocalListStatement
-
void visit_protect_statement(const ast::ProtectStatement &node) override
visit node of type ast::ProtectStatement
+
void visit_local_list_statement(const ast::LocalListStatement &node) override
visit node of type ast::LocalListStatement
+
void visit_protect_statement(const ast::ProtectStatement &node) override
visit node of type ast::ProtectStatement
Represents ion write statement during code generation.
virtual void print_mechanism_range_var_structure(bool print_initializers)=0
Print the structure that wraps all range and int variables required for the NMODL.
-
SymbolType make_symbol(const std::string &name) const
Creates a temporary symbol.
+
SymbolType make_symbol(const std::string &name) const
Creates a temporary symbol.
std::string float_type
Data type of floating point variables.
Operator used in ast::BinaryExpression.
-
bool defined_method(const std::string &name) const
Check if given method is defined in this model.
+
bool defined_method(const std::string &name) const
Check if given method is defined in this model.
static constexpr char NET_MOVE_METHOD[]
net_move function call in nmodl
Implement logger based on spdlog library.
bool is_vdata
if variable resides in vdata field of NrnThread typically true for bbcore pointer
-
virtual void print_function_call(const ast::FunctionCall &node)
Print call to internal or external function.
+
virtual void print_function_call(const ast::FunctionCall &node)
Print call to internal or external function.
Represent solution of a block in the AST.
+
std::string process_shadow_update_statement(const ShadowUseStatement &statement, BlockType type)
Process shadow update statement.
bool enable_variable_name_lookup
Variable name should be converted to instance name (but not for function arguments)
BlockType
Helper to represent various block types.
int current_watch_statement
Index of watch statement being printed.
static constexpr char NET_EVENT_METHOD[]
net_event function call in nmodl
virtual void print_fast_imem_calculation()=0
Print fast membrane current calculation code.
virtual void print_mechanism_register()=0
Print the mechanism registration function.
-
void visit_binary_operator(const ast::BinaryOperator &node) override
visit node of type ast::BinaryOperator
-
void visit_else_if_statement(const ast::ElseIfStatement &node) override
visit node of type ast::ElseIfStatement
+
std::string breakpoint_current(std::string current) const
Determine the variable name for the "current" used in breakpoint block taking into account intermedia...
+
void visit_binary_operator(const ast::BinaryOperator &node) override
visit node of type ast::BinaryOperator
+
void visit_else_if_statement(const ast::ElseIfStatement &node) override
visit node of type ast::ElseIfStatement
Visitor for printing C++ code compatible with legacy api of CoreNEURON
virtual void print_namespace_start()=0
Prints the start of the simulator namespace.
std::string instance_struct() const
Name of structure that wraps range variables.
-
std::string compute_method_name(BlockType type) const
+
std::string compute_method_name(BlockType type) const
virtual const char * external_method_arguments() noexcept=0
Arguments for external functions called from generated code.
Represents a name.
Definition: name.hpp:44
-
void visit_program(const ast::Program &program) override
Main and only member function to call after creating an instance of this class.
+
void visit_program(const ast::Program &program) override
Main and only member function to call after creating an instance of this class.
std::string mod_filename
Name of mod file (without .mod suffix)
virtual std::string get_variable_name(const std::string &name, bool use_instance=true) const =0
Determine variable name in the structure of mechanism properties.
Represents top level AST node for whole NMODL input.
Definition: program.hpp:39
-
void visit_indexed_name(const ast::IndexedName &node) override
visit node of type ast::IndexedName
+
void visit_indexed_name(const ast::IndexedName &node) override
visit node of type ast::IndexedName
const char * operator_for_rhs() const noexcept
Operator for rhs vector update (matrix update)
-
void print_prcellstate_macros() const
Print declaration of macro NRN_PRCELLSTATE for debugging.
+
void print_prcellstate_macros() const
Print declaration of macro NRN_PRCELLSTATE for debugging.
std::unique_ptr< CodePrinter > printer
Code printer object for target (C++)
virtual void print_namespace_stop()=0
Prints the end of the simulator namespace.
-
bool nrn_state_required() const noexcept
Check if nrn_state function is required.
+
bool nrn_state_required() const noexcept
Check if nrn_state function is required.
@ State
derivative block
-
std::string add_escape_quote(const std::string &text) const
Add quotes to string to be output.
+
std::string add_escape_quote(const std::string &text) const
Add quotes to string to be output.
bool internal_method_call_encountered
true if internal method call was encountered while processing verbatim block
virtual void print_v_unused() const =0
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
-
std::string method_name(const std::string &name) const
Constructs the name of a function or procedure.
-
void visit_verbatim(const ast::Verbatim &node) override
visit node of type ast::Verbatim
-
bool is_net_event(const std::string &name) const noexcept
Checks if given function name is net_event.
+
std::string method_name(const std::string &name) const
Constructs the name of a function or procedure.
+
void visit_verbatim(const ast::Verbatim &node) override
visit node of type ast::Verbatim
+
bool is_net_event(const std::string &name) const noexcept
Checks if given function name is net_event.
Represents binary expression in the NMODL.
virtual void print_headers_include()=0
Print all includes.
std::vector< SymbolType > codegen_float_variables
All float variables for the model.
Helper class for printing C/C++ code.
-
static bool statement_to_skip(const ast::Statement &node)
Check if given statement should be skipped during code generation.
+
static bool statement_to_skip(const ast::Statement &node)
Check if given statement should be skipped during code generation.
+
std::vector< std::string > ion_read_statements(BlockType type) const
For a given output block type, return statements for all read ion variables.
virtual void print_procedure(const ast::ProcedureBlock &node)=0
Print NMODL procedure in target backend code.
@ BeforeAfter
before / after block
virtual void print_data_structures(bool print_initializers)=0
Print all classes.
-
std::string format_double_string(const std::string &value)
Convert a given double value to its string representation.
+
std::string format_double_string(const std::string &value)
Convert a given double value to its string representation.
virtual void print_function_or_procedure(const ast::Block &node, const std::string &name)=0
Print nmodl function or procedure (common code)
-
CodegenCppVisitor(std::string mod_filename, std::ostream &stream, std::string float_type, const bool optimize_ionvar_copies)
This constructor is private, only the derived classes' public constructors are public.
+
CodegenCppVisitor(std::string mod_filename, std::ostream &stream, std::string float_type, const bool optimize_ionvar_copies)
This constructor is private, only the derived classes' public constructors are public.
Represent token returned by scanner.
Definition: modtoken.hpp:50
Represents a string.
Definition: string.hpp:52
virtual void print_nrn_state()=0
Print nrn_state / state update function definition.
@@ -1553,10 +1665,10 @@
virtual void print_function_prototypes()=0
Print function and procedures prototype declaration.
static constexpr char NET_SEND_METHOD[]
net_send function call in nmodl
virtual void print_nrn_alloc()=0
Print nrn_alloc function definition.
-
void visit_while_statement(const ast::WhileStatement &node) override
visit node of type ast::WhileStatement
+
void visit_while_statement(const ast::WhileStatement &node) override
visit node of type ast::WhileStatement
@ range
range / double variables
std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
A vector of parameters represented by a 4-tuple of strings:
-
void visit_statement_block(const ast::StatementBlock &node) override
+
void visit_statement_block(const ast::StatementBlock &node) override
Concrete visitor for all AST classes.
diff --git a/html/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html b/html/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html index 866447d47c..1c03a2627c 100644 --- a/html/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html +++ b/html/doxygen/codegen__neuron__cpp__visitor_8hpp_source.html @@ -211,661 +211,672 @@
115  */
116  virtual void print_atomic_reduction_pragma() override;
117 
-
118 
-
119  /****************************************************************************************/
-
120  /* Printing routines for code generation */
-
121  /****************************************************************************************/
-
122 
-
123 
-
124  /**
-
125  * Print call to \c net\_send
-
126  * \param node The AST node representing the function call
-
127  */
-
128  void print_net_send_call(const ast::FunctionCall& node) override;
-
129 
-
130 
-
131  /**
-
132  * Print call to net\_move
-
133  * \param node The AST node representing the function call
-
134  */
-
135  void print_net_move_call(const ast::FunctionCall& node) override;
-
136 
-
137 
-
138  /**
-
139  * Print call to net\_event
-
140  * \param node The AST node representing the function call
-
141  */
-
142  void print_net_event_call(const ast::FunctionCall& node) override;
-
143 
-
144 
-
145  /**
-
146  * Print function and procedures prototype declaration
-
147  */
-
148  void print_function_prototypes() override;
-
149 
-
150 
-
151  /**
-
152  * Print nmodl function or procedure (common code)
-
153  * \param node the AST node representing the function or procedure in NMODL
-
154  * \param name the name of the function or procedure
-
155  */
-
156  void print_function_or_procedure(const ast::Block& node, const std::string& name) override;
-
157 
-
158 
-
159  /**
-
160  * Common helper function to help printing function or procedure blocks
-
161  * \param node the AST node representing the function or procedure in NMODL
-
162  */
-
163  void print_function_procedure_helper(const ast::Block& node) override;
-
164 
-
165 
-
166  /**
-
167  * Print NMODL procedure in target backend code
-
168  * \param node
-
169  */
-
170  virtual void print_procedure(const ast::ProcedureBlock& node) override;
-
171 
-
172 
-
173  /**
-
174  * Print NMODL function in target backend code
-
175  * \param node
-
176  */
-
177  void print_function(const ast::FunctionBlock& node) override;
-
178 
-
179 
-
180  /****************************************************************************************/
-
181  /* Code-specific helper routines */
-
182  /****************************************************************************************/
+
118 
+
119  /**
+
120  * Check if ion variable copies should be avoided
+
121  */
+
122  bool optimize_ion_variable_copies() const override;
+
123 
+
124  /****************************************************************************************/
+
125  /* Printing routines for code generation */
+
126  /****************************************************************************************/
+
127 
+
128 
+
129  /**
+
130  * Print call to \c net\_send
+
131  * \param node The AST node representing the function call
+
132  */
+
133  void print_net_send_call(const ast::FunctionCall& node) override;
+
134 
+
135 
+
136  /**
+
137  * Print call to net\_move
+
138  * \param node The AST node representing the function call
+
139  */
+
140  void print_net_move_call(const ast::FunctionCall& node) override;
+
141 
+
142 
+
143  /**
+
144  * Print call to net\_event
+
145  * \param node The AST node representing the function call
+
146  */
+
147  void print_net_event_call(const ast::FunctionCall& node) override;
+
148 
+
149 
+
150  /**
+
151  * Print function and procedures prototype declaration
+
152  */
+
153  void print_function_prototypes() override;
+
154 
+
155 
+
156  /**
+
157  * Print nmodl function or procedure (common code)
+
158  * \param node the AST node representing the function or procedure in NMODL
+
159  * \param name the name of the function or procedure
+
160  */
+
161  void print_function_or_procedure(const ast::Block& node, const std::string& name) override;
+
162 
+
163 
+
164  /**
+
165  * Common helper function to help printing function or procedure blocks
+
166  * \param node the AST node representing the function or procedure in NMODL
+
167  */
+
168  void print_function_procedure_helper(const ast::Block& node) override;
+
169 
+
170 
+
171  /**
+
172  * Print NMODL procedure in target backend code
+
173  * \param node
+
174  */
+
175  virtual void print_procedure(const ast::ProcedureBlock& node) override;
+
176 
+
177 
+
178  /**
+
179  * Print NMODL function in target backend code
+
180  * \param node
+
181  */
+
182  void print_function(const ast::FunctionBlock& node) override;
183 
-
184 
-
185  /**
-
186  * Arguments for functions that are defined and used internally.
-
187  * \return the method arguments
-
188  */
-
189  std::string internal_method_arguments() override;
-
190 
-
191 
-
192  /**
-
193  * Parameters for internally defined functions
-
194  * \return the method parameters
-
195  */
- -
197 
-
198 
-
199  /**
-
200  * Arguments for external functions called from generated code
-
201  * \return A string representing the arguments passed to an external function
-
202  */
-
203  const char* external_method_arguments() noexcept override;
-
204 
-
205 
-
206  /**
-
207  * Parameters for functions in generated code that are called back from external code
-
208  *
-
209  * Functions registered in NEURON during initialization for callback must adhere to a prescribed
-
210  * calling convention. This method generates the string representing the function parameters for
-
211  * these externally called functions.
-
212  * \param table
-
213  * \return A string representing the parameters of the function
-
214  */
-
215  const char* external_method_parameters(bool table = false) noexcept override;
-
216 
-
217 
-
218  /**
-
219  * Arguments for "_threadargs_" macro in neuron implementation
-
220  */
-
221  std::string nrn_thread_arguments() const override;
-
222 
-
223 
-
224  /**
-
225  * Arguments for "_threadargs_" macro in neuron implementation
-
226  */
-
227  std::string nrn_thread_internal_arguments() override;
-
228 
-
229 
-
230  /**
-
231  * Process a verbatim block for possible variable renaming
-
232  * \param text The verbatim code to be processed
-
233  * \return The code with all variables renamed as needed
-
234  */
-
235  std::string process_verbatim_text(std::string const& text) override;
-
236 
-
237 
-
238  /**
-
239  * Arguments for register_mech or point_register_mech function
-
240  */
-
241  std::string register_mechanism_arguments() const override;
-
242 
-
243 
-
244  /****************************************************************************************/
-
245  /* Code-specific printing routines for code generations */
-
246  /****************************************************************************************/
+
184 
+
185  /****************************************************************************************/
+
186  /* Code-specific helper routines */
+
187  /****************************************************************************************/
+
188 
+
189 
+
190  /**
+
191  * Arguments for functions that are defined and used internally.
+
192  * \return the method arguments
+
193  */
+
194  std::string internal_method_arguments() override;
+
195 
+
196 
+
197  /**
+
198  * Parameters for internally defined functions
+
199  * \return the method parameters
+
200  */
+ +
202 
+
203 
+
204  /**
+
205  * Arguments for external functions called from generated code
+
206  * \return A string representing the arguments passed to an external function
+
207  */
+
208  const char* external_method_arguments() noexcept override;
+
209 
+
210 
+
211  /**
+
212  * Parameters for functions in generated code that are called back from external code
+
213  *
+
214  * Functions registered in NEURON during initialization for callback must adhere to a prescribed
+
215  * calling convention. This method generates the string representing the function parameters for
+
216  * these externally called functions.
+
217  * \param table
+
218  * \return A string representing the parameters of the function
+
219  */
+
220  const char* external_method_parameters(bool table = false) noexcept override;
+
221 
+
222 
+
223  /**
+
224  * Arguments for "_threadargs_" macro in neuron implementation
+
225  */
+
226  std::string nrn_thread_arguments() const override;
+
227 
+
228 
+
229  /**
+
230  * Arguments for "_threadargs_" macro in neuron implementation
+
231  */
+
232  std::string nrn_thread_internal_arguments() override;
+
233 
+
234 
+
235  /**
+
236  * Process a verbatim block for possible variable renaming
+
237  * \param text The verbatim code to be processed
+
238  * \return The code with all variables renamed as needed
+
239  */
+
240  std::string process_verbatim_text(std::string const& text) override;
+
241 
+
242 
+
243  /**
+
244  * Arguments for register_mech or point_register_mech function
+
245  */
+
246  std::string register_mechanism_arguments() const override;
247 
-
248 
-
249  /**
-
250  * Prints the start of the \c neuron namespace
-
251  */
-
252  void print_namespace_start() override;
-
253 
-
254 
-
255  /**
-
256  * Prints the end of the \c neuron namespace
-
257  */
-
258  void print_namespace_stop() override;
-
259 
-
260 
-
261  /****************************************************************************************/
-
262  /* Routines for returning variable name */
-
263  /****************************************************************************************/
-
264 
-
265 
-
266  /**
-
267  * Determine the name of a \c float variable given its symbol
-
268  *
-
269  * This function typically returns the accessor expression in backend code for the given symbol.
-
270  * Since the model variables are stored in data arrays and accessed by offset, this function
-
271  * will return the C++ string representing the array access at the correct offset
-
272  *
-
273  * \param symbol The symbol of a variable for which we want to obtain its name
-
274  * \param use_instance Should the variable be accessed via instance or data array
-
275  * \return The backend code string representing the access to the given variable
-
276  * symbol
-
277  */
-
278  std::string float_variable_name(const SymbolType& symbol, bool use_instance) const override;
-
279 
-
280 
-
281  /**
-
282  * Determine the name of an \c int variable given its symbol
-
283  *
-
284  * This function typically returns the accessor expression in backend code for the given symbol.
-
285  * Since the model variables are stored in data arrays and accessed by offset, this function
-
286  * will return the C++ string representing the array access at the correct offset
-
287  *
-
288  * \param symbol The symbol of a variable for which we want to obtain its name
-
289  * \param name The name of the index variable
-
290  * \param use_instance Should the variable be accessed via instance or data array
-
291  * \return The backend code string representing the access to the given variable
-
292  * symbol
-
293  */
-
294  std::string int_variable_name(const IndexVariableInfo& symbol,
-
295  const std::string& name,
-
296  bool use_instance) const override;
-
297 
-
298 
-
299  /**
-
300  * Determine the variable name for a global variable given its symbol
-
301  * \param symbol The symbol of a variable for which we want to obtain its name
-
302  * \param use_instance Should the variable be accessed via the (host-only)
-
303  * global variable or the instance-specific copy (also available on GPU).
-
304  * \return The C++ string representing the access to the global variable
-
305  */
-
306  std::string global_variable_name(const SymbolType& symbol,
-
307  bool use_instance = true) const override;
-
308 
-
309 
-
310  /**
-
311  * Determine variable name in the structure of mechanism properties
-
312  *
-
313  * \param name Variable name that is being printed
-
314  * \param use_instance Should the variable be accessed via instance or data array
-
315  * \return The C++ string representing the access to the variable in the neuron
-
316  * thread structure
-
317  */
-
318  std::string get_variable_name(const std::string& name, bool use_instance = true) const override;
-
319 
-
320 
-
321  /****************************************************************************************/
-
322  /* Main printing routines for code generation */
-
323  /****************************************************************************************/
-
324 
-
325 
-
326  /**
-
327  * Print top file header printed in generated code
-
328  */
-
329  void print_backend_info() override;
-
330 
-
331 
-
332  /**
-
333  * Print standard C/C++ includes
-
334  */
-
335  void print_standard_includes() override;
-
336 
-
337 
-
338  /**
-
339  * Print includes from NEURON
-
340  */
-
341  void print_neuron_includes();
-
342 
-
343 
-
344  void print_sdlists_init(bool print_initializers) override;
-
345 
-
346 
-
347  /**
-
348  * Print the structure that wraps all global variables used in the NMODL
-
349  *
-
350  * \param print_initializers Whether to include default values in the struct
-
351  * definition (true: int foo{42}; false: int foo;)
-
352  */
-
353  void print_mechanism_global_var_structure(bool print_initializers) override;
-
354 
-
355 
-
356  /**
-
357  * Print byte arrays that register scalar and vector variables for hoc interface
-
358  *
-
359  */
-
360  void print_global_variables_for_hoc() override;
-
361 
-
362 
-
363  /**
-
364  * Print the mechanism registration function
-
365  *
-
366  */
-
367  void print_mechanism_register() override;
-
368 
-
369 
-
370  /**
-
371  * Print common code for global functions like nrn_init, nrn_cur and nrn_state
-
372  * \param type The target backend code block type
-
373  */
- -
375  const std::string& function_name = "") override;
+
248  std::string conc_write_statement(const std::string& ion_name,
+
249  const std::string& concentration,
+
250  int index) override;
+
251 
+
252  /****************************************************************************************/
+
253  /* Code-specific printing routines for code generations */
+
254  /****************************************************************************************/
+
255 
+
256 
+
257  /**
+
258  * Prints the start of the \c neuron namespace
+
259  */
+
260  void print_namespace_start() override;
+
261 
+
262 
+
263  /**
+
264  * Prints the end of the \c neuron namespace
+
265  */
+
266  void print_namespace_stop() override;
+
267 
+
268 
+
269  /****************************************************************************************/
+
270  /* Routines for returning variable name */
+
271  /****************************************************************************************/
+
272 
+
273 
+
274  /**
+
275  * Determine the name of a \c float variable given its symbol
+
276  *
+
277  * This function typically returns the accessor expression in backend code for the given symbol.
+
278  * Since the model variables are stored in data arrays and accessed by offset, this function
+
279  * will return the C++ string representing the array access at the correct offset
+
280  *
+
281  * \param symbol The symbol of a variable for which we want to obtain its name
+
282  * \param use_instance Should the variable be accessed via instance or data array
+
283  * \return The backend code string representing the access to the given variable
+
284  * symbol
+
285  */
+
286  std::string float_variable_name(const SymbolType& symbol, bool use_instance) const override;
+
287 
+
288 
+
289  /**
+
290  * Determine the name of an \c int variable given its symbol
+
291  *
+
292  * This function typically returns the accessor expression in backend code for the given symbol.
+
293  * Since the model variables are stored in data arrays and accessed by offset, this function
+
294  * will return the C++ string representing the array access at the correct offset
+
295  *
+
296  * \param symbol The symbol of a variable for which we want to obtain its name
+
297  * \param name The name of the index variable
+
298  * \param use_instance Should the variable be accessed via instance or data array
+
299  * \return The backend code string representing the access to the given variable
+
300  * symbol
+
301  */
+
302  std::string int_variable_name(const IndexVariableInfo& symbol,
+
303  const std::string& name,
+
304  bool use_instance) const override;
+
305 
+
306 
+
307  /**
+
308  * Determine the variable name for a global variable given its symbol
+
309  * \param symbol The symbol of a variable for which we want to obtain its name
+
310  * \param use_instance Should the variable be accessed via the (host-only)
+
311  * global variable or the instance-specific copy (also available on GPU).
+
312  * \return The C++ string representing the access to the global variable
+
313  */
+
314  std::string global_variable_name(const SymbolType& symbol,
+
315  bool use_instance = true) const override;
+
316 
+
317 
+
318  /**
+
319  * Determine variable name in the structure of mechanism properties
+
320  *
+
321  * \param name Variable name that is being printed
+
322  * \param use_instance Should the variable be accessed via instance or data array
+
323  * \return The C++ string representing the access to the variable in the neuron
+
324  * thread structure
+
325  */
+
326  std::string get_variable_name(const std::string& name, bool use_instance = true) const override;
+
327 
+
328 
+
329  /****************************************************************************************/
+
330  /* Main printing routines for code generation */
+
331  /****************************************************************************************/
+
332 
+
333 
+
334  /**
+
335  * Print top file header printed in generated code
+
336  */
+
337  void print_backend_info() override;
+
338 
+
339 
+
340  /**
+
341  * Print standard C/C++ includes
+
342  */
+
343  void print_standard_includes() override;
+
344 
+
345 
+
346  /**
+
347  * Print includes from NEURON
+
348  */
+
349  void print_neuron_includes();
+
350 
+
351 
+
352  void print_sdlists_init(bool print_initializers) override;
+
353 
+
354 
+
355  /**
+
356  * Print the structure that wraps all global variables used in the NMODL
+
357  *
+
358  * \param print_initializers Whether to include default values in the struct
+
359  * definition (true: int foo{42}; false: int foo;)
+
360  */
+
361  void print_mechanism_global_var_structure(bool print_initializers) override;
+
362 
+
363 
+
364  /**
+
365  * Print byte arrays that register scalar and vector variables for hoc interface
+
366  *
+
367  */
+
368  void print_global_variables_for_hoc() override;
+
369 
+
370 
+
371  /**
+
372  * Print the mechanism registration function
+
373  *
+
374  */
+
375  void print_mechanism_register() override;
376 
377 
378  /**
-
379  * Print the \c nrn\_init function definition
-
380  * \param skip_init_check \c true to generate code executing the initialization conditionally
+
379  * Print common code for global functions like nrn_init, nrn_cur and nrn_state
+
380  * \param type The target backend code block type
381  */
-
382  void print_nrn_init(bool skip_init_check = true);
-
383 
-
384  /** Print the initial block. */
-
385  void print_initial_block(const ast::InitialBlock* node);
-
386 
-
387  /**
-
388  * Print nrn_constructor function definition
-
389  *
-
390  */
-
391  void print_nrn_constructor() override;
-
392 
-
393 
-
394  /**
-
395  * Print nrn_destructor function definition
-
396  *
-
397  */
-
398  void print_nrn_destructor() override;
-
399 
-
400 
-
401  /**
-
402  * Print nrn_alloc function definition
-
403  *
-
404  */
-
405  void print_nrn_alloc() override;
-
406 
-
407 
-
408  /**
-
409  * Print nrn_jacob function definition
-
410  *
-
411  */
-
412  void print_nrn_jacob();
-
413 
+ +
383  const std::string& function_name = "") override;
+
384 
+
385 
+
386  /**
+
387  * Print the \c nrn\_init function definition
+
388  * \param skip_init_check \c true to generate code executing the initialization conditionally
+
389  */
+
390  void print_nrn_init(bool skip_init_check = true);
+
391 
+
392  /** Print the initial block. */
+
393  void print_initial_block(const ast::InitialBlock* node);
+
394 
+
395  /**
+
396  * Print nrn_constructor function definition
+
397  *
+
398  */
+
399  void print_nrn_constructor() override;
+
400 
+
401 
+
402  /**
+
403  * Print nrn_destructor function definition
+
404  *
+
405  */
+
406  void print_nrn_destructor() override;
+
407 
+
408 
+
409  /**
+
410  * Print nrn_alloc function definition
+
411  *
+
412  */
+
413  void print_nrn_alloc() override;
414 
-
415  /****************************************************************************************/
-
416  /* Print nrn_state routine */
-
417  /****************************************************************************************/
-
418 
-
419 
-
420  /**
-
421  * Print nrn_state / state update function definition
-
422  */
-
423  void print_nrn_state() override;
-
424 
-
425 
-
426  /****************************************************************************************/
-
427  /* Print nrn_cur related routines */
-
428  /****************************************************************************************/
-
429 
-
430 
-
431  /**
-
432  * Print the \c nrn_current kernel
-
433  *
-
434  * \note nrn_cur_kernel will have two calls to nrn_current if no conductance keywords specified
-
435  * \param node the AST node representing the NMODL breakpoint block
-
436  */
-
437  void print_nrn_current(const ast::BreakpointBlock& node) override;
-
438 
-
439 
-
440  /**
-
441  * Print the \c nrn\_cur kernel with NMODL \c conductance keyword provisions
-
442  *
-
443  * If the NMODL \c conductance keyword is used in the \c breakpoint block, then
-
444  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
-
445  *
-
446  * \param node the AST node representing the NMODL breakpoint block
-
447  */
-
448  void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock& node) override;
-
449 
-
450 
-
451  /**
-
452  * Print the \c nrn\_cur kernel without NMODL \c conductance keyword provisions
+
415 
+
416  /**
+
417  * Print nrn_jacob function definition
+
418  *
+
419  */
+
420  void print_nrn_jacob();
+
421 
+
422 
+
423  /****************************************************************************************/
+
424  /* Print nrn_state routine */
+
425  /****************************************************************************************/
+
426 
+
427 
+
428  /**
+
429  * Print nrn_state / state update function definition
+
430  */
+
431  void print_nrn_state() override;
+
432 
+
433 
+
434  /****************************************************************************************/
+
435  /* Print nrn_cur related routines */
+
436  /****************************************************************************************/
+
437 
+
438 
+
439  /**
+
440  * Print the \c nrn_current kernel
+
441  *
+
442  * \note nrn_cur_kernel will have two calls to nrn_current if no conductance keywords specified
+
443  * \param node the AST node representing the NMODL breakpoint block
+
444  */
+
445  void print_nrn_current(const ast::BreakpointBlock& node) override;
+
446 
+
447 
+
448  /**
+
449  * Print the \c nrn\_cur kernel with NMODL \c conductance keyword provisions
+
450  *
+
451  * If the NMODL \c conductance keyword is used in the \c breakpoint block, then
+
452  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
453  *
-
454  * If the NMODL \c conductance keyword is \b not used in the \c breakpoint block, then
-
455  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
-
456  */
-
457  void print_nrn_cur_non_conductance_kernel() override;
-
458 
-
459 
-
460  /**
-
461  * Print main body of nrn_cur function
-
462  * \param node the AST node representing the NMODL breakpoint block
-
463  */
-
464  void print_nrn_cur_kernel(const ast::BreakpointBlock& node) override;
-
465 
-
466 
-
467  /**
-
468  * Print fast membrane current calculation code
-
469  */
-
470  virtual void print_fast_imem_calculation() override;
-
471 
-
472 
-
473  /**
-
474  * Print nrn_cur / current update function definition
-
475  */
-
476  void print_nrn_cur() override;
-
477 
-
478 
-
479  /****************************************************************************************/
-
480  /* Main code printing entry points */
-
481  /****************************************************************************************/
-
482 
-
483 
-
484  /**
-
485  * Print all includes
-
486  *
-
487  */
-
488  void print_headers_include() override;
-
489 
-
490 
-
491  /**
-
492  * Print all NEURON macros
-
493  *
-
494  */
- -
496 
-
497 
-
498  /**
-
499  * Print NEURON global variable macros
-
500  *
-
501  */
-
502  void print_global_macros();
-
503 
-
504 
-
505  /**
-
506  * Print mechanism variables' related macros
-
507  *
-
508  */
- -
510 
-
511 
-
512  /**
-
513  * Print start of namespaces
-
514  *
-
515  */
-
516  void print_namespace_begin() override;
-
517 
-
518 
-
519  /**
-
520  * Print end of namespaces
-
521  *
-
522  */
-
523  void print_namespace_end() override;
-
524 
-
525 
-
526  /**
-
527  * Print all classes
-
528  * \param print_initializers Whether to include default values.
-
529  */
-
530  void print_data_structures(bool print_initializers) override;
-
531 
-
532  /** Print `make_*_instance`.
-
533  */
-
534  void print_make_instance() const;
-
535 
-
536  /**
-
537  * Set v_unused (voltage) for NRN_PRCELLSTATE feature
-
538  */
-
539  void print_v_unused() const override;
-
540 
-
541 
-
542  /**
-
543  * Set g_unused (conductance) for NRN_PRCELLSTATE feature
-
544  */
-
545  void print_g_unused() const override;
-
546 
-
547 
-
548  /**
-
549  * Print all compute functions for every backend
-
550  *
-
551  */
-
552  virtual void print_compute_functions() override;
-
553 
-
554 
-
555  /**
-
556  * Print entry point to code generation
-
557  *
-
558  */
-
559  void print_codegen_routines() override;
-
560 
+
454  * \param node the AST node representing the NMODL breakpoint block
+
455  */
+
456  void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock& node) override;
+
457 
+
458 
+
459  /**
+
460  * Print the \c nrn\_cur kernel without NMODL \c conductance keyword provisions
+
461  *
+
462  * If the NMODL \c conductance keyword is \b not used in the \c breakpoint block, then
+
463  * CodegenCoreneuronCppVisitor::print_nrn_cur_kernel will use this printer
+
464  */
+
465  void print_nrn_cur_non_conductance_kernel() override;
+
466 
+
467 
+
468  /**
+
469  * Print main body of nrn_cur function
+
470  * \param node the AST node representing the NMODL breakpoint block
+
471  */
+
472  void print_nrn_cur_kernel(const ast::BreakpointBlock& node) override;
+
473 
+
474 
+
475  /**
+
476  * Print fast membrane current calculation code
+
477  */
+
478  virtual void print_fast_imem_calculation() override;
+
479 
+
480 
+
481  /**
+
482  * Print nrn_cur / current update function definition
+
483  */
+
484  void print_nrn_cur() override;
+
485 
+
486 
+
487  /****************************************************************************************/
+
488  /* Main code printing entry points */
+
489  /****************************************************************************************/
+
490 
+
491 
+
492  /**
+
493  * Print all includes
+
494  *
+
495  */
+
496  void print_headers_include() override;
+
497 
+
498 
+
499  /**
+
500  * Print all NEURON macros
+
501  *
+
502  */
+ +
504 
+
505 
+
506  /**
+
507  * Print NEURON global variable macros
+
508  *
+
509  */
+
510  void print_global_macros();
+
511 
+
512 
+
513  /**
+
514  * Print mechanism variables' related macros
+
515  *
+
516  */
+ +
518 
+
519 
+
520  /**
+
521  * Print start of namespaces
+
522  *
+
523  */
+
524  void print_namespace_begin() override;
+
525 
+
526 
+
527  /**
+
528  * Print end of namespaces
+
529  *
+
530  */
+
531  void print_namespace_end() override;
+
532 
+
533 
+
534  /**
+
535  * Print all classes
+
536  * \param print_initializers Whether to include default values.
+
537  */
+
538  void print_data_structures(bool print_initializers) override;
+
539 
+
540  /** Print `make_*_instance`.
+
541  */
+
542  void print_make_instance() const;
+
543 
+
544  /**
+
545  * Set v_unused (voltage) for NRN_PRCELLSTATE feature
+
546  */
+
547  void print_v_unused() const override;
+
548 
+
549 
+
550  /**
+
551  * Set g_unused (conductance) for NRN_PRCELLSTATE feature
+
552  */
+
553  void print_g_unused() const override;
+
554 
+
555 
+
556  /**
+
557  * Print all compute functions for every backend
+
558  *
+
559  */
+
560  virtual void print_compute_functions() override;
561 
-
562  /****************************************************************************************/
-
563  /* Overloaded visitor routines */
-
564  /****************************************************************************************/
-
565 
-
566 
-
567  virtual void visit_watch_statement(const ast::WatchStatement& node) override;
+
562 
+
563  /**
+
564  * Print entry point to code generation
+
565  *
+
566  */
+
567  void print_codegen_routines() override;
568 
-
569 
-
570  /**
-
571  * Print prototype declarations of functions or procedures
-
572  * \tparam T The AST node type of the node (must be of nmodl::ast::Ast or subclass)
-
573  * \param node The AST node representing the function or procedure block
-
574  * \param name A user defined name for the function
-
575  */
-
576  template <typename T>
-
577  void print_function_declaration(const T& node, const std::string& name);
-
578 
-
579 
-
580  public:
-
581  /**
-
582  * \brief Constructs the C++ code generator visitor
-
583  *
-
584  * This constructor instantiates an NMODL C++ code generator and allows writing generated code
-
585  * directly to a file in \c [output_dir]/[mod_filename].cpp.
-
586  *
-
587  * \note No code generation is performed at this stage. Since the code
-
588  * generator classes are all based on \c AstVisitor the AST must be visited using e.g. \c
-
589  * visit_program in order to generate the C++ code corresponding to the AST.
-
590  *
-
591  * \param mod_filename The name of the model for which code should be generated.
-
592  * It is used for constructing an output filename.
-
593  * \param output_dir The directory where target C++ file should be generated.
-
594  * \param float_type The float type to use in the generated code. The string will be used
-
595  * as-is in the target code. This defaults to \c double.
-
596  */
- -
598  const std::string& output_dir,
-
599  std::string float_type,
-
600  const bool optimize_ionvar_copies)
- -
602 
-
603  /**
-
604  * \copybrief nmodl::codegen::CodegenNeuronCppVisitor
-
605  *
-
606  * This constructor instantiates an NMODL C++ code generator and allows writing generated code
-
607  * into an output stream.
-
608  *
-
609  * \note No code generation is performed at this stage. Since the code
-
610  * generator classes are all based on \c AstVisitor the AST must be visited using e.g. \c
-
611  * visit_program in order to generate the C++ code corresponding to the AST.
-
612  *
-
613  * \param mod_filename The name of the model for which code should be generated.
-
614  * It is used for constructing an output filename.
-
615  * \param stream The output stream onto which to write the generated code
-
616  * \param float_type The float type to use in the generated code. The string will be used
-
617  * as-is in the target code. This defaults to \c double.
-
618  */
- -
620  std::ostream& stream,
-
621  std::string float_type,
-
622  const bool optimize_ionvar_copies)
- -
624 
-
625 
-
626  /****************************************************************************************/
-
627  /* Public printing routines for code generation for use in unit tests */
-
628  /****************************************************************************************/
-
629 
-
630 
-
631  /**
-
632  * Print the structure that wraps all range and int variables required for the NMODL
-
633  *
-
634  * \param print_initializers Whether or not default values for variables
-
635  * be included in the struct declaration.
-
636  */
-
637  void print_mechanism_range_var_structure(bool print_initializers) override;
-
638 };
-
639 
-
640 
-
641 /**
-
642  * \details If there is an argument with name (say alpha) same as range variable (say alpha),
-
643  * we want to avoid it being printed as instance->alpha. And hence we disable variable
-
644  * name lookup during prototype declaration. Note that the name of procedure can be
-
645  * different in case of table statement.
-
646  */
-
647 template <typename T>
-
648 void CodegenNeuronCppVisitor::print_function_declaration(const T& node, const std::string& name) {
- -
650  auto type = default_float_data_type();
-
651 
-
652  // internal and user provided arguments
-
653  auto internal_params = internal_method_parameters();
-
654  const auto& params = node.get_parameters();
-
655  for (const auto& param: params) {
-
656  internal_params.emplace_back("", type, "", param.get()->get_node_name());
-
657  }
-
658 
-
659  // procedures have "int" return type by default
-
660  const char* return_type = "int";
-
661  if (node.is_function_block()) {
-
662  return_type = default_float_data_type();
-
663  }
-
664 
-
665  /// TODO: Edit for NEURON
-
666  printer->add_indent();
-
667  printer->fmt_text("inline {} {}({})",
-
668  return_type,
-
669  method_name(name),
-
670  get_parameter_str(internal_params));
-
671 
- -
673 }
-
674 
-
675 /** \} */ // end of codegen_backends
-
676 
-
677 } // namespace codegen
-
678 } // namespace nmodl
+
569 
+
570  /****************************************************************************************/
+
571  /* Overloaded visitor routines */
+
572  /****************************************************************************************/
+
573 
+
574 
+
575  virtual void visit_watch_statement(const ast::WatchStatement& node) override;
+
576 
+
577 
+
578  /**
+
579  * Print prototype declarations of functions or procedures
+
580  * \tparam T The AST node type of the node (must be of nmodl::ast::Ast or subclass)
+
581  * \param node The AST node representing the function or procedure block
+
582  * \param name A user defined name for the function
+
583  */
+
584  template <typename T>
+
585  void print_function_declaration(const T& node, const std::string& name);
+
586 
+
587 
+
588  public:
+
589  /**
+
590  * \brief Constructs the C++ code generator visitor
+
591  *
+
592  * This constructor instantiates an NMODL C++ code generator and allows writing generated code
+
593  * directly to a file in \c [output_dir]/[mod_filename].cpp.
+
594  *
+
595  * \note No code generation is performed at this stage. Since the code
+
596  * generator classes are all based on \c AstVisitor the AST must be visited using e.g. \c
+
597  * visit_program in order to generate the C++ code corresponding to the AST.
+
598  *
+
599  * \param mod_filename The name of the model for which code should be generated.
+
600  * It is used for constructing an output filename.
+
601  * \param output_dir The directory where target C++ file should be generated.
+
602  * \param float_type The float type to use in the generated code. The string will be used
+
603  * as-is in the target code. This defaults to \c double.
+
604  */
+ +
606  const std::string& output_dir,
+
607  std::string float_type,
+
608  const bool optimize_ionvar_copies)
+ +
610 
+
611  /**
+
612  * \copybrief nmodl::codegen::CodegenNeuronCppVisitor
+
613  *
+
614  * This constructor instantiates an NMODL C++ code generator and allows writing generated code
+
615  * into an output stream.
+
616  *
+
617  * \note No code generation is performed at this stage. Since the code
+
618  * generator classes are all based on \c AstVisitor the AST must be visited using e.g. \c
+
619  * visit_program in order to generate the C++ code corresponding to the AST.
+
620  *
+
621  * \param mod_filename The name of the model for which code should be generated.
+
622  * It is used for constructing an output filename.
+
623  * \param stream The output stream onto which to write the generated code
+
624  * \param float_type The float type to use in the generated code. The string will be used
+
625  * as-is in the target code. This defaults to \c double.
+
626  */
+ +
628  std::ostream& stream,
+
629  std::string float_type,
+
630  const bool optimize_ionvar_copies)
+ +
632 
+
633 
+
634  /****************************************************************************************/
+
635  /* Public printing routines for code generation for use in unit tests */
+
636  /****************************************************************************************/
+
637 
+
638 
+
639  /**
+
640  * Print the structure that wraps all range and int variables required for the NMODL
+
641  *
+
642  * \param print_initializers Whether or not default values for variables
+
643  * be included in the struct declaration.
+
644  */
+
645  void print_mechanism_range_var_structure(bool print_initializers) override;
+
646 };
+
647 
+
648 
+
649 /**
+
650  * \details If there is an argument with name (say alpha) same as range variable (say alpha),
+
651  * we want to avoid it being printed as instance->alpha. And hence we disable variable
+
652  * name lookup during prototype declaration. Note that the name of procedure can be
+
653  * different in case of table statement.
+
654  */
+
655 template <typename T>
+
656 void CodegenNeuronCppVisitor::print_function_declaration(const T& node, const std::string& name) {
+ +
658  auto type = default_float_data_type();
+
659 
+
660  // internal and user provided arguments
+
661  auto internal_params = internal_method_parameters();
+
662  const auto& params = node.get_parameters();
+
663  for (const auto& param: params) {
+
664  internal_params.emplace_back("", type, "", param.get()->get_node_name());
+
665  }
+
666 
+
667  // procedures have "int" return type by default
+
668  const char* return_type = "int";
+
669  if (node.is_function_block()) {
+
670  return_type = default_float_data_type();
+
671  }
+
672 
+
673  /// TODO: Edit for NEURON
+
674  printer->add_indent();
+
675  printer->fmt_text("inline {} {}({})",
+
676  return_type,
+
677  method_name(name),
+
678  get_parameter_str(internal_params));
+
679 
+ +
681 }
+
682 
+
683 /** \} */ // end of codegen_backends
+
684 
+
685 } // namespace codegen
+
686 } // namespace nmodl
-
const char * external_method_parameters(bool table=false) noexcept override
Parameters for functions in generated code that are called back from external code.
-
void print_nrn_destructor() override
Print nrn_destructor function definition.
-
void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
+
const char * external_method_parameters(bool table=false) noexcept override
Parameters for functions in generated code that are called back from external code.
+
void print_nrn_destructor() override
Print nrn_destructor function definition.
+
void print_nrn_cur_non_conductance_kernel() override
Print the nrn_cur kernel without NMODL conductance keyword provisions.
Helper to represent information about index/int variables.
-
void print_nrn_cur() override
Print nrn_cur / current update function definition.
-
void print_macro_definitions()
Print all NEURON macros.
+
void print_nrn_cur() override
Print nrn_cur / current update function definition.
+
void print_macro_definitions()
Print all NEURON macros.
-
void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
-
void print_neuron_includes()
Print includes from NEURON.
-
void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
+
void print_net_event_call(const ast::FunctionCall &node) override
Print call to net_event.
+
void print_neuron_includes()
Print includes from NEURON.
+
void print_nrn_init(bool skip_init_check=true)
Print the nrn_init function definition.
bool optimize_ionvar_copies
Flag to indicate if visitor should avoid ion variable copies.
-
std::string internal_method_arguments() override
Arguments for functions that are defined and used internally.
+
std::string internal_method_arguments() override
Arguments for functions that are defined and used internally.
std::shared_ptr< symtab::Symbol > SymbolType
-
void print_nrn_alloc() override
Print nrn_alloc function definition.
-
std::string register_mechanism_arguments() const override
Arguments for register_mech or point_register_mech function.
+
void print_nrn_alloc() override
Print nrn_alloc function definition.
+
std::string register_mechanism_arguments() const override
Arguments for register_mech or point_register_mech function.
int position_of_int_var(const std::string &name) const override
Determine the position in the data array for a given int variable.
-
ParamVector internal_method_parameters() override
Parameters for internally defined functions.
+
bool optimize_ion_variable_copies() const override
Check if ion variable copies should be avoided.
+
ParamVector internal_method_parameters() override
Parameters for internally defined functions.
encapsulates code generation backend implementations
Definition: ast_common.hpp:26
-
std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
Determine the variable name for a global variable given its symbol.
-
std::string nrn_thread_internal_arguments() override
Arguments for "_threadargs_" macro in neuron implementation.
+
@ index
index / int variables
+
std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
Determine the variable name for a global variable given its symbol.
+
std::string nrn_thread_internal_arguments() override
Arguments for "_threadargs_" macro in neuron implementation.
Implement classes for representing symbol table at block and file scope.
virtual std::string backend_name() const override
Name of the code generation backend.
-
std::string process_verbatim_text(std::string const &text) override
Process a verbatim block for possible variable renaming.
-
void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
-
virtual void visit_watch_statement(const ast::WatchStatement &node) override
TODO: Edit for NEURON.
-
void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
-
void print_namespace_end() override
Print end of namespaces.
-
void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
-
CodegenNeuronCppVisitor(std::string mod_filename, std::ostream &stream, std::string float_type, const bool optimize_ionvar_copies)
Visitor for printing C++ code compatible with legacy api of NEURON
-
void print_nrn_state() override
Print nrn_state / state update function definition.
+
std::string process_verbatim_text(std::string const &text) override
Process a verbatim block for possible variable renaming.
+
void print_g_unused() const override
Set g_unused (conductance) for NRN_PRCELLSTATE feature.
+
virtual void visit_watch_statement(const ast::WatchStatement &node) override
TODO: Edit for NEURON.
+
void print_net_send_call(const ast::FunctionCall &node) override
Print call to net_send.
+
void print_namespace_end() override
Print end of namespaces.
+
void print_net_move_call(const ast::FunctionCall &node) override
Print call to net_move.
+
CodegenNeuronCppVisitor(std::string mod_filename, std::ostream &stream, std::string float_type, const bool optimize_ionvar_copies)
Visitor for printing C++ code compatible with legacy api of NEURON
+
void print_nrn_state() override
Print nrn_state / state update function definition.
const char * default_float_data_type() const noexcept
Default data type for floating point elements.
-
void print_initial_block(const ast::InitialBlock *node)
Print the initial block.
-
virtual void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
-
std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
Determine the name of a float variable given its symbol.
-
void print_function(const ast::FunctionBlock &node) override
Print NMODL function in target backend code.
-
void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
+
void print_initial_block(const ast::InitialBlock *node)
Print the initial block.
+
virtual void print_global_function_common_code(BlockType type, const std::string &function_name="") override
Print common code for global functions like nrn_init, nrn_cur and nrn_state.
+
std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
Determine the name of a float variable given its symbol.
+
void print_function(const ast::FunctionBlock &node) override
Print NMODL function in target backend code.
+
void print_v_unused() const override
Set v_unused (voltage) for NRN_PRCELLSTATE feature.
Visitor for printing C++ code compatible with legacy api of CoreNEURON
Base class for all block scoped nodes.
Definition: block.hpp:41
Represents a INITIAL block in the NMODL.
Represent WATCH statement in NMODL.
-
void print_function_declaration(const T &node, const std::string &name)
Print prototype declarations of functions or procedures.
+
void print_function_declaration(const T &node, const std::string &name)
Print prototype declarations of functions or procedures.
Represents a BREAKPOINT block in NMODL.
-
void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
-
std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
Determine the name of an int variable given its symbol.
-
void print_namespace_begin() override
Print start of namespaces.
+
void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
Print the nrn_cur kernel with NMODL conductance keyword provisions.
+
std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
Determine the name of an int variable given its symbol.
+
void print_namespace_begin() override
Print start of namespaces.
-
void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
-
void print_standard_includes() override
Print standard C/C++ includes.
-
void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
-
virtual void print_procedure(const ast::ProcedureBlock &node) override
Print NMODL procedure in target backend code.
+
void print_global_variables_for_hoc() override
Print byte arrays that register scalar and vector variables for hoc interface.
+
void print_standard_includes() override
Print standard C/C++ includes.
+
void print_mechanism_range_var_structure(bool print_initializers) override
Print the structure that wraps all range and int variables required for the NMODL.
+
virtual void print_procedure(const ast::ProcedureBlock &node) override
Print NMODL procedure in target backend code.
Helper class for printing C/C++ code.
-
void print_namespace_start() override
Prints the start of the neuron namespace.
-
void print_backend_info() override
Print top file header printed in generated code.
-
virtual void print_compute_functions() override
Print all compute functions for every backend.
-
void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
-
void print_mechanism_register() override
Print the mechanism registration function.
-
void print_nrn_jacob()
Print nrn_jacob function definition.
+
void print_namespace_start() override
Prints the start of the neuron namespace.
+
void print_backend_info() override
Print top file header printed in generated code.
+
virtual void print_compute_functions() override
Print all compute functions for every backend.
+
void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
Print main body of nrn_cur function.
+
std::string conc_write_statement(const std::string &ion_name, const std::string &concentration, int index) override
Generate Function call statement for nrn_wrote_conc.
+
void print_mechanism_register() override
Print the mechanism registration function.
+
void print_nrn_jacob()
Print nrn_jacob function definition.
Various types to store code generation specific information.
-
virtual void print_fast_imem_calculation() override
Print fast membrane current calculation code.
-
void print_data_structures(bool print_initializers) override
Print all classes.
-
void print_sdlists_init(bool print_initializers) override
-
static std::string get_parameter_str(const ParamVector &params)
Generate the string representing the procedure parameter declaration.
-
void print_make_instance() const
Print make_*_instance.
+
virtual void print_fast_imem_calculation() override
Print fast membrane current calculation code.
+
void print_data_structures(bool print_initializers) override
Print all classes.
+
void print_sdlists_init(bool print_initializers) override
+
static std::string get_parameter_str(const ParamVector &params)
Generate the string representing the procedure parameter declaration.
+
void print_make_instance() const
Print make_*_instance.
virtual void print_atomic_reduction_pragma() override
Print atomic update pragma for reduction statements.
-
void print_namespace_stop() override
Prints the end of the neuron namespace.
+
void print_namespace_stop() override
Prints the end of the neuron namespace.
-
void print_mechanism_variables_macros()
Print mechanism variables' related macros.
+
void print_mechanism_variables_macros()
Print mechanism variables' related macros.
Visitor for printing C++ code compatible with legacy api of NEURON
std::string float_type
Data type of floating point variables.
-
void print_nrn_constructor() override
Print nrn_constructor function definition.
+
void print_nrn_constructor() override
Print nrn_constructor function definition.
Implement logger based on spdlog library.
bool enable_variable_name_lookup
Variable name should be converted to instance name (but not for function arguments)
BlockType
Helper to represent various block types.
-
void print_function_or_procedure(const ast::Block &node, const std::string &name) override
Print nmodl function or procedure (common code)
-
void print_headers_include() override
Print all includes.
-
void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
+
void print_function_or_procedure(const ast::Block &node, const std::string &name) override
Print nmodl function or procedure (common code)
+
void print_headers_include() override
Print all includes.
+
void print_nrn_current(const ast::BreakpointBlock &node) override
Print the nrn_current kernel.
int position_of_float_var(const std::string &name) const override
Determine the position in the data array for a given float variable.
-
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
+
std::string get_variable_name(const std::string &name, bool use_instance=true) const override
Determine variable name in the structure of mechanism properties.
Visitor for printing C++ code compatible with legacy api of CoreNEURON
std::string mod_filename
Name of mod file (without .mod suffix)
std::string simulator_name() override
Name of the simulator the code was generated for.
-
void print_function_procedure_helper(const ast::Block &node) override
Common helper function to help printing function or procedure blocks.
+
void print_function_procedure_helper(const ast::Block &node) override
Common helper function to help printing function or procedure blocks.
std::unique_ptr< CodePrinter > printer
Code printer object for target (C++)
-
const char * external_method_arguments() noexcept override
Arguments for external functions called from generated code.
-
std::string method_name(const std::string &name) const
Constructs the name of a function or procedure.
-
std::string nrn_thread_arguments() const override
Arguments for "_threadargs_" macro in neuron implementation.
-
void print_codegen_routines() override
Print entry point to code generation.
-
CodegenNeuronCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies)
Constructs the C++ code generator visitor.
-
void print_function_prototypes() override
Print function and procedures prototype declaration.
-
void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
-
void print_global_macros()
Print NEURON global variable macros.
+
const char * external_method_arguments() noexcept override
Arguments for external functions called from generated code.
+
std::string method_name(const std::string &name) const
Constructs the name of a function or procedure.
+
std::string nrn_thread_arguments() const override
Arguments for "_threadargs_" macro in neuron implementation.
+
void print_codegen_routines() override
Print entry point to code generation.
+
CodegenNeuronCppVisitor(std::string mod_filename, const std::string &output_dir, std::string float_type, const bool optimize_ionvar_copies)
Constructs the C++ code generator visitor.
+
void print_function_prototypes() override
Print function and procedures prototype declaration.
+
void print_mechanism_global_var_structure(bool print_initializers) override
Print the structure that wraps all global variables used in the NMODL.
+
void print_global_macros()
Print NEURON global variable macros.
std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
A vector of parameters represented by a 4-tuple of strings:
Concrete visitor for all AST classes.
diff --git a/html/doxygen/functions_b.html b/html/doxygen/functions_b.html index ee980c3f98..4ede7cb87f 100644 --- a/html/doxygen/functions_b.html +++ b/html/doxygen/functions_b.html @@ -177,7 +177,7 @@

- b -

    : nmodl::ast::Boolean
  • breakpoint_current() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
  • breakpoint_exist() : nmodl::codegen::CodegenCppVisitor diff --git a/html/doxygen/functions_c.html b/html/doxygen/functions_c.html index 7b40476d76..4ebf8a84c2 100644 --- a/html/doxygen/functions_c.html +++ b/html/doxygen/functions_c.html @@ -318,7 +318,7 @@

    - c -

      : nmodl::codegen::CodegenHelperVisitor
    • CodegenNeuronCppVisitor() -: nmodl::codegen::CodegenNeuronCppVisitor +: nmodl::codegen::CodegenNeuronCppVisitor
    • CodegenTransformVisitor() : nmodl::CodegenTransformVisitor @@ -338,7 +338,7 @@

      - c -

        , nmodl::visitor::PerfVisitor
      • Compartment() -: nmodl::ast::Compartment +: nmodl::ast::Compartment
      • compartment_factors : nmodl::visitor::KineticBlockVisitor @@ -347,7 +347,9 @@

        - c -

          : nmodl::codegen::CodegenCppVisitor
        • conc_write_statement() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCoreneuronCppVisitor +, nmodl::codegen::CodegenCppVisitor +, nmodl::codegen::CodegenNeuronCppVisitor
        • condition : nmodl::ast::ElseIfStatement @@ -367,7 +369,7 @@

          - c -

            : nmodl::codegen::CodegenInfo
          • Conserve() -: nmodl::ast::Conserve +: nmodl::ast::Conserve
          • conserve_equation : nmodl::visitor::SympySolverVisitor @@ -397,16 +399,16 @@

            - c -

              : nmodl::codegen::CodegenInfo
            • ConstantBlock() -: nmodl::ast::ConstantBlock +: nmodl::ast::ConstantBlock
            • ConstantFolderVisitor() : nmodl::visitor::ConstantFolderVisitor
            • ConstantStatement() -: nmodl::ast::ConstantStatement +: nmodl::ast::ConstantStatement
            • ConstantVar() -: nmodl::ast::ConstantVar +: nmodl::ast::ConstantVar
            • construct_eigen_solver_block() : nmodl::visitor::SympySolverVisitor diff --git a/html/doxygen/functions_func_b.html b/html/doxygen/functions_func_b.html index 7c68fe29b2..2b5501e6c0 100644 --- a/html/doxygen/functions_func_b.html +++ b/html/doxygen/functions_func_b.html @@ -130,7 +130,7 @@

              - b -

                : nmodl::ast::Boolean
              • breakpoint_current() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
              • breakpoint_exist() : nmodl::codegen::CodegenCppVisitor diff --git a/html/doxygen/functions_func_c.html b/html/doxygen/functions_func_c.html index e1af6945ef..d909bc73e1 100644 --- a/html/doxygen/functions_func_c.html +++ b/html/doxygen/functions_func_c.html @@ -269,7 +269,7 @@

                - c -

                  : nmodl::parser::DiffeqDriver
                • CodegenAccVisitor() -: nmodl::codegen::CodegenAccVisitor +: nmodl::codegen::CodegenAccVisitor
                • CodegenCompatibilityVisitor() : nmodl::codegen::CodegenCompatibilityVisitor @@ -290,7 +290,7 @@

                  - c -

                    : nmodl::CodegenTransformVisitor
                  • CodePrinter() -: nmodl::printer::CodePrinter +: nmodl::printer::CodePrinter
                  • compact_json() : nmodl::printer::JSONPrinter @@ -298,22 +298,24 @@

                    - c -

                      , nmodl::visitor::PerfVisitor
                    • Compartment() -: nmodl::ast::Compartment +: nmodl::ast::Compartment
                    • compute_method_name() : nmodl::codegen::CodegenCppVisitor
                    • conc_write_statement() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCoreneuronCppVisitor +, nmodl::codegen::CodegenCppVisitor +, nmodl::codegen::CodegenNeuronCppVisitor
                    • conditional_block_eval() : nmodl::visitor::DUInstance
                    • ConductanceHint() -: nmodl::ast::ConductanceHint +: nmodl::ast::ConductanceHint
                    • Conserve() -: nmodl::ast::Conserve +: nmodl::ast::Conserve
                    • ConstantBlock() : nmodl::ast::ConstantBlock @@ -322,16 +324,16 @@

                      - c -

                        : nmodl::visitor::ConstantFolderVisitor
                      • ConstantStatement() -: nmodl::ast::ConstantStatement +: nmodl::ast::ConstantStatement
                      • ConstantVar() -: nmodl::ast::ConstantVar +: nmodl::ast::ConstantVar
                      • construct_eigen_solver_block() : nmodl::visitor::SympySolverVisitor
                      • ConstructorBlock() -: nmodl::ast::ConstructorBlock +: nmodl::ast::ConstructorBlock
                      • count_variables() : nmodl::visitor::PerfVisitor diff --git a/html/doxygen/functions_func_i.html b/html/doxygen/functions_func_i.html index 80f74e1a67..8a18c62275 100644 --- a/html/doxygen/functions_func_i.html +++ b/html/doxygen/functions_func_i.html @@ -214,16 +214,16 @@

                        - i -

                          : nmodl::codegen::CodegenInfo
                        • ion_read_statements() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                        • ion_read_statements_optimized() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                        • ion_variable_struct_required() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                        • ion_write_statements() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                        • is_after_block() : nmodl::ast::AfterBlock diff --git a/html/doxygen/functions_func_o.html b/html/doxygen/functions_func_o.html index 38aa6278e4..7cd95ed6a6 100644 --- a/html/doxygen/functions_func_o.html +++ b/html/doxygen/functions_func_o.html @@ -114,7 +114,9 @@

                          - o -

                          diff --git a/html/doxygen/functions_func_p.html b/html/doxygen/functions_func_p.html index 93a8e43eb7..746927b272 100644 --- a/html/doxygen/functions_func_p.html +++ b/html/doxygen/functions_func_p.html @@ -673,7 +673,7 @@

                          - p -

                            : nmodl::visitor::KineticBlockVisitor
                          • process_shadow_update_statement() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                          • process_variable() : nmodl::visitor::DefUseAnalyzeVisitor diff --git a/html/doxygen/functions_func_r.html b/html/doxygen/functions_func_r.html index 8181463395..683dd1600d 100644 --- a/html/doxygen/functions_func_r.html +++ b/html/doxygen/functions_func_r.html @@ -124,7 +124,7 @@

                            - r -

                              : nmodl::symtab::Symbol
                            • read_ion_variable_name() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                            • ReadIonVar() : nmodl::ast::ReadIonVar diff --git a/html/doxygen/functions_func_u.html b/html/doxygen/functions_func_u.html index f5d3fcf3dd..8c6367f86f 100644 --- a/html/doxygen/functions_func_u.html +++ b/html/doxygen/functions_func_u.html @@ -134,7 +134,7 @@

                              - u -

                                : nmodl::visitor::DefUseAnalyzeVisitor
                              • update_if_ion_variable_name() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                              • update_index_semantics() : nmodl::codegen::CodegenCppVisitor diff --git a/html/doxygen/functions_func_w.html b/html/doxygen/functions_func_w.html index 49a351bc83..99bae5a357 100644 --- a/html/doxygen/functions_func_w.html +++ b/html/doxygen/functions_func_w.html @@ -110,7 +110,7 @@

                                - w -

                                  , nmodl::visitor::JSONVisitor
                                • write_ion_variable_name() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                                • WriteIonVar() : nmodl::ast::WriteIonVar diff --git a/html/doxygen/functions_i.html b/html/doxygen/functions_i.html index 5a0722fa60..1cf73d6ade 100644 --- a/html/doxygen/functions_i.html +++ b/html/doxygen/functions_i.html @@ -309,16 +309,16 @@

                                  - i -

                                    : nmodl::visitor::VerbatimVarRenameVisitor
                                  • ion_read_statements() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                                  • ion_read_statements_optimized() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                                  • ion_variable_struct_required() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                                  • ion_write_statements() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                                  • ions : nmodl::codegen::CodegenInfo diff --git a/html/doxygen/functions_o.html b/html/doxygen/functions_o.html index cb4c333dff..9bc9458bb7 100644 --- a/html/doxygen/functions_o.html +++ b/html/doxygen/functions_o.html @@ -145,7 +145,9 @@

                                    - o -

                                      : nmodl::codegen::CodegenCppVisitor
                                    • optimize_ion_variable_copies() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCoreneuronCppVisitor +, nmodl::codegen::CodegenCppVisitor +, nmodl::codegen::CodegenNeuronCppVisitor
                                    • optimize_ionvar_copies : nmodl::codegen::CodegenCppVisitor diff --git a/html/doxygen/functions_p.html b/html/doxygen/functions_p.html index c33f992663..c39a32ef3d 100644 --- a/html/doxygen/functions_p.html +++ b/html/doxygen/functions_p.html @@ -747,7 +747,7 @@

                                      - p -

                                        : nmodl::visitor::KineticBlockVisitor
                                      • process_shadow_update_statement() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                                      • process_variable() : nmodl::visitor::DefUseAnalyzeVisitor diff --git a/html/doxygen/functions_r.html b/html/doxygen/functions_r.html index 4a502a42a6..cb157f02b8 100644 --- a/html/doxygen/functions_r.html +++ b/html/doxygen/functions_r.html @@ -157,7 +157,7 @@

                                        - r -

                                          : nmodl::symtab::Symbol
                                        • read_ion_variable_name() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                                        • ReadIonVar() : nmodl::ast::ReadIonVar diff --git a/html/doxygen/functions_u.html b/html/doxygen/functions_u.html index dc8290657f..afff2ffe97 100644 --- a/html/doxygen/functions_u.html +++ b/html/doxygen/functions_u.html @@ -202,7 +202,7 @@

                                          - u -

                                            : nmodl::visitor::DefUseAnalyzeVisitor
                                          • update_if_ion_variable_name() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                                          • update_index_semantics() : nmodl::codegen::CodegenCppVisitor diff --git a/html/doxygen/functions_w.html b/html/doxygen/functions_w.html index ac52900bd5..470e9edf71 100644 --- a/html/doxygen/functions_w.html +++ b/html/doxygen/functions_w.html @@ -128,7 +128,7 @@

                                            - w -

                                              : nmodl::symtab::Symbol
                                            • write_ion_variable_name() -: nmodl::codegen::CodegenCoreneuronCppVisitor +: nmodl::codegen::CodegenCppVisitor
                                            • WriteIonVar() : nmodl::ast::WriteIonVar diff --git a/html/doxygen/group__codegen__backends.html b/html/doxygen/group__codegen__backends.html index 08d35ef3e8..e155d387ff 100644 --- a/html/doxygen/group__codegen__backends.html +++ b/html/doxygen/group__codegen__backends.html @@ -191,7 +191,7 @@

                                              Definition at line 648 of file codegen_neuron_cpp_visitor.hpp.

                                              +

                                              Definition at line 656 of file codegen_neuron_cpp_visitor.hpp.

                                              @@ -247,7 +247,7 @@

                                              Definition at line 1255 of file codegen_coreneuron_cpp_visitor.hpp.

                                              +

                                              Definition at line 1174 of file codegen_coreneuron_cpp_visitor.hpp.

                                              @@ -310,7 +310,7 @@

                                              Definition at line 1213 of file codegen_cpp_visitor.hpp.

                                              +

                                              Definition at line 1314 of file codegen_cpp_visitor.hpp.

                                              diff --git a/html/doxygen/group__codegen__backends.js b/html/doxygen/group__codegen__backends.js index 17fd268a1f..8e4513d47c 100644 --- a/html/doxygen/group__codegen__backends.js +++ b/html/doxygen/group__codegen__backends.js @@ -51,9 +51,8 @@ var group__codegen__backends = [ "CodegenCoreneuronCppVisitor", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad1816124976f0e4697006bfc2b6378d7", null ], [ "CodegenCoreneuronCppVisitor", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6cd894c71733fbdc58ea828ad035976f", null ], [ "backend_name", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#acfddae56ef5e91b7394b6f4c91748698", null ], - [ "breakpoint_current", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a40430cd5a36ba2b612adc095952d50a9", null ], [ "check_if_var_is_array", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a293512e33ee9a6a4585664e73e5897ed", null ], - [ "conc_write_statement", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a805dff5f277ea3b3536a553818fb917a", null ], + [ "conc_write_statement", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a542c802c8bea31d9a7702831eb385633", null ], [ "external_method_arguments", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ada7cc9156da44d1e34fd0e0ca42032ec", null ], [ "external_method_parameters", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adabf97eae5508fe69a5298c9ce6b627d", null ], [ "float_variable_name", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a18e0834ef774dd2bb5e5adc4ff2df5ae", null ], @@ -63,10 +62,6 @@ var group__codegen__backends = [ "int_variable_name", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a328753b743f89bbdf4123c462d63ba0c", null ], [ "internal_method_arguments", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7d14e3cc08441dc6b3bd64f0ca0a13ba", null ], [ "internal_method_parameters", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af48766525e3a1c8f88471a9338ae59e7", null ], - [ "ion_read_statements", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2ff6b6d552739a604c1c9c19968dafb4", null ], - [ "ion_read_statements_optimized", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a43e3e9beeb7ca80989d361c917491e1e", null ], - [ "ion_variable_struct_required", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7089dc9d4bfda5791d6f95388a877c8b", null ], - [ "ion_write_statements", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0c07a4568bf732ccc7a6ec9b763bc71b", null ], [ "is_constant_variable", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a5d1ca0fcb615508f88c56b6d7a987419", null ], [ "is_functor_const", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2c93009c078b20b41517309c499f081f", null ], [ "net_receive_buffering_declaration", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a18c00e97466c3bf5a83f277ca48b0d95", null ], @@ -74,7 +69,7 @@ var group__codegen__backends = [ "nrn_thread_arguments", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a294fadf1935383379dd1002208363c71", null ], [ "nrn_thread_internal_arguments", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4b959a2df6058dc1539d8f4f745b01ec", null ], [ "num_thread_objects", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a43b05a41af87606941c4dff097a5f7b9", null ], - [ "optimize_ion_variable_copies", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a58808da4cf7e64ffb1bcb5be20f977e3", null ], + [ "optimize_ion_variable_copies", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0620e76a8bf6864c3f4a38680f514158", null ], [ "position_of_float_var", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9494db3e1dfa2a390f133a9a8b5aa8e0", null ], [ "position_of_int_var", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aeada2d6cff883f8cbd1924f1d9729250", null ], [ "print_abort_routine", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab87a69ec67fe4d42df3cb0084c99dc85", null ], @@ -184,20 +179,16 @@ var group__codegen__backends = [ "print_v_unused", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aa00bfb7065e72ad3b287eb78c414bd8d", null ], [ "print_watch_activate", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8366981bc5ecb9b4d52af74865e16bb6", null ], [ "print_watch_check", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a3ea1bf8ef47090b926d8738d18306de7", null ], - [ "process_shadow_update_statement", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7b99884ba28c9b21c1ff40bb54ca20f5", null ], [ "process_verbatim_text", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a592905dcf5bb27083ec0a84f1ab29508", null ], [ "process_verbatim_token", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4ce5f8dd96c5a12646610da8e40de705", null ], - [ "read_ion_variable_name", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aeb4f46dc88633a2d367cda3aaa650e1e", null ], [ "register_mechanism_arguments", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af7e3a49a86646f3b69a3d387aa4116bb", null ], [ "replace_if_verbatim_variable", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a950d9144e4f19333c602cfff78810d1b", null ], [ "simulator_name", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab13ca7a0bef674739095466ff66f9843", null ], - [ "update_if_ion_variable_name", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a992c19b9aa26099d7d1954fe77107b0d", null ], [ "visit_derivimplicit_callback", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a97acfbb75ee033066beb784570ad4a04", null ], [ "visit_eigen_linear_solver_block", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afa72e4268acf4beee9e0297e7efa9f3f", null ], [ "visit_eigen_newton_solver_block", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a06aa792160b4f021f66b58a21d3a296c", null ], [ "visit_for_netcon", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a524be3f8fa4165f983647ed8ebbb9f01", null ], - [ "visit_watch_statement", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8d05784b3300be188775cf2ec9958dc6", null ], - [ "write_ion_variable_name", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4c6c17a2eeafae316e104bf5722337fa", null ] + [ "visit_watch_statement", "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8d05784b3300be188775cf2ec9958dc6", null ] ] ], [ "CodegenCppVisitor", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html", [ [ "ParamVector", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a73d001ad3c271c56d89e09e2cebfceb3", null ], @@ -206,8 +197,10 @@ var group__codegen__backends = [ "CodegenCppVisitor", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a18359d1914ead9e3f6ddfa77ea99bab3", null ], [ "add_escape_quote", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aeeacd28215827d6b0cd23cf59e5fc0c2", null ], [ "backend_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a30af017ff0f7101ed71d9b43e56031ca", null ], + [ "breakpoint_current", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aada5b6eeb7fd6f21a4ce2c68da1e2994", null ], [ "breakpoint_exist", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a578f6c60b4ca495b24e5b7ae2db448cc", null ], [ "compute_method_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae022e99573f663fc0db935c5c1bb7199", null ], + [ "conc_write_statement", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae29a1c321357b464d7a67ee4fbfabfe3", null ], [ "default_float_data_type", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#afba5ac1d4636d7ba57ac3fd7c7b5e2ba", null ], [ "default_int_data_type", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a199a281ca182a40a40331fa29e45828a", null ], [ "defined_method", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2f6825fbb587362e1ed38f03e3b97d86", null ], @@ -232,6 +225,10 @@ var group__codegen__backends = [ "int_variables_size", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aac1df493cd346d7faccb17ae5440ddc4", null ], [ "internal_method_arguments", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aeacff81944f23540968aa617d25e3d22", null ], [ "internal_method_parameters", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a32f908e88bbb1c5070b5e011f2955c07", null ], + [ "ion_read_statements", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d8c0140086b0f5284e1cf7c23632463", null ], + [ "ion_read_statements_optimized", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a26ad42be1c7c9a127b2d806d08e426a6", null ], + [ "ion_variable_struct_required", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6e25890e173635c92d41465a2ee4d3a2", null ], + [ "ion_write_statements", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2e2dd82a055dd830e8efc7f1dce03924", null ], [ "is_net_event", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a294f3c4467883beffdc0d6bea67e1741", null ], [ "is_net_move", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a7559257a5ad55a48d1221522838c5daf", null ], [ "is_net_send", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2ecbf452d80ce4914271469183e2e31c", null ], @@ -250,6 +247,7 @@ var group__codegen__backends = [ "nrn_thread_internal_arguments", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#abcf0d5623d10f929b40dd3fc0e8ad00a", null ], [ "operator_for_d", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2d7cffd628c745f2e7614ffab48f4346", null ], [ "operator_for_rhs", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d260fcee2ad4a83b36fc26adad5934d", null ], + [ "optimize_ion_variable_copies", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a81cded985b616728b55976bf7eca4488", null ], [ "position_of_float_var", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3ef901c89d40124058a0df268b4f8101", null ], [ "position_of_int_var", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aaa6dae67e44cbd29e86e10b270249bed", null ], [ "print_atomic_reduction_pragma", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a92bfb8a4daec705014f8e871fb0feacb", null ], @@ -297,13 +295,16 @@ var group__codegen__backends = [ "print_statement_block", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8b912ad6d9a4f6d8e4c1bb16f2c95fbf", null ], [ "print_v_unused", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a5d7d3326aaa9849977f0c203078f39e4", null ], [ "print_vector_elements", "group__codegen__backends.html#ga743bcd56c5822a14381fd87fe586ed6c", null ], + [ "process_shadow_update_statement", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aa539bb6033a8bcd87fc4eb279bad887a", null ], [ "process_verbatim_text", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac53419e9abc2d2f9b12acf10507e7954", null ], [ "range_variable_setup_required", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a1e105e4b89ba5652f46bb91e49c817eb", null ], + [ "read_ion_variable_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3ee489972d8827f03490337c96a74b43", null ], [ "register_mechanism_arguments", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aec3cef47cc3c1e5901b4ff401ce8e725", null ], [ "rename_function_arguments", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aef331b9ddcbd761f3aea6b457f83e88e", null ], [ "setup", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae333398890c61148ec60cb52c3d28c10", null ], [ "simulator_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8b8b75dcd53ae8e3a641f18cb00bee1d", null ], [ "statement_to_skip", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a789dae2310c3496443a8a51c26cc8b71", null ], + [ "update_if_ion_variable_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aba3a9521ace5f09f4d2263e4401b33ee", null ], [ "update_index_semantics", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae0d8d4e346e244c764911c0c64c2ac1c", null ], [ "visit_binary_expression", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae02024096ab4490b8a6215b3e59e6de0", null ], [ "visit_binary_operator", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a22b033ac5c8d3f09e96b814355fea17a", null ], @@ -334,6 +335,7 @@ var group__codegen__backends = [ "visit_var_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a4f2304d508e3d9645581004c676d94ca", null ], [ "visit_verbatim", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad283ce438acd2faea2bbb309251890a1", null ], [ "visit_while_statement", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad488bc63dac24ac7e5c29a1138172ed7", null ], + [ "write_ion_variable_name", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8c28e874826634125ad9b5f59511f445", null ], [ "codegen_float_variables", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae63ddf806884e983a264346f21794168", null ], [ "codegen_global_variables", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2a1e5337a20e3f1dad1d1dfbb89fbb1b", null ], [ "codegen_int_variables", "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a661794563709a984308164abcdd543ee", null ], @@ -354,6 +356,7 @@ var group__codegen__backends = [ "CodegenNeuronCppVisitor", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aef77df54b474011a077b79e3b9126433", null ], [ "CodegenNeuronCppVisitor", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8dc54bf1b8cfca4663fffa7fb5444975", null ], [ "backend_name", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a89c5a0f046f8752579636a3db97d669a", null ], + [ "conc_write_statement", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a593b6a70562ebbf42e13fea3b03d9174", null ], [ "external_method_arguments", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a14b770116ea7a9580c6d82d7a2bb1bc1", null ], [ "external_method_parameters", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a6e501a98cc559afd172f898fa0d7cef7", null ], [ "float_variable_name", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acfd3c1256b1d34de5fef97cff079cb8a", null ], @@ -364,6 +367,7 @@ var group__codegen__backends = [ "internal_method_parameters", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a68499754b87764b2eba30bf38a1edbb4", null ], [ "nrn_thread_arguments", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af6676bc4b255a87e484bc2641d64b713", null ], [ "nrn_thread_internal_arguments", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa08a55bc62e18a9c545e8903dd3b1530", null ], + [ "optimize_ion_variable_copies", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a70bd9cedc2fcae2e924ebcc59c7f728b", null ], [ "position_of_float_var", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#afdd6466ebac569ec670c3b6f4ca11d3e", null ], [ "position_of_int_var", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8c348f1869653cec3dcc39b1866bab97", null ], [ "print_atomic_reduction_pragma", "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a910f9f22e6fbdae4eefae177eb8910f9", null ], diff --git a/html/doxygen/namespacenmodl_1_1codegen.html b/html/doxygen/namespacenmodl_1_1codegen.html index 31f14da06a..fe887eaf96 100644 --- a/html/doxygen/namespacenmodl_1_1codegen.html +++ b/html/doxygen/namespacenmodl_1_1codegen.html @@ -220,7 +220,7 @@

                                              Definition at line 1873 of file codegen_coreneuron_cpp_visitor.cpp.

                                              +

                                              Definition at line 1682 of file codegen_coreneuron_cpp_visitor.cpp.

                                              @@ -248,7 +248,7 @@

                                              -

                                              Definition at line 548 of file codegen_coreneuron_cpp_visitor.cpp.

                                              +

                                              Definition at line 409 of file codegen_coreneuron_cpp_visitor.cpp.

                                              @@ -298,7 +298,7 @@

                                              (*R) = 1.0;

                                              So, the R in AST needs to be renamed with (*R).

                                              -

                                              Definition at line 2941 of file codegen_coreneuron_cpp_visitor.cpp.

                                              +

                                              Definition at line 2750 of file codegen_coreneuron_cpp_visitor.cpp.

                                              @@ -315,7 +315,7 @@

                                              -

                                              Definition at line 421 of file codegen_cpp_visitor.cpp.

                                              +

                                              Definition at line 610 of file codegen_cpp_visitor.cpp.

                                              diff --git a/html/doxygen/navtreedata.js b/html/doxygen/navtreedata.js index d190aee525..34576e29fc 100644 --- a/html/doxygen/navtreedata.js +++ b/html/doxygen/navtreedata.js @@ -79,24 +79,24 @@ var NAVTREEINDEX = "classnmodl_1_1ast_1_1_suffix.html#af8429d0c345eeee78b83c6192128d22f", "classnmodl_1_1ast_1_1_useion.html#a6eb5dbcfabf5259dbf15f0b099c5976e", "classnmodl_1_1codegen_1_1_codegen_acc_visitor.html#a4977b3b4e02425431c95412ffdad10ed", -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a661794563709a984308164abcdd543ee", -"classnmodl_1_1parser_1_1_nmodl_driver.html#a1d10f7ff97b79400f0b61fa7dafc4747", -"classnmodl_1_1symtab_1_1_symbol_table.html#af83af83491e382ea6f105e7e016a0980", -"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a71502a8e8dc90a7fd916bb791470d81e", -"classnmodl_1_1visitor_1_1_index_remover.html#a051448515c546d4c22f28e74934617b2", -"classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a24c183f78bb123d831712725847f5237", -"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#aed40e6b59c06924a3fd8a95a9f25c640", -"classnmodl_1_1visitor_1_1_symtab_visitor.html#a39816ee1bcf71b452a8b382b622f1024", -"classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a5b27f63b80d2e7f400f7b37b03740df8", -"defuse__analyze_8cpp.html#aac1ac0e30a6d6e0fffc0967c50be0df7", -"globals_j.html", -"group__ast__class.html#gad0fc98ce521337690e9715bbc8e52848", -"group__ast__vec__type.html#ga3b42311790865c9f4ed1cd963b36fc59", -"json_8cpp_source.html", -"nmodl__lexer_8hpp_source.html", -"string__utils_8hpp.html", -"structnmodl_1_1utils_1_1_perf_stat.html#a51b2949cf8cee86b90c8583998408239", -"test_2unit_2symtab_2symbol__table_8cpp.html#a3412b512c3ebac30608514f7d19c5b18" +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d8c0140086b0f5284e1cf7c23632463", +"classnmodl_1_1parser_1_1_nmodl_driver.html#a03e96357ac710ecceeec582aa176d742", +"classnmodl_1_1symtab_1_1_symbol_table.html#ae1ec2b128700c6eb7321f5a1a641d78f", +"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a6977ddcb3db50ad9fb2ce46faafa32f5", +"classnmodl_1_1visitor_1_1_global_to_range_visitor.html#a40121374fb9a41c948c5870d68aab965", +"classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a20252f5fcde8471e00b6fa37c578511a", +"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#ae44dfe3c414bbf79ace2f7f739d1e7ec", +"classnmodl_1_1visitor_1_1_symtab_visitor.html#a2e95eb8066068676d7880c2ec95fe0b4", +"classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a51fda27067b3c81bbcebc6b77ab97730", +"define_8hpp.html", +"globals_e.html", +"group__ast__class.html#gacd652af0b9dd48cd7fee5e26aa19ed71", +"group__ast__vec__type.html#ga3283450e34bd607f7811fe34f5bfba12", +"json_8cpp.html", +"nmodl__driver_8hpp_source.html", +"string_8hpp_source.html", +"structnmodl_1_1utils_1_1_perf_stat.html#a199d3a4ce658889efc3bce2c83e90505", +"test_2unit_2codegen_2main_8cpp_source.html" ]; var SYNCONMSG = 'click to disable panel synchronisation'; diff --git a/html/doxygen/navtreeindex15.js b/html/doxygen/navtreeindex15.js index 9856af8633..b0626d8a03 100644 --- a/html/doxygen/navtreeindex15.js +++ b/html/doxygen/navtreeindex15.js @@ -37,217 +37,217 @@ var NAVTREEINDEX15 = "classnmodl_1_1codegen_1_1_codegen_compatibility_visitor.html#ad9d74c011314b9b4e4bea2b5848ad1fd":[0,1,0,1,3], "classnmodl_1_1codegen_1_1_codegen_compatibility_visitor.html#af8f4da257ecc161c61cabda2eee0cc3e":[0,1,0,1,2], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html":[0,1,0,2], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a03811d5433b03bea89083de74b62c40f":[0,1,0,2,112], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a06aa792160b4f021f66b58a21d3a296c":[0,1,0,2,146], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0ae3f3e58ed5748189ac482eabac295b":[0,1,0,2,76], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0c07a4568bf732ccc7a6ec9b763bc71b":[0,1,0,2,18], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0dfee548a568667a78d0ab729131d6c2":[0,1,0,2,43], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0eb6eb4f68afb0711caa99a0f9ee85d4":[0,1,0,2,130], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a151c9e289cdc4df282ed47b1f72ecc6e":[0,1,0,2,61], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a16415780703b2653d6e4c29dba3ee7f9":[0,1,0,2,66], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a18c00e97466c3bf5a83f277ca48b0d95":[0,1,0,2,21], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a18e0834ef774dd2bb5e5adc4ff2df5ae":[0,1,0,2,8], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1b309a0bd2939736aadba430634ce52d":[0,1,0,2,9], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1b43c39d762c18b8457ba45496726e24":[0,1,0,2,108], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1bd7222586890e03588e16f640f0bcbf":[0,1,0,2,98], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1ca2f8a251f296a1fde805928739be41":[0,1,0,2,114], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1e15a71e22ad32b958dd83b1df5d10fb":[0,1,0,2,22], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1edece0e83918dd7384d0bbe406bf9e7":[0,1,0,2,72], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a213e98f7c1ff3a0b9f07a6f3f3af3ee3":[0,1,0,2,104], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a227edd197659a7ae89b0beba807a4f54":[0,1,0,2,40], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24a315e64fe859e57c3fe8187c23c137":[0,1,0,2,123], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24ec8383532b4cab19cafd75554a7119":[0,1,0,2,69], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24f47375affd9cc7195d83f026fc2ab8":[0,1,0,2,110], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a25d775a02a44f3e45f3b8a661249c5e8":[0,1,0,2,103], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a293512e33ee9a6a4585664e73e5897ed":[0,1,0,2,4], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a294fadf1935383379dd1002208363c71":[0,1,0,2,23], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2973dd8bba370083e1bfe449a70359ee":[0,1,0,2,62], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2998645f8c5bf76da0389299d033afe0":[0,1,0,2,119], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2c93009c078b20b41517309c499f081f":[0,1,0,2,20], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2e6460f6c8b0f6a0ae0732a5a0a15c45":[0,1,0,2,36], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2ff6b6d552739a604c1c9c19968dafb4":[0,1,0,2,15], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a30c0625de66788948965e8e6b1d6ff1c":[0,1,0,2,78], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a328753b743f89bbdf4123c462d63ba0c":[0,1,0,2,12], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a3516dd7938db6a28e1d5668a9c4aca25":[0,1,0,2,93], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a38c76390b1d1c0a5cf1fe8df3f27fb57":[0,1,0,2,120], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a3ea1bf8ef47090b926d8738d18306de7":[0,1,0,2,135], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a3fb561fbaba6ab77da1d69e531eac7d5":[0,1,0,2,63], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a40430cd5a36ba2b612adc095952d50a9":[0,1,0,2,3], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a421dd82c2f3762ff97fb4d0d646c1565":[0,1,0,2,84], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a43b05a41af87606941c4dff097a5f7b9":[0,1,0,2,25], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a43e3e9beeb7ca80989d361c917491e1e":[0,1,0,2,16], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a45b1dc5e371bf956e045d40f19b2470c":[0,1,0,2,37], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a47aa1e9e08042a9c2bc4c5a0773fdf53":[0,1,0,2,87], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a48e4c785bbae026d24044736fd6913c2":[0,1,0,2,94], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a498d36eb5344aa9689b514adeb57aefd":[0,1,0,2,71], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4b959a2df6058dc1539d8f4f745b01ec":[0,1,0,2,24], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4c165609255c0fe51ba8af7684890d1e":[0,1,0,2,127], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4c3349dba0cee6135e099e042936adac":[0,1,0,2,41], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4c6c17a2eeafae316e104bf5722337fa":[0,1,0,2,149], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4ce5f8dd96c5a12646610da8e40de705":[0,1,0,2,138], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4d163cf837717e6f1bac43c1a492f456":[0,1,0,2,107], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4dd6948c9064a446dc45cf6f4d463975":[0,1,0,2,57], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4f3cf2cc2726db4de8edd19ef660f52b":[0,1,0,2,90], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a524be3f8fa4165f983647ed8ebbb9f01":[0,1,0,2,147], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a58808da4cf7e64ffb1bcb5be20f977e3":[0,1,0,2,26], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a58cf39050c85f0c1450d16c1fb87ebab":[0,1,0,2,32], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a592905dcf5bb27083ec0a84f1ab29508":[0,1,0,2,137], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a5b5df9be580baa41acf1e32b177ca2f7":[0,1,0,2,77], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a5be32556e7bb7fd48b1bdb71d75fe5bb":[0,1,0,2,56], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a5d1ca0fcb615508f88c56b6d7a987419":[0,1,0,2,19], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a60f89c589e7bde18fcb7dfcdd62160ef":[0,1,0,2,74], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6228949e87b0a9e14fe6886fc346e28c":[0,1,0,2,50], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6291f96c056104b3b3c7a7a2ea0a7f13":[0,1,0,2,59], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6498ebb631852d55d7585ef179b3008e":[0,1,0,2,51], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a656859e8b2ce968ed39db6e966c2338f":[0,1,0,2,91], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a65d00673a1f7d24ba66b6730593da402":[0,1,0,2,85], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a66833aede8ecc336b85129ca1e8b8b2e":[0,1,0,2,30], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6aacd1083b5929ad28f227d20a412b4e":[0,1,0,2,100], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a03811d5433b03bea89083de74b62c40f":[0,1,0,2,107], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0620e76a8bf6864c3f4a38680f514158":[0,1,0,2,21], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a06aa792160b4f021f66b58a21d3a296c":[0,1,0,2,138], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0ae3f3e58ed5748189ac482eabac295b":[0,1,0,2,71], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0dfee548a568667a78d0ab729131d6c2":[0,1,0,2,38], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0eb6eb4f68afb0711caa99a0f9ee85d4":[0,1,0,2,125], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a151c9e289cdc4df282ed47b1f72ecc6e":[0,1,0,2,56], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a16415780703b2653d6e4c29dba3ee7f9":[0,1,0,2,61], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a18c00e97466c3bf5a83f277ca48b0d95":[0,1,0,2,16], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a18e0834ef774dd2bb5e5adc4ff2df5ae":[0,1,0,2,7], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1b309a0bd2939736aadba430634ce52d":[0,1,0,2,8], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1b43c39d762c18b8457ba45496726e24":[0,1,0,2,103], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1bd7222586890e03588e16f640f0bcbf":[0,1,0,2,93], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1ca2f8a251f296a1fde805928739be41":[0,1,0,2,109], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1e15a71e22ad32b958dd83b1df5d10fb":[0,1,0,2,17], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a1edece0e83918dd7384d0bbe406bf9e7":[0,1,0,2,67], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a213e98f7c1ff3a0b9f07a6f3f3af3ee3":[0,1,0,2,99], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a227edd197659a7ae89b0beba807a4f54":[0,1,0,2,35], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24a315e64fe859e57c3fe8187c23c137":[0,1,0,2,118], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24ec8383532b4cab19cafd75554a7119":[0,1,0,2,64], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a24f47375affd9cc7195d83f026fc2ab8":[0,1,0,2,105], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a25d775a02a44f3e45f3b8a661249c5e8":[0,1,0,2,98], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a293512e33ee9a6a4585664e73e5897ed":[0,1,0,2,3], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a294fadf1935383379dd1002208363c71":[0,1,0,2,18], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2973dd8bba370083e1bfe449a70359ee":[0,1,0,2,57], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2998645f8c5bf76da0389299d033afe0":[0,1,0,2,114], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2c93009c078b20b41517309c499f081f":[0,1,0,2,15], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2e6460f6c8b0f6a0ae0732a5a0a15c45":[0,1,0,2,31], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a30c0625de66788948965e8e6b1d6ff1c":[0,1,0,2,73], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a328753b743f89bbdf4123c462d63ba0c":[0,1,0,2,11], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a3516dd7938db6a28e1d5668a9c4aca25":[0,1,0,2,88], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a38c76390b1d1c0a5cf1fe8df3f27fb57":[0,1,0,2,115], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a3ea1bf8ef47090b926d8738d18306de7":[0,1,0,2,130], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a3fb561fbaba6ab77da1d69e531eac7d5":[0,1,0,2,58], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a421dd82c2f3762ff97fb4d0d646c1565":[0,1,0,2,79], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a43b05a41af87606941c4dff097a5f7b9":[0,1,0,2,20], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a45b1dc5e371bf956e045d40f19b2470c":[0,1,0,2,32], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a47aa1e9e08042a9c2bc4c5a0773fdf53":[0,1,0,2,82], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a48e4c785bbae026d24044736fd6913c2":[0,1,0,2,89], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a498d36eb5344aa9689b514adeb57aefd":[0,1,0,2,66], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4b959a2df6058dc1539d8f4f745b01ec":[0,1,0,2,19], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4c165609255c0fe51ba8af7684890d1e":[0,1,0,2,122], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4c3349dba0cee6135e099e042936adac":[0,1,0,2,36], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4ce5f8dd96c5a12646610da8e40de705":[0,1,0,2,132], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4d163cf837717e6f1bac43c1a492f456":[0,1,0,2,102], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4dd6948c9064a446dc45cf6f4d463975":[0,1,0,2,52], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4f3cf2cc2726db4de8edd19ef660f52b":[0,1,0,2,85], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a524be3f8fa4165f983647ed8ebbb9f01":[0,1,0,2,139], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a542c802c8bea31d9a7702831eb385633":[0,1,0,2,4], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a58cf39050c85f0c1450d16c1fb87ebab":[0,1,0,2,27], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a592905dcf5bb27083ec0a84f1ab29508":[0,1,0,2,131], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a5b5df9be580baa41acf1e32b177ca2f7":[0,1,0,2,72], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a5be32556e7bb7fd48b1bdb71d75fe5bb":[0,1,0,2,51], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a5d1ca0fcb615508f88c56b6d7a987419":[0,1,0,2,14], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a60f89c589e7bde18fcb7dfcdd62160ef":[0,1,0,2,69], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6228949e87b0a9e14fe6886fc346e28c":[0,1,0,2,45], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6291f96c056104b3b3c7a7a2ea0a7f13":[0,1,0,2,54], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6498ebb631852d55d7585ef179b3008e":[0,1,0,2,46], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a656859e8b2ce968ed39db6e966c2338f":[0,1,0,2,86], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a65d00673a1f7d24ba66b6730593da402":[0,1,0,2,80], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a66833aede8ecc336b85129ca1e8b8b2e":[0,1,0,2,25], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6aacd1083b5929ad28f227d20a412b4e":[0,1,0,2,95], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6cd894c71733fbdc58ea828ad035976f":[0,1,0,2,1], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6f5682b33a0230cf3a068290df144831":[0,1,0,2,67], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6ffa9eb4970b25948f6e971d8af7208e":[0,1,0,2,121], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7089dc9d4bfda5791d6f95388a877c8b":[0,1,0,2,17], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a798b58891191750906359b1f097bca05":[0,1,0,2,118], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7b99884ba28c9b21c1ff40bb54ca20f5":[0,1,0,2,136], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7bc87ceb8b4772c3e407ce79883bc368":[0,1,0,2,75], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7be1a9429e5200afb286bbc3b4e4ba13":[0,1,0,2,105], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7d14e3cc08441dc6b3bd64f0ca0a13ba":[0,1,0,2,13], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a805dff5f277ea3b3536a553818fb917a":[0,1,0,2,5], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8366981bc5ecb9b4d52af74865e16bb6":[0,1,0,2,134], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a88faa4c78d1652d9eecea6a9583d4f77":[0,1,0,2,46], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8baaf5567ede31aa84237b45e9a2ec5f":[0,1,0,2,80], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8c25ecae06f5de662111c25a57501ad8":[0,1,0,2,116], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8ced8ed7909fe1536bdef83de1922d42":[0,1,0,2,124], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8d05784b3300be188775cf2ec9958dc6":[0,1,0,2,148], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8e088ff367970d2e1bab67ff21f3c4ba":[0,1,0,2,49], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9206c89aa6ac5f56a2d462df9659ded2":[0,1,0,2,97], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a92f46b65366a865118933f37c589d34e":[0,1,0,2,38], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a93aa5868249076c8b0766369cbbba993":[0,1,0,2,44], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9494db3e1dfa2a390f133a9a8b5aa8e0":[0,1,0,2,27], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a950d9144e4f19333c602cfff78810d1b":[0,1,0,2,141], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a966d675b83b69bd16b7f9058638b69c7":[0,1,0,2,70], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a97acfbb75ee033066beb784570ad4a04":[0,1,0,2,144], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a97f84ddeb2d9220d871138f0bc99fa18":[0,1,0,2,129], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a992c19b9aa26099d7d1954fe77107b0d":[0,1,0,2,143], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9a8ec34d0a51fbf43a5318f67fc5d278":[0,1,0,2,58], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9aefdb1b586dd2b8b2102af7541be392":[0,1,0,2,102], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9b49da771d85d8326615e8b023dec3b8":[0,1,0,2,81], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9d1748ca9db1665902c25c32a2b458d6":[0,1,0,2,35], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9fad9ac24a10e083b2c5ee7cb168eea4":[0,1,0,2,11], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aa00bfb7065e72ad3b287eb78c414bd8d":[0,1,0,2,133], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aad6c90116002d10659c14c064bfa9aaa":[0,1,0,2,88], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aae78c1f217a4b785186bd211bde20da8":[0,1,0,2,122], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aaf42cb87b55f8b75effc9a052bb58dc1":[0,1,0,2,99], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab0d109b9d28587ba6cce93783a348d86":[0,1,0,2,55], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab13ca7a0bef674739095466ff66f9843":[0,1,0,2,142], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab44b2f7085319835ec99afa02f751bd4":[0,1,0,2,132], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab7016831f7a1331681cd712690d64bc7":[0,1,0,2,82], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab83b1dd02818a29abd3ad0cd4697a470":[0,1,0,2,106], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab87a69ec67fe4d42df3cb0084c99dc85":[0,1,0,2,29], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#abbcf6dbd38c9ded33c7b55d5fadf7e24":[0,1,0,2,39], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#abd6be1c541190358a512f0021ea82b16":[0,1,0,2,31], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#abe7b5a4015101375080492cc8e691d1d":[0,1,0,2,126], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#abf4234bd8f1f12b2c674205f1a02bd9f":[0,1,0,2,33], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ac1fd31d8615b5b189349471a7ca23cee":[0,1,0,2,95], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ac6eb4038a1823315b2aa509f7c05c132":[0,1,0,2,109], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ac9ba65a2697010e37db0eadc024e8635":[0,1,0,2,101], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#acad81499ea14286cb3f598ee56a7930e":[0,1,0,2,65], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#acb901a2db0ca1e0bfa37a2135552290f":[0,1,0,2,60], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ace8a12f90790e0699523d9fe3dae6114":[0,1,0,2,79], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#acf87cda48d91ff766adba418a86946a0":[0,1,0,2,131], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6f5682b33a0230cf3a068290df144831":[0,1,0,2,62], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a6ffa9eb4970b25948f6e971d8af7208e":[0,1,0,2,116], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a798b58891191750906359b1f097bca05":[0,1,0,2,113], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7bc87ceb8b4772c3e407ce79883bc368":[0,1,0,2,70], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7be1a9429e5200afb286bbc3b4e4ba13":[0,1,0,2,100], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7d14e3cc08441dc6b3bd64f0ca0a13ba":[0,1,0,2,12], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8366981bc5ecb9b4d52af74865e16bb6":[0,1,0,2,129], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a88faa4c78d1652d9eecea6a9583d4f77":[0,1,0,2,41], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8baaf5567ede31aa84237b45e9a2ec5f":[0,1,0,2,75], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8c25ecae06f5de662111c25a57501ad8":[0,1,0,2,111], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8ced8ed7909fe1536bdef83de1922d42":[0,1,0,2,119], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8d05784b3300be188775cf2ec9958dc6":[0,1,0,2,140], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a8e088ff367970d2e1bab67ff21f3c4ba":[0,1,0,2,44], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9206c89aa6ac5f56a2d462df9659ded2":[0,1,0,2,92], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a92f46b65366a865118933f37c589d34e":[0,1,0,2,33], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a93aa5868249076c8b0766369cbbba993":[0,1,0,2,39], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9494db3e1dfa2a390f133a9a8b5aa8e0":[0,1,0,2,22], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a950d9144e4f19333c602cfff78810d1b":[0,1,0,2,134], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a966d675b83b69bd16b7f9058638b69c7":[0,1,0,2,65], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a97acfbb75ee033066beb784570ad4a04":[0,1,0,2,136], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a97f84ddeb2d9220d871138f0bc99fa18":[0,1,0,2,124], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9a8ec34d0a51fbf43a5318f67fc5d278":[0,1,0,2,53], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9aefdb1b586dd2b8b2102af7541be392":[0,1,0,2,97], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9b49da771d85d8326615e8b023dec3b8":[0,1,0,2,76], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9d1748ca9db1665902c25c32a2b458d6":[0,1,0,2,30], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a9fad9ac24a10e083b2c5ee7cb168eea4":[0,1,0,2,10], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aa00bfb7065e72ad3b287eb78c414bd8d":[0,1,0,2,128], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aad6c90116002d10659c14c064bfa9aaa":[0,1,0,2,83], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aae78c1f217a4b785186bd211bde20da8":[0,1,0,2,117], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aaf42cb87b55f8b75effc9a052bb58dc1":[0,1,0,2,94], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab0d109b9d28587ba6cce93783a348d86":[0,1,0,2,50], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab13ca7a0bef674739095466ff66f9843":[0,1,0,2,135], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab44b2f7085319835ec99afa02f751bd4":[0,1,0,2,127], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab7016831f7a1331681cd712690d64bc7":[0,1,0,2,77], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab83b1dd02818a29abd3ad0cd4697a470":[0,1,0,2,101], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ab87a69ec67fe4d42df3cb0084c99dc85":[0,1,0,2,24], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#abbcf6dbd38c9ded33c7b55d5fadf7e24":[0,1,0,2,34], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#abd6be1c541190358a512f0021ea82b16":[0,1,0,2,26], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#abe7b5a4015101375080492cc8e691d1d":[0,1,0,2,121], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#abf4234bd8f1f12b2c674205f1a02bd9f":[0,1,0,2,28], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ac1fd31d8615b5b189349471a7ca23cee":[0,1,0,2,90], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ac6eb4038a1823315b2aa509f7c05c132":[0,1,0,2,104], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ac9ba65a2697010e37db0eadc024e8635":[0,1,0,2,96], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#acad81499ea14286cb3f598ee56a7930e":[0,1,0,2,60], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#acb901a2db0ca1e0bfa37a2135552290f":[0,1,0,2,55], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ace8a12f90790e0699523d9fe3dae6114":[0,1,0,2,74], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#acf87cda48d91ff766adba418a86946a0":[0,1,0,2,126], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#acfddae56ef5e91b7394b6f4c91748698":[0,1,0,2,2], "classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad1816124976f0e4697006bfc2b6378d7":[0,1,0,2,0], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad518c9841fbf8ff0bd686774bb0babeb":[0,1,0,2,115], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad642a4b775008c980bffe4ad2b451691":[0,1,0,2,68], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad964cdf59c0f6c54e92cd652f2ea8a02":[0,1,0,2,89], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ada7cc9156da44d1e34fd0e0ca42032ec":[0,1,0,2,6], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adaab88b7b51f2a19bd8a12403766be0a":[0,1,0,2,64], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adabf97eae5508fe69a5298c9ce6b627d":[0,1,0,2,7], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adb86cf547ffd36097cb5aafc4add79e8":[0,1,0,2,52], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adcb3937d2bb619a2f22c8808f77be963":[0,1,0,2,48], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adfa5ba77a6812001d674883bb7b751dd":[0,1,0,2,111], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adfa5eae64e455cccd9932e083fc17026":[0,1,0,2,45], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae188dfb96e7d00229f619b3a82188391":[0,1,0,2,47], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae1e239d860d7e7c0bf6722b2192f4306":[0,1,0,2,117], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae2e96333bb9b3ab2d694c93bcf8a8ab6":[0,1,0,2,125], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae47b27b3bfb2d9fa200b02f449c126e7":[0,1,0,2,53], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae8e22bda2a1cd6093087143eb7ac1953":[0,1,0,2,128], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aeada2d6cff883f8cbd1924f1d9729250":[0,1,0,2,28], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aeb4f46dc88633a2d367cda3aaa650e1e":[0,1,0,2,139], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aed50b0789d65ce89402dcf00e186f261":[0,1,0,2,86], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af48766525e3a1c8f88471a9338ae59e7":[0,1,0,2,14], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af4c6c80adb48bffce8c0c2b4119a4002":[0,1,0,2,83], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af7875f3465315841ea962205c98a39d6":[0,1,0,2,113], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af7cb383070a38db2f4015b982371ca1b":[0,1,0,2,96], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af7e3a49a86646f3b69a3d387aa4116bb":[0,1,0,2,140], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afa72e4268acf4beee9e0297e7efa9f3f":[0,1,0,2,145], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afaaa9405b30312279aa8977c015ef1fa":[0,1,0,2,92], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afae0368728a114f8b4ce82148e4489dd":[0,1,0,2,42], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afdb445887173a3e006e72772cfffffbc":[0,1,0,2,10], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afe3a45430ecf9ad29bc15baa377464f7":[0,1,0,2,34], -"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afeaeb2e47f164b9ffd545c3dee232ab4":[0,1,0,2,73], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad518c9841fbf8ff0bd686774bb0babeb":[0,1,0,2,110], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad642a4b775008c980bffe4ad2b451691":[0,1,0,2,63], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ad964cdf59c0f6c54e92cd652f2ea8a02":[0,1,0,2,84], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ada7cc9156da44d1e34fd0e0ca42032ec":[0,1,0,2,5], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adaab88b7b51f2a19bd8a12403766be0a":[0,1,0,2,59], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adabf97eae5508fe69a5298c9ce6b627d":[0,1,0,2,6], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adb86cf547ffd36097cb5aafc4add79e8":[0,1,0,2,47], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adcb3937d2bb619a2f22c8808f77be963":[0,1,0,2,43], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adfa5ba77a6812001d674883bb7b751dd":[0,1,0,2,106], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#adfa5eae64e455cccd9932e083fc17026":[0,1,0,2,40], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae188dfb96e7d00229f619b3a82188391":[0,1,0,2,42], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae1e239d860d7e7c0bf6722b2192f4306":[0,1,0,2,112], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae2e96333bb9b3ab2d694c93bcf8a8ab6":[0,1,0,2,120], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae47b27b3bfb2d9fa200b02f449c126e7":[0,1,0,2,48], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#ae8e22bda2a1cd6093087143eb7ac1953":[0,1,0,2,123], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aeada2d6cff883f8cbd1924f1d9729250":[0,1,0,2,23], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aed50b0789d65ce89402dcf00e186f261":[0,1,0,2,81], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af48766525e3a1c8f88471a9338ae59e7":[0,1,0,2,13], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af4c6c80adb48bffce8c0c2b4119a4002":[0,1,0,2,78], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af7875f3465315841ea962205c98a39d6":[0,1,0,2,108], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af7cb383070a38db2f4015b982371ca1b":[0,1,0,2,91], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af7e3a49a86646f3b69a3d387aa4116bb":[0,1,0,2,133], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afa72e4268acf4beee9e0297e7efa9f3f":[0,1,0,2,137], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afaaa9405b30312279aa8977c015ef1fa":[0,1,0,2,87], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afae0368728a114f8b4ce82148e4489dd":[0,1,0,2,37], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afdb445887173a3e006e72772cfffffbc":[0,1,0,2,9], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afe3a45430ecf9ad29bc15baa377464f7":[0,1,0,2,29], +"classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#afeaeb2e47f164b9ffd545c3dee232ab4":[0,1,0,2,68], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html":[0,1,0,3], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a022e94245068b1c395e13272d8bc4984":[0,1,0,3,72], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a035e8d807028affb949365cac3c000c1":[0,1,0,3,19], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a09d3b482c400b93d31010c2f33f794f4":[0,1,0,3,44], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a0c937b0ca36a6489bbc6630db5df0cf5":[0,1,0,3,122], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a1383d59c91539e205ef2ade35d1dafcb":[0,1,0,3,18], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a022e94245068b1c395e13272d8bc4984":[0,1,0,3,79], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a035e8d807028affb949365cac3c000c1":[0,1,0,3,21], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a09d3b482c400b93d31010c2f33f794f4":[0,1,0,3,50], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a0c937b0ca36a6489bbc6630db5df0cf5":[0,1,0,3,132], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a1383d59c91539e205ef2ade35d1dafcb":[0,1,0,3,20], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a18359d1914ead9e3f6ddfa77ea99bab3":[0,1,0,3,3], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a190bf9a0838f05780f727a5a90883813":[0,1,0,3,68], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a199a281ca182a40a40331fa29e45828a":[0,1,0,3,9], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a1d253986a351e263db95bb63c51775c3":[0,1,0,3,76], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a1e105e4b89ba5652f46bb91e49c817eb":[0,1,0,3,98], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a1eb66c309a71c8e942f8bc0b518c84ed":[0,1,0,3,112], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a20666add7b3f75937954a038c51f5b55":[0,1,0,3,54], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a20a5b2ac403015cf48bc09b6f1f26408":[0,1,0,3,129], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a22b033ac5c8d3f09e96b814355fea17a":[0,1,0,3,106], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2453a1be52f39c3fa9bab2603f1f4773":[0,1,0,3,89], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a294f3c4467883beffdc0d6bea67e1741":[0,1,0,3,32], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a29c095f39a79b5fe0782a6ee22d597ff":[0,1,0,3,39], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2a1e5337a20e3f1dad1d1dfbb89fbb1b":[0,1,0,3,135], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2b676207cf17711c6957d74b5b2fc5dc":[0,1,0,3,17], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2d7cffd628c745f2e7614ffab48f4346":[0,1,0,3,48], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2ecbf452d80ce4914271469183e2e31c":[0,1,0,3,34], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2f0c1a7b9127c6248b03b296257e8833":[0,1,0,3,74], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2f6825fbb587362e1ed38f03e3b97d86":[0,1,0,3,10], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a190bf9a0838f05780f727a5a90883813":[0,1,0,3,75], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a199a281ca182a40a40331fa29e45828a":[0,1,0,3,11], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a1d253986a351e263db95bb63c51775c3":[0,1,0,3,83], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a1e105e4b89ba5652f46bb91e49c817eb":[0,1,0,3,106], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a1eb66c309a71c8e942f8bc0b518c84ed":[0,1,0,3,122], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a20666add7b3f75937954a038c51f5b55":[0,1,0,3,61], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a20a5b2ac403015cf48bc09b6f1f26408":[0,1,0,3,139], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a22b033ac5c8d3f09e96b814355fea17a":[0,1,0,3,116], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2453a1be52f39c3fa9bab2603f1f4773":[0,1,0,3,96], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a26ad42be1c7c9a127b2d806d08e426a6":[0,1,0,3,35], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a294f3c4467883beffdc0d6bea67e1741":[0,1,0,3,38], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a29c095f39a79b5fe0782a6ee22d597ff":[0,1,0,3,45], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2a1e5337a20e3f1dad1d1dfbb89fbb1b":[0,1,0,3,146], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2b676207cf17711c6957d74b5b2fc5dc":[0,1,0,3,19], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2d7cffd628c745f2e7614ffab48f4346":[0,1,0,3,54], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2e2dd82a055dd830e8efc7f1dce03924":[0,1,0,3,37], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2ecbf452d80ce4914271469183e2e31c":[0,1,0,3,40], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2f0c1a7b9127c6248b03b296257e8833":[0,1,0,3,81], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2f6825fbb587362e1ed38f03e3b97d86":[0,1,0,3,12], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a30af017ff0f7101ed71d9b43e56031ca":[0,1,0,3,5], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a314e2615fb2851cf695a7b3adacef3e8":[0,1,0,3,147], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a32f908e88bbb1c5070b5e011f2955c07":[0,1,0,3,31], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a34453683f5cc03bd4169ea004cd7e725":[0,1,0,3,116], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a34492b32e18b9fbfd3ba01ba8ad85eb5":[0,1,0,3,57], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a34ae139e68f31b69fa73c9a84c2197e8":[0,1,0,3,92], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a362f36a540212a3005f56ebf2d3b68b8":[0,1,0,3,12], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a36470f1359566ee071015a630deb89cd":[0,1,0,3,78], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a37c30fea3191a0275918448626e043c4":[0,1,0,3,45], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a380ec35a9c68ed3384489d17a385551a":[0,1,0,3,148], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3836bfe0a9610b9037a73ea727246e71":[0,1,0,3,60], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3a37a4c72e59e5b6e5db518f4a88e7ff":[0,1,0,3,91], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3a441ca48ae4cff29a4f715314fcb0c9":[0,1,0,3,40], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3c5c3eba48b2417a66663739a128e05a":[0,1,0,3,113], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3e46711f25455021caa5de67ef374f55":[0,1,0,3,114], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3ef901c89d40124058a0df268b4f8101":[0,1,0,3,50], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a407af2b73f564d5db79381b5b2699c97":[0,1,0,3,55], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a40bc1308f847c66bc91d9c93368db6ec":[0,1,0,3,125], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a430f1ba9b0f5fe9f3b74678f63025384":[0,1,0,3,63], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a431541d09a66c744e0df775d2ccd3acd":[0,1,0,3,110], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a481001b393776c233ccdc069916d2d7c":[0,1,0,3,88], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a491e418920668f8fce331c65e8b48a02":[0,1,0,3,123], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a49519f5b846f396cd1a4bf0b8775ac65":[0,1,0,3,65], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a4b9e335b7f968d36d9cd6bdfc34bba34":[0,1,0,3,58], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a4bf65c93bea904102b63553f3e5dd1b3":[0,1,0,3,87], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a4f2304d508e3d9645581004c676d94ca":[0,1,0,3,131], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a502fd875dc95e68f905fe2070abaeff8":[0,1,0,3,127], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a50cbee5029c7f2bc22d697b7cd09f0cf":[0,1,0,3,21], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a50ccadf68055ea9e26439ccaed0d68f7":[0,1,0,3,62], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a522261006f1cc94869ef15cd26b739da":[0,1,0,3,90], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a52c4e7589ecefee4dbbff1286344499e":[0,1,0,3,138], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a52cb50316afdcb5899663c98aa47c0de":[0,1,0,3,142], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a5711fc465136219d98b57fc2c2822f24":[0,1,0,3,111], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a578f6c60b4ca495b24e5b7ae2db448cc":[0,1,0,3,6], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a5c6520580009a4608d6ea4e221ef3d29":[0,1,0,3,41], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a5d7d3326aaa9849977f0c203078f39e4":[0,1,0,3,95], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6131bec61397f01d9739e694c57afdbf":[0,1,0,3,93], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6145c59148d531ca06c5d6f218e21b02":[0,1,0,3,82], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a629e1fff799f15735376832d9ed176a2":[0,1,0,3,145], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6355225bc6f8a723100111beb2af4b7f":[0,1,0,3,14] +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a314e2615fb2851cf695a7b3adacef3e8":[0,1,0,3,158], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a32f908e88bbb1c5070b5e011f2955c07":[0,1,0,3,33], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a34453683f5cc03bd4169ea004cd7e725":[0,1,0,3,126], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a34492b32e18b9fbfd3ba01ba8ad85eb5":[0,1,0,3,64], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a34ae139e68f31b69fa73c9a84c2197e8":[0,1,0,3,99], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a362f36a540212a3005f56ebf2d3b68b8":[0,1,0,3,14], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a36470f1359566ee071015a630deb89cd":[0,1,0,3,85], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a37c30fea3191a0275918448626e043c4":[0,1,0,3,51], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a380ec35a9c68ed3384489d17a385551a":[0,1,0,3,159], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3836bfe0a9610b9037a73ea727246e71":[0,1,0,3,67], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3a37a4c72e59e5b6e5db518f4a88e7ff":[0,1,0,3,98], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3a441ca48ae4cff29a4f715314fcb0c9":[0,1,0,3,46], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3c5c3eba48b2417a66663739a128e05a":[0,1,0,3,123], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3e46711f25455021caa5de67ef374f55":[0,1,0,3,124], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3ee489972d8827f03490337c96a74b43":[0,1,0,3,107], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3ef901c89d40124058a0df268b4f8101":[0,1,0,3,57], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a407af2b73f564d5db79381b5b2699c97":[0,1,0,3,62], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a40bc1308f847c66bc91d9c93368db6ec":[0,1,0,3,135], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a430f1ba9b0f5fe9f3b74678f63025384":[0,1,0,3,70], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a431541d09a66c744e0df775d2ccd3acd":[0,1,0,3,120], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a481001b393776c233ccdc069916d2d7c":[0,1,0,3,95], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a491e418920668f8fce331c65e8b48a02":[0,1,0,3,133], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a49519f5b846f396cd1a4bf0b8775ac65":[0,1,0,3,72], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a4b9e335b7f968d36d9cd6bdfc34bba34":[0,1,0,3,65], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a4bf65c93bea904102b63553f3e5dd1b3":[0,1,0,3,94], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a4f2304d508e3d9645581004c676d94ca":[0,1,0,3,141], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a502fd875dc95e68f905fe2070abaeff8":[0,1,0,3,137], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a50cbee5029c7f2bc22d697b7cd09f0cf":[0,1,0,3,23], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a50ccadf68055ea9e26439ccaed0d68f7":[0,1,0,3,69], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a522261006f1cc94869ef15cd26b739da":[0,1,0,3,97], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a52c4e7589ecefee4dbbff1286344499e":[0,1,0,3,149], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a52cb50316afdcb5899663c98aa47c0de":[0,1,0,3,153], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a5711fc465136219d98b57fc2c2822f24":[0,1,0,3,121], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a578f6c60b4ca495b24e5b7ae2db448cc":[0,1,0,3,7], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a5c6520580009a4608d6ea4e221ef3d29":[0,1,0,3,47], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a5d7d3326aaa9849977f0c203078f39e4":[0,1,0,3,102], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6131bec61397f01d9739e694c57afdbf":[0,1,0,3,100], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6145c59148d531ca06c5d6f218e21b02":[0,1,0,3,89], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a629e1fff799f15735376832d9ed176a2":[0,1,0,3,156], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6355225bc6f8a723100111beb2af4b7f":[0,1,0,3,16], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a661794563709a984308164abcdd543ee":[0,1,0,3,147], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a679b657463892cddf8e20d553f2ca682":[0,1,0,3,25], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6b6f336bd93b1a3053428a92cf0fc909":[0,1,0,3,140], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6c0ac0823d48779ad3c84ee0bedf1e23":[0,1,0,3,49], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d260fcee2ad4a83b36fc26adad5934d":[0,1,0,3,55], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d73d64a97cc8f024e1ee3367bfd119d":[0,1,0,3,71] }; diff --git a/html/doxygen/navtreeindex16.js b/html/doxygen/navtreeindex16.js index 6d815e2a56..57395cfe7f 100644 --- a/html/doxygen/navtreeindex16.js +++ b/html/doxygen/navtreeindex16.js @@ -1,90 +1,92 @@ var NAVTREEINDEX16 = { -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a661794563709a984308164abcdd543ee":[0,1,0,3,136], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a679b657463892cddf8e20d553f2ca682":[0,1,0,3,23], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6b6f336bd93b1a3053428a92cf0fc909":[0,1,0,3,130], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6c0ac0823d48779ad3c84ee0bedf1e23":[0,1,0,3,43], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d260fcee2ad4a83b36fc26adad5934d":[0,1,0,3,49], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d73d64a97cc8f024e1ee3367bfd119d":[0,1,0,3,64], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6e7b32701d8bf69f1ba8995e4bf50ad3":[0,1,0,3,128], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d8c0140086b0f5284e1cf7c23632463":[0,1,0,3,34], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6e25890e173635c92d41465a2ee4d3a2":[0,1,0,3,36], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6e7b32701d8bf69f1ba8995e4bf50ad3":[0,1,0,3,138], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a73d001ad3c271c56d89e09e2cebfceb3":[0,1,0,3,0], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a7559257a5ad55a48d1221522838c5daf":[0,1,0,3,33], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a78481115d7590930ac4d58d0bdaa2acc":[0,1,0,3,79], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a789dae2310c3496443a8a51c26cc8b71":[0,1,0,3,103], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a7b4903b21fc0872bcb8e68fe0a2efb1a":[0,1,0,3,81], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a7c72df642a0d00144470a946f65eb5bc":[0,1,0,3,28], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a7cb14cb8ebe04982bb17999fa1a2c479":[0,1,0,3,37], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a7dad6de0caa4a6f50a54db2a87edda5e":[0,1,0,3,85], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a821839be74f3cc975dff8a9c76ed54ad":[0,1,0,3,109], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8229d44e2e83410c2e28319a64e24f75":[0,1,0,3,120], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a7559257a5ad55a48d1221522838c5daf":[0,1,0,3,39], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a78481115d7590930ac4d58d0bdaa2acc":[0,1,0,3,86], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a789dae2310c3496443a8a51c26cc8b71":[0,1,0,3,112], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a7b4903b21fc0872bcb8e68fe0a2efb1a":[0,1,0,3,88], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a7c72df642a0d00144470a946f65eb5bc":[0,1,0,3,30], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a7cb14cb8ebe04982bb17999fa1a2c479":[0,1,0,3,43], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a7dad6de0caa4a6f50a54db2a87edda5e":[0,1,0,3,92], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a81cded985b616728b55976bf7eca4488":[0,1,0,3,56], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a821839be74f3cc975dff8a9c76ed54ad":[0,1,0,3,119], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8229d44e2e83410c2e28319a64e24f75":[0,1,0,3,130], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a84d8220dfbff2afda5d207b6d29f61f8":[0,1,0,3,1], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a856bffb7c4dd44eed5f371fc25f5c349":[0,1,0,3,11], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8b8b75dcd53ae8e3a641f18cb00bee1d":[0,1,0,3,102], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8b912ad6d9a4f6d8e4c1bb16f2c95fbf":[0,1,0,3,94], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8cefcce52cd721b3869701367f456a71":[0,1,0,3,80], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8eb67dab884cc678e541ff5cc77b5e03":[0,1,0,3,126], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8ed7dc66684dd077c0aa2260e0e0afb4":[0,1,0,3,118], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a913c33933a32feca0f0389cee637a293":[0,1,0,3,15], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a91fdec443327720111f0b8ecad783c87":[0,1,0,3,84], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a92bfb8a4daec705014f8e871fb0feacb":[0,1,0,3,52], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a93592e117e3283a0b2e0a5aa647bc155":[0,1,0,3,83], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a936ed1973fb19388fd20fa09f0f9d8bb":[0,1,0,3,107], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a946c6fc559c23573210285ed47e28570":[0,1,0,3,124], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a96932dfa1cc61d6eeb2d650e707ecf20":[0,1,0,3,121], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a96ee5727c24f572b7b25cd2c39b9b776":[0,1,0,3,69], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a987d2e01b76d37c69fd6e589b4d69473":[0,1,0,3,140], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a9a425d43bf21b8dddc7971e25c9e09fb":[0,1,0,3,108], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a9fd66cb8986ef84feaa63fdd0f072e45":[0,1,0,3,20], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aa017bbe95ad7539e72d182dac59f2454":[0,1,0,3,61], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aa2be06a920e2103ba838c308a2dcc57e":[0,1,0,3,144], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aa526479a9b7e3f096291cebbb0806df9":[0,1,0,3,16], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aaa6dae67e44cbd29e86e10b270249bed":[0,1,0,3,51], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aac1df493cd346d7faccb17ae5440ddc4":[0,1,0,3,29], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aad0e75ceecc2e0802555fcd92cb7d437":[0,1,0,3,53], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aadbceff0e1e871a3b7fb3730faf07f3e":[0,1,0,3,66], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aaf72cbf7288677fa045647df13322804":[0,1,0,3,86], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#abb107f782ba7985c00ac77dc77acd35c":[0,1,0,3,36], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#abcf0d5623d10f929b40dd3fc0e8ad00a":[0,1,0,3,47], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#abe4fe9f14753f16e3b1014cdb4e9f846":[0,1,0,3,25], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac03f9380fcd4421f95e56f37f0cd00c7":[0,1,0,3,35], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac1af60c6e410db30d87cecefd7cc7160":[0,1,0,3,115], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac2029b16365753e1e337f82cda0e3350":[0,1,0,3,143], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac22dee1d346345a9c9583029c5c1f285":[0,1,0,3,119], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac53419e9abc2d2f9b12acf10507e7954":[0,1,0,3,97], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac5bd9ecbc1c392116871b5adaeb815a8":[0,1,0,3,137], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac87b0baf7ca05124b07a2cb0c405a165":[0,1,0,3,22], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac9afb2932937099ff2a72314c9027a07":[0,1,0,3,13], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#acbb83079b063cd6b48e07030b1f5df84":[0,1,0,3,56], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#acd5e0d9dafe7c14f8946e980b77410ae":[0,1,0,3,67], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#acec9a90ac60967aeee0466003256855a":[0,1,0,3,139], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#acf8e00aaf5cd53b7be12cfeeee66c5b7":[0,1,0,3,26], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad283ce438acd2faea2bbb309251890a1":[0,1,0,3,132], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad3fa1a15788de5405f64304fcae242f9":[0,1,0,3,24], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad4462dbd2b4f56b33b7cc875150ca77c":[0,1,0,3,117], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad488bc63dac24ac7e5c29a1138172ed7":[0,1,0,3,133], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad4e248ac19ce527c6e64304c42364388":[0,1,0,3,42], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad63b4318b5abd6b8c224fab70fe61081":[0,1,0,3,59], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae02024096ab4490b8a6215b3e59e6de0":[0,1,0,3,105], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae022e99573f663fc0db935c5c1bb7199":[0,1,0,3,7], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae0d8d4e346e244c764911c0c64c2ac1c":[0,1,0,3,104], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae0e48a2461354feaaa2a3077da1d02f6":[0,1,0,3,70], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae2fa3994b15579d0752d740c279c2073":[0,1,0,3,141], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae333398890c61148ec60cb52c3d28c10":[0,1,0,3,101], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae350ed7effbbcf8dbea050231599c8e6":[0,1,0,3,77], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae380b1cd2026a4330518944637c56a79":[0,1,0,3,27], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae63ddf806884e983a264346f21794168":[0,1,0,3,134], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aeacff81944f23540968aa617d25e3d22":[0,1,0,3,30], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aec3cef47cc3c1e5901b4ff401ce8e725":[0,1,0,3,99], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aee824eb01f6cf6f9187af509245ffc3a":[0,1,0,3,71], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a856bffb7c4dd44eed5f371fc25f5c349":[0,1,0,3,13], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8b8b75dcd53ae8e3a641f18cb00bee1d":[0,1,0,3,111], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8b912ad6d9a4f6d8e4c1bb16f2c95fbf":[0,1,0,3,101], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8c28e874826634125ad9b5f59511f445":[0,1,0,3,144], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8cefcce52cd721b3869701367f456a71":[0,1,0,3,87], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8eb67dab884cc678e541ff5cc77b5e03":[0,1,0,3,136], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8ed7dc66684dd077c0aa2260e0e0afb4":[0,1,0,3,128], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a913c33933a32feca0f0389cee637a293":[0,1,0,3,17], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a91fdec443327720111f0b8ecad783c87":[0,1,0,3,91], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a92bfb8a4daec705014f8e871fb0feacb":[0,1,0,3,59], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a93592e117e3283a0b2e0a5aa647bc155":[0,1,0,3,90], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a936ed1973fb19388fd20fa09f0f9d8bb":[0,1,0,3,117], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a946c6fc559c23573210285ed47e28570":[0,1,0,3,134], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a96932dfa1cc61d6eeb2d650e707ecf20":[0,1,0,3,131], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a96ee5727c24f572b7b25cd2c39b9b776":[0,1,0,3,76], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a987d2e01b76d37c69fd6e589b4d69473":[0,1,0,3,151], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a9a425d43bf21b8dddc7971e25c9e09fb":[0,1,0,3,118], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a9fd66cb8986ef84feaa63fdd0f072e45":[0,1,0,3,22], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aa017bbe95ad7539e72d182dac59f2454":[0,1,0,3,68], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aa2be06a920e2103ba838c308a2dcc57e":[0,1,0,3,155], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aa526479a9b7e3f096291cebbb0806df9":[0,1,0,3,18], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aa539bb6033a8bcd87fc4eb279bad887a":[0,1,0,3,104], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aaa6dae67e44cbd29e86e10b270249bed":[0,1,0,3,58], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aac1df493cd346d7faccb17ae5440ddc4":[0,1,0,3,31], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aad0e75ceecc2e0802555fcd92cb7d437":[0,1,0,3,60], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aada5b6eeb7fd6f21a4ce2c68da1e2994":[0,1,0,3,6], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aadbceff0e1e871a3b7fb3730faf07f3e":[0,1,0,3,73], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aaf72cbf7288677fa045647df13322804":[0,1,0,3,93], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aba3a9521ace5f09f4d2263e4401b33ee":[0,1,0,3,113], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#abb107f782ba7985c00ac77dc77acd35c":[0,1,0,3,42], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#abcf0d5623d10f929b40dd3fc0e8ad00a":[0,1,0,3,53], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#abe4fe9f14753f16e3b1014cdb4e9f846":[0,1,0,3,27], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac03f9380fcd4421f95e56f37f0cd00c7":[0,1,0,3,41], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac1af60c6e410db30d87cecefd7cc7160":[0,1,0,3,125], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac2029b16365753e1e337f82cda0e3350":[0,1,0,3,154], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac22dee1d346345a9c9583029c5c1f285":[0,1,0,3,129], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac53419e9abc2d2f9b12acf10507e7954":[0,1,0,3,105], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac5bd9ecbc1c392116871b5adaeb815a8":[0,1,0,3,148], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac87b0baf7ca05124b07a2cb0c405a165":[0,1,0,3,24], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac9afb2932937099ff2a72314c9027a07":[0,1,0,3,15], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#acbb83079b063cd6b48e07030b1f5df84":[0,1,0,3,63], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#acd5e0d9dafe7c14f8946e980b77410ae":[0,1,0,3,74], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#acec9a90ac60967aeee0466003256855a":[0,1,0,3,150], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#acf8e00aaf5cd53b7be12cfeeee66c5b7":[0,1,0,3,28], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad283ce438acd2faea2bbb309251890a1":[0,1,0,3,142], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad3fa1a15788de5405f64304fcae242f9":[0,1,0,3,26], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad4462dbd2b4f56b33b7cc875150ca77c":[0,1,0,3,127], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad488bc63dac24ac7e5c29a1138172ed7":[0,1,0,3,143], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad4e248ac19ce527c6e64304c42364388":[0,1,0,3,48], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ad63b4318b5abd6b8c224fab70fe61081":[0,1,0,3,66], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae02024096ab4490b8a6215b3e59e6de0":[0,1,0,3,115], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae022e99573f663fc0db935c5c1bb7199":[0,1,0,3,8], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae0d8d4e346e244c764911c0c64c2ac1c":[0,1,0,3,114], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae0e48a2461354feaaa2a3077da1d02f6":[0,1,0,3,77], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae29a1c321357b464d7a67ee4fbfabfe3":[0,1,0,3,9], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae2fa3994b15579d0752d740c279c2073":[0,1,0,3,152], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae333398890c61148ec60cb52c3d28c10":[0,1,0,3,110], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae350ed7effbbcf8dbea050231599c8e6":[0,1,0,3,84], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae380b1cd2026a4330518944637c56a79":[0,1,0,3,29], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae63ddf806884e983a264346f21794168":[0,1,0,3,145], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aeacff81944f23540968aa617d25e3d22":[0,1,0,3,32], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aec3cef47cc3c1e5901b4ff401ce8e725":[0,1,0,3,108], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aee824eb01f6cf6f9187af509245ffc3a":[0,1,0,3,78], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aeeacd28215827d6b0cd23cf59e5fc0c2":[0,1,0,3,4], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aef331b9ddcbd761f3aea6b457f83e88e":[0,1,0,3,100], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#af2490222aefa83d67238c605e05197a3":[0,1,0,3,75], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#af3e2476ccbaa3d2502fa8e6c0e42a628":[0,1,0,3,73], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#af55b2f46300b89a8458f17ab405eaa29":[0,1,0,3,146], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aef331b9ddcbd761f3aea6b457f83e88e":[0,1,0,3,109], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#af2490222aefa83d67238c605e05197a3":[0,1,0,3,82], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#af3e2476ccbaa3d2502fa8e6c0e42a628":[0,1,0,3,80], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#af55b2f46300b89a8458f17ab405eaa29":[0,1,0,3,157], "classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#af75968756df0bb3b12307f75bf122f20":[0,1,0,3,2], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#afba5ac1d4636d7ba57ac3fd7c7b5e2ba":[0,1,0,3,8], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#afdf8d3232526bf1978bb298755f42958":[0,1,0,3,38], -"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aff92b4a2fed92577dbd5294d54def2e8":[0,1,0,3,46], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#afba5ac1d4636d7ba57ac3fd7c7b5e2ba":[0,1,0,3,10], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#afdf8d3232526bf1978bb298755f42958":[0,1,0,3,44], +"classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aff92b4a2fed92577dbd5294d54def2e8":[0,1,0,3,52], "classnmodl_1_1codegen_1_1_codegen_helper_visitor.html":[0,1,1,2], "classnmodl_1_1codegen_1_1_codegen_helper_visitor.html#a00a403d7992d9e11cf278ced1e4e2896":[0,1,1,2,9], "classnmodl_1_1codegen_1_1_codegen_helper_visitor.html#a054569f05b02caaba93e107812c4e539":[0,1,1,2,18], @@ -137,70 +139,72 @@ var NAVTREEINDEX16 = "classnmodl_1_1codegen_1_1_codegen_helper_visitor.html#af20451367756d95c85cd561cde6fe755":[0,1,1,2,29], "classnmodl_1_1codegen_1_1_codegen_helper_visitor.html#af27eb43d5a4f76227692de56333b6c08":[0,1,1,2,19], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html":[0,1,0,4], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a0195ec229853e6a5568228b868829942":[0,1,0,4,48], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a05f014fb5be8b7dd4b747bcc5d861ae3":[0,1,0,4,34], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a085966219db2e0b51d168738421df098":[0,1,0,4,53], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a111784a1f5c4ef8a2c04edb714cca60f":[0,1,0,4,52], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a13af4fa40fc5b97bfcf91d199fe6a8e2":[0,1,0,4,61], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a14b770116ea7a9580c6d82d7a2bb1bc1":[0,1,0,4,3], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a1d7cd0325d3658024daba8fe2d2cb804":[0,1,0,4,35], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a24c55a8420d179cbbd7bc6968f3c12e3":[0,1,0,4,56], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a3529a162774aca01dbc18b604acfe00c":[0,1,0,4,16], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a3af0b90beeeec4a0e17e84a11a76ecbc":[0,1,0,4,7], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a3e4bdc70a4d2eb6169d656c1ec9c9fe1":[0,1,0,4,6], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a403636272eebe18cf3f25759c06ec00a":[0,1,0,4,64], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a480879d1374101ede3c9542951433543":[0,1,0,4,50], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a50026c205b223b41ffe682526735873c":[0,1,0,4,62], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a5429cb9990f7cbe91dc33522da5ad76d":[0,1,0,4,51], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a5e99f3edec8e7e1f852cac39b1b7314e":[0,1,0,4,29], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a62669c86daa6bdd6c1e67e93461ad747":[0,1,0,4,45], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a68499754b87764b2eba30bf38a1edbb4":[0,1,0,4,10], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a6abde0bb8aa4c6bd11cd15303295e9f9":[0,1,0,4,39], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a6e501a98cc559afd172f898fa0d7cef7":[0,1,0,4,4], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a75551174c0c66124b0096de40ca20cbf":[0,1,0,4,59], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a76894f40f5ef1531c1b3c884f93eda42":[0,1,0,4,27], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a76f144fae532604ab1a1065d9c645211":[0,1,0,4,46], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a77ac6349ba709a4ef7ecd6a4c34b9e0c":[0,1,0,4,63], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a7f941bd8151d12ef887be3670dec264e":[0,1,0,4,25], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8633f24f67f430477ff3bf4a0c6b36cb":[0,1,0,4,21], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a0195ec229853e6a5568228b868829942":[0,1,0,4,50], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a05f014fb5be8b7dd4b747bcc5d861ae3":[0,1,0,4,36], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a085966219db2e0b51d168738421df098":[0,1,0,4,55], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a111784a1f5c4ef8a2c04edb714cca60f":[0,1,0,4,54], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a13af4fa40fc5b97bfcf91d199fe6a8e2":[0,1,0,4,63], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a14b770116ea7a9580c6d82d7a2bb1bc1":[0,1,0,4,4], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a1d7cd0325d3658024daba8fe2d2cb804":[0,1,0,4,37], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a24c55a8420d179cbbd7bc6968f3c12e3":[0,1,0,4,58], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a3529a162774aca01dbc18b604acfe00c":[0,1,0,4,18], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a3af0b90beeeec4a0e17e84a11a76ecbc":[0,1,0,4,8], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a3e4bdc70a4d2eb6169d656c1ec9c9fe1":[0,1,0,4,7], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a403636272eebe18cf3f25759c06ec00a":[0,1,0,4,66], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a480879d1374101ede3c9542951433543":[0,1,0,4,52], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a50026c205b223b41ffe682526735873c":[0,1,0,4,64], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a5429cb9990f7cbe91dc33522da5ad76d":[0,1,0,4,53], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a593b6a70562ebbf42e13fea3b03d9174":[0,1,0,4,3], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a5e99f3edec8e7e1f852cac39b1b7314e":[0,1,0,4,31], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a62669c86daa6bdd6c1e67e93461ad747":[0,1,0,4,47], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a68499754b87764b2eba30bf38a1edbb4":[0,1,0,4,11], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a6abde0bb8aa4c6bd11cd15303295e9f9":[0,1,0,4,41], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a6e501a98cc559afd172f898fa0d7cef7":[0,1,0,4,5], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a70bd9cedc2fcae2e924ebcc59c7f728b":[0,1,0,4,14], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a75551174c0c66124b0096de40ca20cbf":[0,1,0,4,61], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a76894f40f5ef1531c1b3c884f93eda42":[0,1,0,4,29], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a76f144fae532604ab1a1065d9c645211":[0,1,0,4,48], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a77ac6349ba709a4ef7ecd6a4c34b9e0c":[0,1,0,4,65], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a7f941bd8151d12ef887be3670dec264e":[0,1,0,4,27], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8633f24f67f430477ff3bf4a0c6b36cb":[0,1,0,4,23], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a89c5a0f046f8752579636a3db97d669a":[0,1,0,4,2], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8c348f1869653cec3dcc39b1866bab97":[0,1,0,4,14], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8c348f1869653cec3dcc39b1866bab97":[0,1,0,4,16], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a8dc54bf1b8cfca4663fffa7fb5444975":[0,1,0,4,1], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a910f9f22e6fbdae4eefae177eb8910f9":[0,1,0,4,15], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a94f4993226aa53f6095ad4a44fe47420":[0,1,0,4,18], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a96edb3ade58fc8c569ac0c73a54fd091":[0,1,0,4,47], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9749309d724cd1f4a47989c9d76c92c3":[0,1,0,4,40], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9b04c504442be8eaffd17f52376b265a":[0,1,0,4,58], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9f9d3aebd2dc5bbc05e0cb7e9a707c7f":[0,1,0,4,17], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa02a628bedfd1b7cbd65b32e8f2042e5":[0,1,0,4,28], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa08a55bc62e18a9c545e8903dd3b1530":[0,1,0,4,12], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa40457fee0fa38359bb1ef9487efd00e":[0,1,0,4,41], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa7665c8b7c92f51b6fbccfa74b97a706":[0,1,0,4,30], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aac802efa00966f667ff0554bc1e9af1d":[0,1,0,4,32], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aaea5e3201bfb4a18f919f8e60db23d49":[0,1,0,4,60], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab501ff577dc0c959112378c70a9bb125":[0,1,0,4,37], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab5ead6dc1ad6f664019b6713d3238622":[0,1,0,4,57], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab6d3ef0a7aaee1cbdb59070b6982f6f3":[0,1,0,4,33], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab72208bf9821d213a933f4b3f5579d20":[0,1,0,4,38], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#abce8ff7e8bd0754c8d61066779b4e72f":[0,1,0,4,20], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#abd73fe57cf5edd770a7e775f130fc723":[0,1,0,4,36], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ac5eaa12b912040d6564bd2d1908a44e0":[0,1,0,4,31], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acaa8d4797838b7efc6b4d6d031c2a231":[0,1,0,4,26], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acc60913cbeb34f75a125224f6a3a79bd":[0,1,0,4,55], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acfd3c1256b1d34de5fef97cff079cb8a":[0,1,0,4,5], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ad4ac4cce1ce357ab264dde505128f5e5":[0,1,0,4,54], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ad5b66ea20129a4cf098f744a8d449893":[0,1,0,4,8], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ad635ed74eba5b2c3e0aee2e29ca1167a":[0,1,0,4,23], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#adbf8216b0f67ec9e714bee6aa52e1e3f":[0,1,0,4,44], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#adf3ecfb21886bca7be8a882e2166a919":[0,1,0,4,42], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ae8c6eae53160557133e32fb9cef1f153":[0,1,0,4,49], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aeb0635e7e6e488519882d930401b5c2b":[0,1,0,4,19], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a910f9f22e6fbdae4eefae177eb8910f9":[0,1,0,4,17], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a94f4993226aa53f6095ad4a44fe47420":[0,1,0,4,20], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a96edb3ade58fc8c569ac0c73a54fd091":[0,1,0,4,49], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9749309d724cd1f4a47989c9d76c92c3":[0,1,0,4,42], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9b04c504442be8eaffd17f52376b265a":[0,1,0,4,60], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a9f9d3aebd2dc5bbc05e0cb7e9a707c7f":[0,1,0,4,19], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa02a628bedfd1b7cbd65b32e8f2042e5":[0,1,0,4,30], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa08a55bc62e18a9c545e8903dd3b1530":[0,1,0,4,13], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa40457fee0fa38359bb1ef9487efd00e":[0,1,0,4,43], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aa7665c8b7c92f51b6fbccfa74b97a706":[0,1,0,4,32], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aac802efa00966f667ff0554bc1e9af1d":[0,1,0,4,34], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aaea5e3201bfb4a18f919f8e60db23d49":[0,1,0,4,62], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab501ff577dc0c959112378c70a9bb125":[0,1,0,4,39], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab5ead6dc1ad6f664019b6713d3238622":[0,1,0,4,59], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab6d3ef0a7aaee1cbdb59070b6982f6f3":[0,1,0,4,35], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ab72208bf9821d213a933f4b3f5579d20":[0,1,0,4,40], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#abce8ff7e8bd0754c8d61066779b4e72f":[0,1,0,4,22], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#abd73fe57cf5edd770a7e775f130fc723":[0,1,0,4,38], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ac5eaa12b912040d6564bd2d1908a44e0":[0,1,0,4,33], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acaa8d4797838b7efc6b4d6d031c2a231":[0,1,0,4,28], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acc60913cbeb34f75a125224f6a3a79bd":[0,1,0,4,57], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#acfd3c1256b1d34de5fef97cff079cb8a":[0,1,0,4,6], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ad4ac4cce1ce357ab264dde505128f5e5":[0,1,0,4,56], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ad5b66ea20129a4cf098f744a8d449893":[0,1,0,4,9], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ad635ed74eba5b2c3e0aee2e29ca1167a":[0,1,0,4,25], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#adbf8216b0f67ec9e714bee6aa52e1e3f":[0,1,0,4,46], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#adf3ecfb21886bca7be8a882e2166a919":[0,1,0,4,44], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#ae8c6eae53160557133e32fb9cef1f153":[0,1,0,4,51], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aeb0635e7e6e488519882d930401b5c2b":[0,1,0,4,21], "classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#aef77df54b474011a077b79e3b9126433":[0,1,0,4,0], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af2f331ce244ac6fa94bbc94de9163fba":[0,1,0,4,43], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af6676bc4b255a87e484bc2641d64b713":[0,1,0,4,11], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af66d9e0ce20ea0c75375aa354f9446bc":[0,1,0,4,9], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af6a5224b66dde062241120381b3cb8df":[0,1,0,4,24], -"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#afdd6466ebac569ec670c3b6f4ca11d3e":[0,1,0,4,13], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af2f331ce244ac6fa94bbc94de9163fba":[0,1,0,4,45], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af6676bc4b255a87e484bc2641d64b713":[0,1,0,4,12], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af66d9e0ce20ea0c75375aa354f9446bc":[0,1,0,4,10], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#af6a5224b66dde062241120381b3cb8df":[0,1,0,4,26], +"classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#afdd6466ebac569ec670c3b6f4ca11d3e":[0,1,0,4,15], "classnmodl_1_1parser_1_1_c_driver.html":[0,10,0], "classnmodl_1_1parser_1_1_c_driver.html#a053c12081e3a1715b66a2ecb27bc7d93":[0,10,0,7], "classnmodl_1_1parser_1_1_c_driver.html#a1517751d004ce35202eeaae7c01a51cb":[0,10,0,20], @@ -245,9 +249,5 @@ var NAVTREEINDEX16 = "classnmodl_1_1parser_1_1_diffeq_lexer.html#a90fe9f0c5a5354578e0a81d804540d29":[0,9,1,1], "classnmodl_1_1parser_1_1_diffeq_lexer.html#ab6c5b6e62d09d986b5fd35d66fa52d3e":[0,9,1,3], "classnmodl_1_1parser_1_1_diffeq_lexer.html#ad23015602c4b984aa93c5afd802f151a":[0,9,1,2], -"classnmodl_1_1parser_1_1_nmodl_driver.html":[0,10,2], -"classnmodl_1_1parser_1_1_nmodl_driver.html#a03e96357ac710ecceeec582aa176d742":[0,10,2,11], -"classnmodl_1_1parser_1_1_nmodl_driver.html#a054af38fb8cc89aace91c111673566c4":[0,10,2,8], -"classnmodl_1_1parser_1_1_nmodl_driver.html#a0f5b8334e6b5adc07ce4ea089ae47ff4":[0,10,2,16], -"classnmodl_1_1parser_1_1_nmodl_driver.html#a1572a9db0714f6bc53edcda7b57d7963":[0,10,2,10] +"classnmodl_1_1parser_1_1_nmodl_driver.html":[0,10,2] }; diff --git a/html/doxygen/navtreeindex17.js b/html/doxygen/navtreeindex17.js index ffe6811c08..444f1fbcc3 100644 --- a/html/doxygen/navtreeindex17.js +++ b/html/doxygen/navtreeindex17.js @@ -1,5 +1,9 @@ var NAVTREEINDEX17 = { +"classnmodl_1_1parser_1_1_nmodl_driver.html#a03e96357ac710ecceeec582aa176d742":[0,10,2,11], +"classnmodl_1_1parser_1_1_nmodl_driver.html#a054af38fb8cc89aace91c111673566c4":[0,10,2,8], +"classnmodl_1_1parser_1_1_nmodl_driver.html#a0f5b8334e6b5adc07ce4ea089ae47ff4":[0,10,2,16], +"classnmodl_1_1parser_1_1_nmodl_driver.html#a1572a9db0714f6bc53edcda7b57d7963":[0,10,2,10], "classnmodl_1_1parser_1_1_nmodl_driver.html#a1d10f7ff97b79400f0b61fa7dafc4747":[0,10,2,18], "classnmodl_1_1parser_1_1_nmodl_driver.html#a1d8d4a11126fc6e8e79f8422f7b4532c":[0,10,2,13], "classnmodl_1_1parser_1_1_nmodl_driver.html#a21536d49a7875b3773388212b5863d89":[0,10,2,22], @@ -245,9 +249,5 @@ var NAVTREEINDEX17 = "classnmodl_1_1symtab_1_1_symbol_table.html#abe411cdf9a4231527907191ec0b49c18":[0,5,0,4], "classnmodl_1_1symtab_1_1_symbol_table.html#abedf5457889806cd0220c4bfd582ee57":[0,5,0,16], "classnmodl_1_1symtab_1_1_symbol_table.html#ac6d37e46d08586231942c7d490f9eb84":[0,5,0,11], -"classnmodl_1_1symtab_1_1_symbol_table.html#ac926b391bd62911a7ad8f9b80266a91b":[0,5,0,22], -"classnmodl_1_1symtab_1_1_symbol_table.html#ae1ec2b128700c6eb7321f5a1a641d78f":[0,5,0,3], -"classnmodl_1_1symtab_1_1_symbol_table.html#ae5b98e5c347430f31b24e3a03219f3f0":[0,5,0,21], -"classnmodl_1_1symtab_1_1_symbol_table.html#af71ba5c474d551d1617d4c12ef152b3b":[0,5,0,13], -"classnmodl_1_1symtab_1_1_symbol_table.html#af797731e49de39c99e654b3868cc6c84":[0,5,0,1] +"classnmodl_1_1symtab_1_1_symbol_table.html#ac926b391bd62911a7ad8f9b80266a91b":[0,5,0,22] }; diff --git a/html/doxygen/navtreeindex18.js b/html/doxygen/navtreeindex18.js index 9440acedc1..4737a7252a 100644 --- a/html/doxygen/navtreeindex18.js +++ b/html/doxygen/navtreeindex18.js @@ -1,5 +1,9 @@ var NAVTREEINDEX18 = { +"classnmodl_1_1symtab_1_1_symbol_table.html#ae1ec2b128700c6eb7321f5a1a641d78f":[0,5,0,3], +"classnmodl_1_1symtab_1_1_symbol_table.html#ae5b98e5c347430f31b24e3a03219f3f0":[0,5,0,21], +"classnmodl_1_1symtab_1_1_symbol_table.html#af71ba5c474d551d1617d4c12ef152b3b":[0,5,0,13], +"classnmodl_1_1symtab_1_1_symbol_table.html#af797731e49de39c99e654b3868cc6c84":[0,5,0,1], "classnmodl_1_1symtab_1_1_symbol_table.html#af83af83491e382ea6f105e7e016a0980":[0,5,0,20], "classnmodl_1_1symtab_1_1_symbol_table.html#aff69a865f425c2a8be50a83f7c2f7764":[0,5,0,25], "classnmodl_1_1symtab_1_1_symbol_table_1_1_table.html":[0,5,0,0], @@ -245,9 +249,5 @@ var NAVTREEINDEX18 = "classnmodl_1_1visitor_1_1_const_ast_visitor.html#a66939f63d205ec42ff3dd90436f1b5fa":[2,0,0,10,4,61], "classnmodl_1_1visitor_1_1_const_ast_visitor.html#a66ce42a7bb7c48363277acb530b49765":[2,0,0,10,4,14], "classnmodl_1_1visitor_1_1_const_ast_visitor.html#a67bf0ab036cb2653095496ae58353c37":[2,0,0,10,4,0], -"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a67c2028facb007637243cdfefe2a191b":[2,0,0,10,4,117], -"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a6977ddcb3db50ad9fb2ce46faafa32f5":[2,0,0,10,4,42], -"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a69c1a0a8ec63790a6f34e93cde13fa3d":[2,0,0,10,4,49], -"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a6a92024744b05fcb49306d8ca524ac5c":[2,0,0,10,4,98], -"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a7028718aa5987c1483e72570b55c132b":[2,0,0,10,4,80] +"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a67c2028facb007637243cdfefe2a191b":[2,0,0,10,4,117] }; diff --git a/html/doxygen/navtreeindex19.js b/html/doxygen/navtreeindex19.js index f15158799f..934e637ac5 100644 --- a/html/doxygen/navtreeindex19.js +++ b/html/doxygen/navtreeindex19.js @@ -1,5 +1,9 @@ var NAVTREEINDEX19 = { +"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a6977ddcb3db50ad9fb2ce46faafa32f5":[2,0,0,10,4,42], +"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a69c1a0a8ec63790a6f34e93cde13fa3d":[2,0,0,10,4,49], +"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a6a92024744b05fcb49306d8ca524ac5c":[2,0,0,10,4,98], +"classnmodl_1_1visitor_1_1_const_ast_visitor.html#a7028718aa5987c1483e72570b55c132b":[2,0,0,10,4,80], "classnmodl_1_1visitor_1_1_const_ast_visitor.html#a71502a8e8dc90a7fd916bb791470d81e":[2,0,0,10,4,29], "classnmodl_1_1visitor_1_1_const_ast_visitor.html#a7473d5e3c2a1442bdf336483ef243992":[2,0,0,10,4,58], "classnmodl_1_1visitor_1_1_const_ast_visitor.html#a75e87e5e67df2db996169e92d06b3907":[2,0,0,10,4,36], @@ -245,9 +249,5 @@ var NAVTREEINDEX19 = "classnmodl_1_1visitor_1_1_def_use_analyze_visitor.html#af549f107ffbb1654232b46a65b8f9cc0":[0,8,0,4,33], "classnmodl_1_1visitor_1_1_def_use_analyze_visitor.html#af94cd90d5c0c19b17df0c1f4f4d8f807":[0,8,0,4,16], "classnmodl_1_1visitor_1_1_global_to_range_visitor.html":[0,8,0,5], -"classnmodl_1_1visitor_1_1_global_to_range_visitor.html#a129109fe76496b18296751e18c931e05":[0,8,0,5,3], -"classnmodl_1_1visitor_1_1_global_to_range_visitor.html#a40121374fb9a41c948c5870d68aab965":[0,8,0,5,0], -"classnmodl_1_1visitor_1_1_global_to_range_visitor.html#a9cd2cf44ddc4af5ab46848a334cf7bc1":[0,8,0,5,2], -"classnmodl_1_1visitor_1_1_global_to_range_visitor.html#ac25ca51cd3f6340904594700d60e70d7":[0,8,0,5,1], -"classnmodl_1_1visitor_1_1_index_remover.html":[2,0,0,10,12] +"classnmodl_1_1visitor_1_1_global_to_range_visitor.html#a129109fe76496b18296751e18c931e05":[0,8,0,5,3] }; diff --git a/html/doxygen/navtreeindex20.js b/html/doxygen/navtreeindex20.js index 48f2bb732c..94ab0fd4ca 100644 --- a/html/doxygen/navtreeindex20.js +++ b/html/doxygen/navtreeindex20.js @@ -1,5 +1,9 @@ var NAVTREEINDEX20 = { +"classnmodl_1_1visitor_1_1_global_to_range_visitor.html#a40121374fb9a41c948c5870d68aab965":[0,8,0,5,0], +"classnmodl_1_1visitor_1_1_global_to_range_visitor.html#a9cd2cf44ddc4af5ab46848a334cf7bc1":[0,8,0,5,2], +"classnmodl_1_1visitor_1_1_global_to_range_visitor.html#ac25ca51cd3f6340904594700d60e70d7":[0,8,0,5,1], +"classnmodl_1_1visitor_1_1_index_remover.html":[2,0,0,10,12], "classnmodl_1_1visitor_1_1_index_remover.html#a051448515c546d4c22f28e74934617b2":[2,0,0,10,12,3], "classnmodl_1_1visitor_1_1_index_remover.html#a18d9f08548dacec1ad83e0882be95a94":[2,0,0,10,12,4], "classnmodl_1_1visitor_1_1_index_remover.html#a1db3c998a8b3ed05175dc807cef05d8a":[2,0,0,10,12,0], @@ -245,9 +249,5 @@ var NAVTREEINDEX20 = "classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a1721efe17e103d88a98915de32f806d9":[0,8,0,29,128], "classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a1b92d2947ba978164e6f5d1b9b93a9b3":[0,8,0,29,45], "classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a1c3d2de2294e20b90ec5fc91483f0814":[0,8,0,29,57], -"classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a1dc6e6f9ec7a7e56991584fe3e58d0dc":[0,8,0,29,37], -"classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a20252f5fcde8471e00b6fa37c578511a":[0,8,0,29,100], -"classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a211b38a251b85232d38e0e508caee7e4":[0,8,0,29,94], -"classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a2137eab4e4fcbce592e43dac054e00c9":[0,8,0,29,82], -"classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a2365bb5125090a551193167b5b75a3fb":[0,8,0,29,66] +"classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a1dc6e6f9ec7a7e56991584fe3e58d0dc":[0,8,0,29,37] }; diff --git a/html/doxygen/navtreeindex21.js b/html/doxygen/navtreeindex21.js index d4fb5cc4b3..0e54be08aa 100644 --- a/html/doxygen/navtreeindex21.js +++ b/html/doxygen/navtreeindex21.js @@ -1,5 +1,9 @@ var NAVTREEINDEX21 = { +"classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a20252f5fcde8471e00b6fa37c578511a":[0,8,0,29,100], +"classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a211b38a251b85232d38e0e508caee7e4":[0,8,0,29,94], +"classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a2137eab4e4fcbce592e43dac054e00c9":[0,8,0,29,82], +"classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a2365bb5125090a551193167b5b75a3fb":[0,8,0,29,66], "classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a24c183f78bb123d831712725847f5237":[0,8,0,29,73], "classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a2870ad9b2a8d13903e81b4ecded10848":[0,8,0,29,85], "classnmodl_1_1visitor_1_1_meta_ast_lookup_visitor.html#a2b780cb504f51c876c523689a04e8fe8":[0,8,0,29,3], @@ -245,9 +249,5 @@ var NAVTREEINDEX21 = "classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#ae2084887d4ca745b6bc4f441d5d14495":[0,8,0,30,40], "classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#ae3d2f622816ffb271d57749e7502c963":[0,8,0,30,100], "classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#ae416fa14bfbbc730e3fdc503a5cfe48d":[0,8,0,30,106], -"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#ae4476aea91992898403e9363071b483a":[0,8,0,30,72], -"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#ae44dfe3c414bbf79ace2f7f739d1e7ec":[0,8,0,30,7], -"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#ae647f43196b57fc3d2da7a0f8d6f1f7e":[0,8,0,30,4], -"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#aea8da2c2b8209e79dccf2c31b2a39673":[0,8,0,30,71], -"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#aec3231cca826cbe2167091e36578493e":[0,8,0,30,58] +"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#ae4476aea91992898403e9363071b483a":[0,8,0,30,72] }; diff --git a/html/doxygen/navtreeindex22.js b/html/doxygen/navtreeindex22.js index 4fa195d604..de1b45368a 100644 --- a/html/doxygen/navtreeindex22.js +++ b/html/doxygen/navtreeindex22.js @@ -1,5 +1,9 @@ var NAVTREEINDEX22 = { +"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#ae44dfe3c414bbf79ace2f7f739d1e7ec":[0,8,0,30,7], +"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#ae647f43196b57fc3d2da7a0f8d6f1f7e":[0,8,0,30,4], +"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#aea8da2c2b8209e79dccf2c31b2a39673":[0,8,0,30,71], +"classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#aec3231cca826cbe2167091e36578493e":[0,8,0,30,58], "classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#aed40e6b59c06924a3fd8a95a9f25c640":[0,8,0,30,105], "classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#aed98101f3280fe85fb28603d275a81d1":[0,8,0,30,63], "classnmodl_1_1visitor_1_1_nmodl_print_visitor.html#aee3b783439677539ca37e9683ded5c1f":[0,8,0,30,39], @@ -245,9 +249,5 @@ var NAVTREEINDEX22 = "classnmodl_1_1visitor_1_1_symtab_visitor.html#a1dc5bcab7b5214270c238337deaedf3c":[0,8,0,31,30], "classnmodl_1_1visitor_1_1_symtab_visitor.html#a20942c1a25bca6fbec4f886060e847ec":[0,8,0,31,46], "classnmodl_1_1visitor_1_1_symtab_visitor.html#a265842931565decded78c0f1e387261f":[0,8,0,31,26], -"classnmodl_1_1visitor_1_1_symtab_visitor.html#a2de3df38a1fc6a8a90db039dbaad7e90":[0,8,0,31,8], -"classnmodl_1_1visitor_1_1_symtab_visitor.html#a2e95eb8066068676d7880c2ec95fe0b4":[0,8,0,31,32], -"classnmodl_1_1visitor_1_1_symtab_visitor.html#a311f6ab053e1103bd9ed6bacf3fea802":[0,8,0,31,34], -"classnmodl_1_1visitor_1_1_symtab_visitor.html#a313b25238edffd1de5ac3b8e94a51d5e":[0,8,0,31,58], -"classnmodl_1_1visitor_1_1_symtab_visitor.html#a36e427c852f7ea35cfc26c2db1baed7d":[0,8,0,31,4] +"classnmodl_1_1visitor_1_1_symtab_visitor.html#a2de3df38a1fc6a8a90db039dbaad7e90":[0,8,0,31,8] }; diff --git a/html/doxygen/navtreeindex23.js b/html/doxygen/navtreeindex23.js index 51d3739a38..987fb055ce 100644 --- a/html/doxygen/navtreeindex23.js +++ b/html/doxygen/navtreeindex23.js @@ -1,5 +1,9 @@ var NAVTREEINDEX23 = { +"classnmodl_1_1visitor_1_1_symtab_visitor.html#a2e95eb8066068676d7880c2ec95fe0b4":[0,8,0,31,32], +"classnmodl_1_1visitor_1_1_symtab_visitor.html#a311f6ab053e1103bd9ed6bacf3fea802":[0,8,0,31,34], +"classnmodl_1_1visitor_1_1_symtab_visitor.html#a313b25238edffd1de5ac3b8e94a51d5e":[0,8,0,31,58], +"classnmodl_1_1visitor_1_1_symtab_visitor.html#a36e427c852f7ea35cfc26c2db1baed7d":[0,8,0,31,4], "classnmodl_1_1visitor_1_1_symtab_visitor.html#a39816ee1bcf71b452a8b382b622f1024":[0,8,0,31,59], "classnmodl_1_1visitor_1_1_symtab_visitor.html#a3a1c1f775bfccdc4ae27ed1d8f34a5e6":[0,8,0,31,16], "classnmodl_1_1visitor_1_1_symtab_visitor.html#a3b5a4ad837c8286968a71f96349a4206":[0,8,0,31,62], @@ -245,9 +249,5 @@ var NAVTREEINDEX23 = "classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a49aa42436d3a099f698ab407510a7080":[0,8,0,35,30], "classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a4e7af6808d86b9a34bcf1029b9865011":[0,8,0,35,86], "classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a5083b18742f300d040a66eb548b459f5":[0,8,0,35,7], -"classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a50d32581613d67ff42eb7e8acc8448a5":[0,8,0,35,50], -"classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a51fda27067b3c81bbcebc6b77ab97730":[0,8,0,35,44], -"classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a527ff687f898ff1da10d68ab13fc83c8":[0,8,0,35,42], -"classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a55837596a777a9ec249b201dac856353":[0,8,0,35,123], -"classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a5a9f62b2d74928c259417900a5311b8b":[0,8,0,35,20] +"classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a50d32581613d67ff42eb7e8acc8448a5":[0,8,0,35,50] }; diff --git a/html/doxygen/navtreeindex24.js b/html/doxygen/navtreeindex24.js index edc79f34d2..b5acb84561 100644 --- a/html/doxygen/navtreeindex24.js +++ b/html/doxygen/navtreeindex24.js @@ -1,5 +1,9 @@ var NAVTREEINDEX24 = { +"classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a51fda27067b3c81bbcebc6b77ab97730":[0,8,0,35,44], +"classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a527ff687f898ff1da10d68ab13fc83c8":[0,8,0,35,42], +"classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a55837596a777a9ec249b201dac856353":[0,8,0,35,123], +"classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a5a9f62b2d74928c259417900a5311b8b":[0,8,0,35,20], "classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a5b27f63b80d2e7f400f7b37b03740df8":[0,8,0,35,36], "classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a5bd84a88485f80330a8d0c79700db3d7":[0,8,0,35,120], "classnmodl_1_1visitor_1_1test_1_1_check_parent_visitor.html#a5d2b6b718e9b5d3a840f69a7eebccfd6":[0,8,0,35,118], @@ -245,9 +249,5 @@ var NAVTREEINDEX24 = "crout_8hpp.html#ac4e38865ec9d90ba21cd713ce7d6e0d1":[3,0,1,7,0,0,2], "crout_8hpp.html#aecb1fc263eeee0d15491c8298afae290":[3,0,1,7,0,0,3], "crout_8hpp.html#af8df0cc6d5c059161eb1d90976dc75cc":[3,0,1,7,0,0,1], -"crout_8hpp_source.html":[3,0,1,7,0,0], -"define_8hpp.html":[3,0,0,0,0,0,0,26], -"define_8hpp_source.html":[3,0,0,0,0,0,0,26], -"defuse__analyze_8cpp.html":[3,0,2,0,10,2], -"defuse__analyze_8cpp.html#a9fae5beeb126eeb9fc9c48a05a882b98":[3,0,2,0,10,2,1] +"crout_8hpp_source.html":[3,0,1,7,0,0] }; diff --git a/html/doxygen/navtreeindex25.js b/html/doxygen/navtreeindex25.js index da09a3a6b0..7261d1228a 100644 --- a/html/doxygen/navtreeindex25.js +++ b/html/doxygen/navtreeindex25.js @@ -1,5 +1,9 @@ var NAVTREEINDEX25 = { +"define_8hpp.html":[3,0,0,0,0,0,0,26], +"define_8hpp_source.html":[3,0,0,0,0,0,0,26], +"defuse__analyze_8cpp.html":[3,0,2,0,10,2], +"defuse__analyze_8cpp.html#a9fae5beeb126eeb9fc9c48a05a882b98":[3,0,2,0,10,2,1], "defuse__analyze_8cpp.html#aac1ac0e30a6d6e0fffc0967c50be0df7":[3,0,2,0,10,2,0], "defuse__analyze_8cpp_source.html":[3,0,2,0,10,2], "defuse__analyze__visitor_8cpp.html":[3,0,1,11,4], @@ -155,8 +159,8 @@ var NAVTREEINDEX25 = "function__call_8hpp_source.html":[3,0,0,0,0,0,0,49], "function__table__block_8hpp.html":[3,0,0,0,0,0,0,50], "function__table__block_8hpp_source.html":[3,0,0,0,0,0,0,50], -"functions.html":[2,3,0,0], "functions.html":[2,3,0], +"functions.html":[2,3,0,0], "functions_b.html":[2,3,0,1], "functions_c.html":[2,3,0,2], "functions_d.html":[2,3,0,3], @@ -204,8 +208,8 @@ var NAVTREEINDEX25 = "functions_type.html":[2,3,3], "functions_u.html":[2,3,0,19], "functions_v.html":[2,3,0,20], -"functions_vars.html":[2,3,2,0], "functions_vars.html":[2,3,2], +"functions_vars.html":[2,3,2,0], "functions_vars_b.html":[2,3,2,1], "functions_vars_c.html":[2,3,2,2], "functions_vars_d.html":[2,3,2,3], @@ -245,9 +249,5 @@ var NAVTREEINDEX25 = "globals_b.html":[3,1,0,1], "globals_c.html":[3,1,0,2], "globals_d.html":[3,1,0,3], -"globals_defs.html":[3,1,4], -"globals_e.html":[3,1,0,4], -"globals_func.html":[3,1,1], -"globals_g.html":[3,1,0,5], -"globals_i.html":[3,1,0,6] +"globals_defs.html":[3,1,4] }; diff --git a/html/doxygen/navtreeindex26.js b/html/doxygen/navtreeindex26.js index 2c9e784d0b..0e4d714303 100644 --- a/html/doxygen/navtreeindex26.js +++ b/html/doxygen/navtreeindex26.js @@ -1,5 +1,9 @@ var NAVTREEINDEX26 = { +"globals_e.html":[3,1,0,4], +"globals_func.html":[3,1,1], +"globals_g.html":[3,1,0,5], +"globals_i.html":[3,1,0,6], "globals_j.html":[3,1,0,7], "globals_k.html":[3,1,0,8], "globals_l.html":[3,1,0,9], @@ -19,22 +23,22 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga02bcc1d4e04171fbf1fcccaf39bc0ed2":[0,0,1,257], "group__ast__class.html#ga05e0889bf71fb5b456293ae784a4830c":[0,0,1,158], "group__ast__class.html#ga05e0889bf71fb5b456293ae784a4830c":[0,0,1,4,36], -"group__ast__class.html#ga05f32148d8554d6bc8781950f0b85ac7":[0,0,1,4,58], "group__ast__class.html#ga05f32148d8554d6bc8781950f0b85ac7":[0,0,1,180], +"group__ast__class.html#ga05f32148d8554d6bc8781950f0b85ac7":[0,0,1,4,58], "group__ast__class.html#ga079817547a0614589146a2be9b03a3bb":[0,0,1,4,133], "group__ast__class.html#ga079817547a0614589146a2be9b03a3bb":[0,0,1,255], "group__ast__class.html#ga0881593dfbe4aaeabdadce8288f37bf6":[0,0,1,4,136], "group__ast__class.html#ga0881593dfbe4aaeabdadce8288f37bf6":[0,0,1,258], -"group__ast__class.html#ga088e4797a0e72d230b62aa78c3c34b5a":[0,0,1,182], "group__ast__class.html#ga088e4797a0e72d230b62aa78c3c34b5a":[0,0,1,4,60], +"group__ast__class.html#ga088e4797a0e72d230b62aa78c3c34b5a":[0,0,1,182], "group__ast__class.html#ga08b034b62cbcf576e59664949dd07b0a":[0,0,1,170], "group__ast__class.html#ga08b034b62cbcf576e59664949dd07b0a":[0,0,1,4,48], "group__ast__class.html#ga095f0dc46ba2b1463daf409e116b2cea":[0,0,1,177], "group__ast__class.html#ga095f0dc46ba2b1463daf409e116b2cea":[0,0,1,4,55], "group__ast__class.html#ga0d48ad506faa8de6dca6d5182c7d7352":[0,0,1,4,120], "group__ast__class.html#ga0d48ad506faa8de6dca6d5182c7d7352":[0,0,1,242], -"group__ast__class.html#ga0e489400312bdda6525ce3b9c1a15278":[0,0,1,127], "group__ast__class.html#ga0e489400312bdda6525ce3b9c1a15278":[0,0,1,4,5], +"group__ast__class.html#ga0e489400312bdda6525ce3b9c1a15278":[0,0,1,127], "group__ast__class.html#ga0eb03b97fd845ed86649d29e0952f571":[0,0,1,4,90], "group__ast__class.html#ga0eb03b97fd845ed86649d29e0952f571":[0,0,1,212], "group__ast__class.html#ga0f2057e5ee6d098bea109648bcc226bd":[0,0,1,4,128], @@ -45,40 +49,40 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga1477ce725c7f464ed677f67b4242e674":[0,0,1,219], "group__ast__class.html#ga15183feacb4e7aa62fbe7e1371b33620":[0,0,1,4,75], "group__ast__class.html#ga15183feacb4e7aa62fbe7e1371b33620":[0,0,1,197], -"group__ast__class.html#ga153cbb003a93974756d7842f01679902":[0,0,1,4,11], "group__ast__class.html#ga153cbb003a93974756d7842f01679902":[0,0,1,133], +"group__ast__class.html#ga153cbb003a93974756d7842f01679902":[0,0,1,4,11], "group__ast__class.html#ga171f5d1d942dd88351be072191077e47":[0,0,1,4,106], "group__ast__class.html#ga171f5d1d942dd88351be072191077e47":[0,0,1,228], "group__ast__class.html#ga1769502899ac4dcbfe36a7f340edcd02":[0,0,1,4,129], "group__ast__class.html#ga1769502899ac4dcbfe36a7f340edcd02":[0,0,1,251], -"group__ast__class.html#ga17c42e3c60a25fe417647c5937b682c9":[0,0,1,4,15], "group__ast__class.html#ga17c42e3c60a25fe417647c5937b682c9":[0,0,1,137], +"group__ast__class.html#ga17c42e3c60a25fe417647c5937b682c9":[0,0,1,4,15], "group__ast__class.html#ga1a3804b66c6c3c0e23fe0b08c9ce229e":[0,0,1,4,132], "group__ast__class.html#ga1a3804b66c6c3c0e23fe0b08c9ce229e":[0,0,1,254], "group__ast__class.html#ga1a627463ee876f902fb2baa0775ec966":[0,0,1,154], "group__ast__class.html#ga1a627463ee876f902fb2baa0775ec966":[0,0,1,4,32], "group__ast__class.html#ga1b5521cd31ec4d26c0ec8a039bf7a9c9":[0,0,1,157], "group__ast__class.html#ga1b5521cd31ec4d26c0ec8a039bf7a9c9":[0,0,1,4,35], -"group__ast__class.html#ga1f324c705485dbbeffcee8401aa1d097":[0,0,1,235], "group__ast__class.html#ga1f324c705485dbbeffcee8401aa1d097":[0,0,1,4,113], +"group__ast__class.html#ga1f324c705485dbbeffcee8401aa1d097":[0,0,1,235], "group__ast__class.html#ga20fd0174b3cb40617279a34dc49d7d67":[0,0,1,4,118], "group__ast__class.html#ga20fd0174b3cb40617279a34dc49d7d67":[0,0,1,240], "group__ast__class.html#ga259f83364b843c691a85687f247244e7":[0,0,1,186], "group__ast__class.html#ga259f83364b843c691a85687f247244e7":[0,0,1,4,64], -"group__ast__class.html#ga26205d58d3a56e11a1af97124b07a68e":[0,0,1,4,82], "group__ast__class.html#ga26205d58d3a56e11a1af97124b07a68e":[0,0,1,204], +"group__ast__class.html#ga26205d58d3a56e11a1af97124b07a68e":[0,0,1,4,82], "group__ast__class.html#ga2a8ed6832a20d3b6e5b400b6cb772ca8":[0,0,1,4,109], "group__ast__class.html#ga2a8ed6832a20d3b6e5b400b6cb772ca8":[0,0,1,231], "group__ast__class.html#ga2a96d8e7cc4dd454135b86ffd4c456e7":[0,0,1,4,122], "group__ast__class.html#ga2a96d8e7cc4dd454135b86ffd4c456e7":[0,0,1,244], "group__ast__class.html#ga2ab319dfd9eaa87327dfb00c2c006b5f":[0,0,1,4,95], "group__ast__class.html#ga2ab319dfd9eaa87327dfb00c2c006b5f":[0,0,1,217], -"group__ast__class.html#ga2d617bed8d16f6e386c7994fe14e1dcb":[0,0,1,175], "group__ast__class.html#ga2d617bed8d16f6e386c7994fe14e1dcb":[0,0,1,4,53], -"group__ast__class.html#ga2eec2446794afeca55a7dbc822fd99ba":[0,0,1,4,69], +"group__ast__class.html#ga2d617bed8d16f6e386c7994fe14e1dcb":[0,0,1,175], "group__ast__class.html#ga2eec2446794afeca55a7dbc822fd99ba":[0,0,1,191], -"group__ast__class.html#ga397e386e52928e6043ca71df9d45cfe3":[0,0,1,173], +"group__ast__class.html#ga2eec2446794afeca55a7dbc822fd99ba":[0,0,1,4,69], "group__ast__class.html#ga397e386e52928e6043ca71df9d45cfe3":[0,0,1,4,51], +"group__ast__class.html#ga397e386e52928e6043ca71df9d45cfe3":[0,0,1,173], "group__ast__class.html#ga3a1a88a6f2e3dbd4bb3acc39728f6eb0":[0,0,1,184], "group__ast__class.html#ga3a1a88a6f2e3dbd4bb3acc39728f6eb0":[0,0,1,4,62], "group__ast__class.html#ga3b6381327cb9e25b740e855660a7ff3a":[0,0,1,165], @@ -87,8 +91,8 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga3e1362838ed4cc6d1ab04e6a9fc86bf2":[0,0,1,230], "group__ast__class.html#ga3f92f72529d03053ab51c41b38a29897":[0,0,1,193], "group__ast__class.html#ga3f92f72529d03053ab51c41b38a29897":[0,0,1,4,71], -"group__ast__class.html#ga4303bc795f23f0909cd1ac655c098ed4":[0,0,1,4,19], "group__ast__class.html#ga4303bc795f23f0909cd1ac655c098ed4":[0,0,1,141], +"group__ast__class.html#ga4303bc795f23f0909cd1ac655c098ed4":[0,0,1,4,19], "group__ast__class.html#ga4892777c5b32b112d588b05d07f28549":[0,0,1,136], "group__ast__class.html#ga4892777c5b32b112d588b05d07f28549":[0,0,1,4,14], "group__ast__class.html#ga4ac0e01057626ba84f0511ea12370956":[0,0,1,162], @@ -137,8 +141,8 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga6eadddbece7bcde0e0198e61b707d4c4":[0,0,1,241], "group__ast__class.html#ga738d9e9a7e344c5086e37cffc4be1d2f":[0,0,1,4,98], "group__ast__class.html#ga738d9e9a7e344c5086e37cffc4be1d2f":[0,0,1,220], -"group__ast__class.html#ga7955eda5565d690e7acfaead092c56aa":[0,0,1,4,3], "group__ast__class.html#ga7955eda5565d690e7acfaead092c56aa":[0,0,1,124], +"group__ast__class.html#ga7955eda5565d690e7acfaead092c56aa":[0,0,1,4,3], "group__ast__class.html#ga7bb648c89549d0a1440c348da8db48cd":[0,0,1,4,78], "group__ast__class.html#ga7bb648c89549d0a1440c348da8db48cd":[0,0,1,200], "group__ast__class.html#ga7f8b85b161e9540da809bccbf8b667d0":[0,0,1,4,114], @@ -157,8 +161,8 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga8b7765bb1b32cac9e1d3cef796b747ac":[0,0,1,260], "group__ast__class.html#ga8e133edb6222fbee34e5f0d342797ee4":[0,0,1,4,9], "group__ast__class.html#ga8e133edb6222fbee34e5f0d342797ee4":[0,0,1,131], -"group__ast__class.html#ga90a102823381b1f8e6047a1af748056e":[0,0,1,145], "group__ast__class.html#ga90a102823381b1f8e6047a1af748056e":[0,0,1,4,23], +"group__ast__class.html#ga90a102823381b1f8e6047a1af748056e":[0,0,1,145], "group__ast__class.html#ga92a0562e9202ed00c90134bccbc09972":[0,0,1,4,91], "group__ast__class.html#ga92a0562e9202ed00c90134bccbc09972":[0,0,1,213], "group__ast__class.html#ga9313a4af4b7e130f1ff85aa1e11882ab":[0,0,1,192], @@ -171,14 +175,14 @@ var NAVTREEINDEX26 = "group__ast__class.html#ga958228cd1a203da6fea17efac8165a59":[0,0,1,4,45], "group__ast__class.html#ga9a9684461a0f1ce3adb845a0715b1b9e":[0,0,1,4,8], "group__ast__class.html#ga9a9684461a0f1ce3adb845a0715b1b9e":[0,0,1,130], -"group__ast__class.html#ga9af56bff5b44e1074a94e9c357e255bf":[0,0,1,4,33], "group__ast__class.html#ga9af56bff5b44e1074a94e9c357e255bf":[0,0,1,155], +"group__ast__class.html#ga9af56bff5b44e1074a94e9c357e255bf":[0,0,1,4,33], "group__ast__class.html#gaa55f3ea9308348d5140290e34c4b06dd":[0,0,1,4,87], "group__ast__class.html#gaa55f3ea9308348d5140290e34c4b06dd":[0,0,1,209], -"group__ast__class.html#gaa680ed2587655b4f6b771db6584b22cc":[0,0,1,196], "group__ast__class.html#gaa680ed2587655b4f6b771db6584b22cc":[0,0,1,4,74], -"group__ast__class.html#gaa7d7dc200bbee1fe9619323965a1715e":[0,0,1,188], +"group__ast__class.html#gaa680ed2587655b4f6b771db6584b22cc":[0,0,1,196], "group__ast__class.html#gaa7d7dc200bbee1fe9619323965a1715e":[0,0,1,4,66], +"group__ast__class.html#gaa7d7dc200bbee1fe9619323965a1715e":[0,0,1,188], "group__ast__class.html#gaa7e0498bd12a174ddff55d9f4987c0b6":[0,0,1,4,96], "group__ast__class.html#gaa7e0498bd12a174ddff55d9f4987c0b6":[0,0,1,218], "group__ast__class.html#gaa892d22eb06997da03dc7a433f14ba1e":[0,0,1,4,125], @@ -193,18 +197,18 @@ var NAVTREEINDEX26 = "group__ast__class.html#gaad130e3dba2180cd1f12d7e3925f6802":[0,0,1,198], "group__ast__class.html#gaade2043ac7883b4d0873b473042f930d":[0,0,1,238], "group__ast__class.html#gaade2043ac7883b4d0873b473042f930d":[0,0,1,4,116], -"group__ast__class.html#gaafdc39f0529d0879f741f525181bb756":[0,0,1,4,26], "group__ast__class.html#gaafdc39f0529d0879f741f525181bb756":[0,0,1,148], +"group__ast__class.html#gaafdc39f0529d0879f741f525181bb756":[0,0,1,4,26], "group__ast__class.html#gaafe0391f61c4d985226cf91abf6d0ea6":[0,0,1,183], "group__ast__class.html#gaafe0391f61c4d985226cf91abf6d0ea6":[0,0,1,4,61], "group__ast__class.html#gab0ca0546b6c94aa502549453ff611811":[0,0,1,195], "group__ast__class.html#gab0ca0546b6c94aa502549453ff611811":[0,0,1,4,73], -"group__ast__class.html#gab2ab7390c9aa9a581525ec7b2a8ddb64":[0,0,1,4,88], "group__ast__class.html#gab2ab7390c9aa9a581525ec7b2a8ddb64":[0,0,1,210], +"group__ast__class.html#gab2ab7390c9aa9a581525ec7b2a8ddb64":[0,0,1,4,88], "group__ast__class.html#gab2f01c121a37f709051e291fed2cc6e1":[0,0,1,187], "group__ast__class.html#gab2f01c121a37f709051e291fed2cc6e1":[0,0,1,4,65], -"group__ast__class.html#gab35a10b4c8f5ca2515f0bb122853e447":[0,0,1,4,38], "group__ast__class.html#gab35a10b4c8f5ca2515f0bb122853e447":[0,0,1,160], +"group__ast__class.html#gab35a10b4c8f5ca2515f0bb122853e447":[0,0,1,4,38], "group__ast__class.html#gab48e965f9bfc5beef90fec6c0d59b6ec":[0,0,1,4,89], "group__ast__class.html#gab48e965f9bfc5beef90fec6c0d59b6ec":[0,0,1,211], "group__ast__class.html#gab97c8fbc73008d36927a0377335bc0ba":[0,0,1,4,127], @@ -213,8 +217,8 @@ var NAVTREEINDEX26 = "group__ast__class.html#gaba93060c77072b4da627b13e7ab5fbd8":[0,0,1,4,34], "group__ast__class.html#gabcce17a4b7c2abd423cf2319dc492f24":[0,0,1,248], "group__ast__class.html#gabcce17a4b7c2abd423cf2319dc492f24":[0,0,1,4,126], -"group__ast__class.html#gabdc81c1d11f50f067df4cf0d7746f110":[0,0,1,4,29], "group__ast__class.html#gabdc81c1d11f50f067df4cf0d7746f110":[0,0,1,151], +"group__ast__class.html#gabdc81c1d11f50f067df4cf0d7746f110":[0,0,1,4,29], "group__ast__class.html#gabe0d8be79f0e0c0967da29d186c86c3c":[0,0,1,4,6], "group__ast__class.html#gabe0d8be79f0e0c0967da29d186c86c3c":[0,0,1,128], "group__ast__class.html#gabf2f9f79aaa6163faccf95beec66c585":[0,0,1,4,86], @@ -227,27 +231,23 @@ var NAVTREEINDEX26 = "group__ast__class.html#gac38a02afaac3a75f0c66f0d351bf9c04":[0,0,1,4,50], "group__ast__class.html#gac58c77a74f980986b6588a285c12d408":[0,0,1,185], "group__ast__class.html#gac58c77a74f980986b6588a285c12d408":[0,0,1,4,63], -"group__ast__class.html#gac59852558ed3eaf48643738b5a00f1ad":[0,0,1,4,111], "group__ast__class.html#gac59852558ed3eaf48643738b5a00f1ad":[0,0,1,233], -"group__ast__class.html#gac6117017139fe43441831581205b087b":[0,0,1,123], +"group__ast__class.html#gac59852558ed3eaf48643738b5a00f1ad":[0,0,1,4,111], "group__ast__class.html#gac6117017139fe43441831581205b087b":[0,0,1,4,2], +"group__ast__class.html#gac6117017139fe43441831581205b087b":[0,0,1,123], "group__ast__class.html#gac774fd9ccb62cfdba927225ef59a4de3":[0,0,1,4,103], "group__ast__class.html#gac774fd9ccb62cfdba927225ef59a4de3":[0,0,1,225], "group__ast__class.html#gac81ffb4a2c7ca8ce7527f2b8c3b9d403":[0,0,1,4,143], "group__ast__class.html#gac81ffb4a2c7ca8ce7527f2b8c3b9d403":[0,0,1,265], "group__ast__class.html#gac8ca9b958f672aac8f178f6df6a4bd05":[0,0,1,4,102], "group__ast__class.html#gac8ca9b958f672aac8f178f6df6a4bd05":[0,0,1,224], -"group__ast__class.html#gacab8b02244ee74dd512a5eba7c83e149":[0,0,1,142], "group__ast__class.html#gacab8b02244ee74dd512a5eba7c83e149":[0,0,1,4,20], +"group__ast__class.html#gacab8b02244ee74dd512a5eba7c83e149":[0,0,1,142], "group__ast__class.html#gacb568ad839f6ec0eae735e8cf96c8ae7":[0,0,1,4,10], "group__ast__class.html#gacb568ad839f6ec0eae735e8cf96c8ae7":[0,0,1,132], -"group__ast__class.html#gacb75345ef088d81fcbc33cf08b5dcde3":[0,0,1,143], "group__ast__class.html#gacb75345ef088d81fcbc33cf08b5dcde3":[0,0,1,4,21], +"group__ast__class.html#gacb75345ef088d81fcbc33cf08b5dcde3":[0,0,1,143], "group__ast__class.html#gaccf0eb232f3f92727a805fdb96012a2c":[0,0,1,4,139], "group__ast__class.html#gaccf0eb232f3f92727a805fdb96012a2c":[0,0,1,261], -"group__ast__class.html#gacd652af0b9dd48cd7fee5e26aa19ed71":[0,0,1,4,41], -"group__ast__class.html#gacd652af0b9dd48cd7fee5e26aa19ed71":[0,0,1,163], -"group__ast__class.html#gacf97186289f358ea51959f4285f870cb":[0,0,1,169], -"group__ast__class.html#gacf97186289f358ea51959f4285f870cb":[0,0,1,4,47], -"group__ast__class.html#gad0fc98ce521337690e9715bbc8e52848":[0,0,1,4,79] +"group__ast__class.html#gacd652af0b9dd48cd7fee5e26aa19ed71":[0,0,1,163] }; diff --git a/html/doxygen/navtreeindex27.js b/html/doxygen/navtreeindex27.js index c47dcf8735..66d6b2175a 100644 --- a/html/doxygen/navtreeindex27.js +++ b/html/doxygen/navtreeindex27.js @@ -1,32 +1,36 @@ var NAVTREEINDEX27 = { +"group__ast__class.html#gacd652af0b9dd48cd7fee5e26aa19ed71":[0,0,1,4,41], +"group__ast__class.html#gacf97186289f358ea51959f4285f870cb":[0,0,1,169], +"group__ast__class.html#gacf97186289f358ea51959f4285f870cb":[0,0,1,4,47], +"group__ast__class.html#gad0fc98ce521337690e9715bbc8e52848":[0,0,1,4,79], "group__ast__class.html#gad0fc98ce521337690e9715bbc8e52848":[0,0,1,201], "group__ast__class.html#gad1f90104022d3c27fc1111d3d75a7057":[0,0,1,4,67], "group__ast__class.html#gad1f90104022d3c27fc1111d3d75a7057":[0,0,1,189], -"group__ast__class.html#gad3aeaf59438aab6d10b5b6eca24ee7b2":[0,0,1,152], "group__ast__class.html#gad3aeaf59438aab6d10b5b6eca24ee7b2":[0,0,1,4,30], +"group__ast__class.html#gad3aeaf59438aab6d10b5b6eca24ee7b2":[0,0,1,152], "group__ast__class.html#gad7bcccf631ed5bf00705df5d1c0e5669":[0,0,1,4,72], "group__ast__class.html#gad7bcccf631ed5bf00705df5d1c0e5669":[0,0,1,194], -"group__ast__class.html#gad7e9018d9c607b42fcec41da33ef7ffc":[0,0,1,4,17], "group__ast__class.html#gad7e9018d9c607b42fcec41da33ef7ffc":[0,0,1,139], +"group__ast__class.html#gad7e9018d9c607b42fcec41da33ef7ffc":[0,0,1,4,17], "group__ast__class.html#gad9186bccf4349f4dc1b42448422151a5":[0,0,1,4,1], "group__ast__class.html#gad9186bccf4349f4dc1b42448422151a5":[0,0,1,266], -"group__ast__class.html#gad920434f140f771242aed6060526a3ba":[0,0,1,146], "group__ast__class.html#gad920434f140f771242aed6060526a3ba":[0,0,1,4,24], +"group__ast__class.html#gad920434f140f771242aed6060526a3ba":[0,0,1,146], "group__ast__class.html#gad920ec3fd8147522e85d67bfacb8ebdd":[0,0,1,159], "group__ast__class.html#gad920ec3fd8147522e85d67bfacb8ebdd":[0,0,1,4,37], -"group__ast__class.html#gada2c56cc8f8f252d8ebed343eb863985":[0,0,1,262], "group__ast__class.html#gada2c56cc8f8f252d8ebed343eb863985":[0,0,1,4,140], +"group__ast__class.html#gada2c56cc8f8f252d8ebed343eb863985":[0,0,1,262], "group__ast__class.html#gadaf9e897c21c83aa9fd6984a839aeaf1":[0,0,1,4,94], "group__ast__class.html#gadaf9e897c21c83aa9fd6984a839aeaf1":[0,0,1,216], -"group__ast__class.html#gade58bfc61f86b2713d50b523aee0c92f":[0,0,1,4,59], "group__ast__class.html#gade58bfc61f86b2713d50b523aee0c92f":[0,0,1,181], +"group__ast__class.html#gade58bfc61f86b2713d50b523aee0c92f":[0,0,1,4,59], "group__ast__class.html#gae0579e9d3a6f697fcd4ab022eba3ed6d":[0,0,1,4,101], "group__ast__class.html#gae0579e9d3a6f697fcd4ab022eba3ed6d":[0,0,1,223], "group__ast__class.html#gae12e18a06af2fd43a83356f1cd75b66d":[0,0,1,4,81], "group__ast__class.html#gae12e18a06af2fd43a83356f1cd75b66d":[0,0,1,203], -"group__ast__class.html#gae136e55afd10a9c0a4f7de0134ab4593":[0,0,1,4,77], "group__ast__class.html#gae136e55afd10a9c0a4f7de0134ab4593":[0,0,1,199], +"group__ast__class.html#gae136e55afd10a9c0a4f7de0134ab4593":[0,0,1,4,77], "group__ast__class.html#gae1ca73bd18179c2c3a1c3a2751043437":[0,0,1,4,130], "group__ast__class.html#gae1ca73bd18179c2c3a1c3a2751043437":[0,0,1,252], "group__ast__class.html#gae2d80677a97c3b1ac8690d73c74be890":[0,0,1,179], @@ -35,22 +39,22 @@ var NAVTREEINDEX27 = "group__ast__class.html#gae340624f70b3f7f3670f17f8de45d1fc":[0,0,1,4,44], "group__ast__class.html#gae3fb3e72b2a86631da0a81cbeb96a2e3":[0,0,1,4,124], "group__ast__class.html#gae3fb3e72b2a86631da0a81cbeb96a2e3":[0,0,1,246], -"group__ast__class.html#gae8ed322d9d79b71a4dd96252e8266a3f":[0,0,1,4,49], "group__ast__class.html#gae8ed322d9d79b71a4dd96252e8266a3f":[0,0,1,171], -"group__ast__class.html#gaea4ef0d9fa16aa06d9167dd81f411913":[0,0,1,234], +"group__ast__class.html#gae8ed322d9d79b71a4dd96252e8266a3f":[0,0,1,4,49], "group__ast__class.html#gaea4ef0d9fa16aa06d9167dd81f411913":[0,0,1,4,112], +"group__ast__class.html#gaea4ef0d9fa16aa06d9167dd81f411913":[0,0,1,234], "group__ast__class.html#gaed858f15cec95707094262eff7f96003":[0,0,1,4,121], "group__ast__class.html#gaed858f15cec95707094262eff7f96003":[0,0,1,243], -"group__ast__class.html#gaee1e3d29559569a7dc809ba13fac4d80":[0,0,1,153], "group__ast__class.html#gaee1e3d29559569a7dc809ba13fac4d80":[0,0,1,4,31], -"group__ast__class.html#gaefcd48a1c371deac5a65b9ccf68a3cdf":[0,0,1,205], +"group__ast__class.html#gaee1e3d29559569a7dc809ba13fac4d80":[0,0,1,153], "group__ast__class.html#gaefcd48a1c371deac5a65b9ccf68a3cdf":[0,0,1,4,83], +"group__ast__class.html#gaefcd48a1c371deac5a65b9ccf68a3cdf":[0,0,1,205], "group__ast__class.html#gaf47927781853e1b1d888dc16b227b2e8":[0,0,1,4,80], "group__ast__class.html#gaf47927781853e1b1d888dc16b227b2e8":[0,0,1,202], "group__ast__class.html#gaf59c475a99ee7363dc08790004763366":[0,0,1,178], "group__ast__class.html#gaf59c475a99ee7363dc08790004763366":[0,0,1,4,56], -"group__ast__class.html#gaf9abed7526427801c191fbaa4fae2e94":[0,0,1,4,22], "group__ast__class.html#gaf9abed7526427801c191fbaa4fae2e94":[0,0,1,144], +"group__ast__class.html#gaf9abed7526427801c191fbaa4fae2e94":[0,0,1,4,22], "group__ast__class.html#gafca2d0b12ebffe60535c7527189cc089":[0,0,1,140], "group__ast__class.html#gafca2d0b12ebffe60535c7527189cc089":[0,0,1,4,18], "group__ast__class.html#gafedb2d6f0c7f3ea73c34947fed8a2d6b":[0,0,1,147], @@ -245,9 +249,5 @@ var NAVTREEINDEX27 = "group__ast__vec__type.html#ga29058ca56c7ca54ae3fd5acf4ae7dc91":[0,0,3,45], "group__ast__vec__type.html#ga2bc857276d550134ab7eb6b4dd4eba4f":[0,0,3,60], "group__ast__vec__type.html#ga2be6252d13f9d41153c5cc65938fa641":[0,0,3,16], -"group__ast__vec__type.html#ga2d8da6e180f37bc5d8c70e0a6129190d":[0,0,3,10], -"group__ast__vec__type.html#ga3283450e34bd607f7811fe34f5bfba12":[0,0,3,40], -"group__ast__vec__type.html#ga3511d83b2ba0ac04c5be67f6809aefef":[0,0,3,61], -"group__ast__vec__type.html#ga397657e98a820bffa2a7d77756970c0d":[0,0,3,81], -"group__ast__vec__type.html#ga39d85b84b75eb64da229ce6126a14815":[0,0,3,32] +"group__ast__vec__type.html#ga2d8da6e180f37bc5d8c70e0a6129190d":[0,0,3,10] }; diff --git a/html/doxygen/navtreeindex28.js b/html/doxygen/navtreeindex28.js index 056f8ecbe8..24d15907ea 100644 --- a/html/doxygen/navtreeindex28.js +++ b/html/doxygen/navtreeindex28.js @@ -1,5 +1,9 @@ var NAVTREEINDEX28 = { +"group__ast__vec__type.html#ga3283450e34bd607f7811fe34f5bfba12":[0,0,3,40], +"group__ast__vec__type.html#ga3511d83b2ba0ac04c5be67f6809aefef":[0,0,3,61], +"group__ast__vec__type.html#ga397657e98a820bffa2a7d77756970c0d":[0,0,3,81], +"group__ast__vec__type.html#ga39d85b84b75eb64da229ce6126a14815":[0,0,3,32], "group__ast__vec__type.html#ga3b42311790865c9f4ed1cd963b36fc59":[0,0,3,22], "group__ast__vec__type.html#ga3fa547a7a2c751581063c09420c195e0":[0,0,3,121], "group__ast__vec__type.html#ga4204478b34e54d7328143823b2917049":[0,0,3,41], @@ -90,12 +94,12 @@ var NAVTREEINDEX28 = "group__ast__vec__type.html#gafcd60e4a0a5c7f255fe5fcb69597fb35":[0,0,3,103], "group__codegen.html":[0,1], "group__codegen__backends.html":[0,1,0], -"group__codegen__backends.html#ga743bcd56c5822a14381fd87fe586ed6c":[0,1,0,3,96], "group__codegen__backends.html#ga743bcd56c5822a14381fd87fe586ed6c":[0,1,0,7], +"group__codegen__backends.html#ga743bcd56c5822a14381fd87fe586ed6c":[0,1,0,3,103], +"group__codegen__backends.html#gabd283274182774ed39c08a0714842d43":[0,1,0,4,24], "group__codegen__backends.html#gabd283274182774ed39c08a0714842d43":[0,1,0,5], -"group__codegen__backends.html#gabd283274182774ed39c08a0714842d43":[0,1,0,4,22], "group__codegen__backends.html#gaebe64f7d52f5cb96d8c73c1619bddabf":[0,1,0,6], -"group__codegen__backends.html#gaebe64f7d52f5cb96d8c73c1619bddabf":[0,1,0,2,54], +"group__codegen__backends.html#gaebe64f7d52f5cb96d8c73c1619bddabf":[0,1,0,2,49], "group__codegen__details.html":[0,1,1], "group__codegen__details.html#ga2d0a1f473f039b495e9cc349c3b57dbb":[0,1,1,8], "group__codegen__details.html#gab185b9278fbfff591fbe3da84ba22d0b":[0,1,1,9], @@ -133,33 +137,33 @@ var NAVTREEINDEX28 = "group__token__test.html":[0,2,1], "group__token__test.html#ga0da85adf566fc93b8d173fa4117ccb74":[0,2,1,3], "group__token__test.html#ga0da85adf566fc93b8d173fa4117ccb74":[3,0,2,0,3,0,3], -"group__token__test.html#ga46008ea4532600b05a677394c6600055":[0,2,1,2], "group__token__test.html#ga46008ea4532600b05a677394c6600055":[3,0,2,0,3,0,2], -"group__token__test.html#ga752aa45201ab43cc2d13b3ce5a5f1144":[3,0,2,0,3,0,1], +"group__token__test.html#ga46008ea4532600b05a677394c6600055":[0,2,1,2], "group__token__test.html#ga752aa45201ab43cc2d13b3ce5a5f1144":[0,2,1,1], -"group__token__test.html#ga9cd6cc464d230725aacf2bf9d41d364e":[0,2,1,0], +"group__token__test.html#ga752aa45201ab43cc2d13b3ce5a5f1144":[3,0,2,0,3,0,1], "group__token__test.html#ga9cd6cc464d230725aacf2bf9d41d364e":[3,0,2,0,3,0,0], +"group__token__test.html#ga9cd6cc464d230725aacf2bf9d41d364e":[0,2,1,0], "group__units.html":[0,6], -"group__units.html#ga08e9b606cb5ea92658765b82a886f2f8":[0,6,1,4], "group__units.html#ga08e9b606cb5ea92658765b82a886f2f8":[0,6,8], +"group__units.html#ga08e9b606cb5ea92658765b82a886f2f8":[0,6,1,4], "group__units.html#ga141975968d2f0eef8cfc36d80e8962c8":[0,6,13], "group__units.html#ga141975968d2f0eef8cfc36d80e8962c8":[0,6,0,0], "group__units.html#ga20d9e1e26895ee030dff6ddb27124548":[0,6,15], "group__units.html#ga20d9e1e26895ee030dff6ddb27124548":[0,6,1,7], -"group__units.html#ga31bdaa723dc74c12a9bf1a652561d6e7":[0,6,19], "group__units.html#ga31bdaa723dc74c12a9bf1a652561d6e7":[0,6,1,9], +"group__units.html#ga31bdaa723dc74c12a9bf1a652561d6e7":[0,6,19], "group__units.html#ga330f86b461ce0320cd23e935b710be05":[0,6,20], "group__units.html#ga330f86b461ce0320cd23e935b710be05":[0,6,1,10], -"group__units.html#ga3a8c3503da97aeee3d242ddafb52774a":[0,6,1,11], "group__units.html#ga3a8c3503da97aeee3d242ddafb52774a":[0,6,21], -"group__units.html#ga4014c46fced93378dee7846b57211f6e":[0,6,18], +"group__units.html#ga3a8c3503da97aeee3d242ddafb52774a":[0,6,1,11], "group__units.html#ga4014c46fced93378dee7846b57211f6e":[0,6,1,8], +"group__units.html#ga4014c46fced93378dee7846b57211f6e":[0,6,18], "group__units.html#ga53666d277469c1f00a3b0fd26a094178":[0,6,9], "group__units.html#ga53666d277469c1f00a3b0fd26a094178":[0,6,1,5], "group__units.html#ga5beb2f005efacceb06427827ef45bf15":[0,6,6], "group__units.html#ga5beb2f005efacceb06427827ef45bf15":[0,6,0,2], -"group__units.html#ga7ffa76ac1fa5595a4aa1f0f703b34717":[0,6,10], "group__units.html#ga7ffa76ac1fa5595a4aa1f0f703b34717":[0,6,1,6], +"group__units.html#ga7ffa76ac1fa5595a4aa1f0f703b34717":[0,6,10], "group__units.html#gaaae2d7f1693c0e7abc23003e753d65ec":[0,6,11], "group__units.html#gaaae2d7f1693c0e7abc23003e753d65ec":[0,6,1,0], "group__units.html#gaac93a10252a81387387be4571bbed890":[0,6,5], @@ -169,10 +173,10 @@ var NAVTREEINDEX28 = "group__units.html#gac26c7781e0924f73bac6a856f2c80217":[0,6,17], "group__units.html#gacf73317c537bff91a6631c0c4f4cded0":[0,6,0,3], "group__units.html#gacf73317c537bff91a6631c0c4f4cded0":[0,6,16], -"group__units.html#gae0d4c7dbd75815ee53391809a8dac74d":[0,6,1,1], "group__units.html#gae0d4c7dbd75815ee53391809a8dac74d":[0,6,12], -"group__units.html#gae62d367c779588c163dcfe9cdd9efa37":[0,6,1,3], +"group__units.html#gae0d4c7dbd75815ee53391809a8dac74d":[0,6,1,1], "group__units.html#gae62d367c779588c163dcfe9cdd9efa37":[0,6,7], +"group__units.html#gae62d367c779588c163dcfe9cdd9efa37":[0,6,1,3], "group__utils.html":[0,7], "group__utils.html#ga08a8b444018d46999224618bb102b3e5":[0,7,8], "group__utils.html#ga09e2cad122ecf35cb2d5fbfc4b1daa2e":[0,7,9], @@ -245,9 +249,5 @@ var NAVTREEINDEX28 = "inline__visitor_8hpp.html":[3,0,1,11,13], "inline__visitor_8hpp_source.html":[3,0,1,11,13], "integer_8hpp.html":[3,0,0,0,0,0,0,59], -"integer_8hpp_source.html":[3,0,0,0,0,0,0,59], -"json_8cpp.html":[3,0,2,0,10,6], -"json_8cpp.html#a53909b6efcd1637a5577654c3b317abc":[3,0,2,0,10,6,1], -"json_8cpp.html#a98fabdf620a41219aec948054625439d":[3,0,2,0,10,6,2], -"json_8cpp.html#ab701e3ac61a85b337ec5c1abaad6742d":[3,0,2,0,10,6,0] +"integer_8hpp_source.html":[3,0,0,0,0,0,0,59] }; diff --git a/html/doxygen/navtreeindex29.js b/html/doxygen/navtreeindex29.js index 2f3966efdc..100d1ef91d 100644 --- a/html/doxygen/navtreeindex29.js +++ b/html/doxygen/navtreeindex29.js @@ -1,5 +1,9 @@ var NAVTREEINDEX29 = { +"json_8cpp.html":[3,0,2,0,10,6], +"json_8cpp.html#a53909b6efcd1637a5577654c3b317abc":[3,0,2,0,10,6,1], +"json_8cpp.html#a98fabdf620a41219aec948054625439d":[3,0,2,0,10,6,2], +"json_8cpp.html#ab701e3ac61a85b337ec5c1abaad6742d":[3,0,2,0,10,6,0], "json_8cpp_source.html":[3,0,2,0,10,6], "json__printer_8cpp.html":[3,0,1,5,3], "json__printer_8cpp_source.html":[3,0,1,5,3], @@ -164,8 +168,8 @@ var NAVTREEINDEX29 = "namespacemembers_w.html":[1,1,0,21], "namespacenmodl.html":[2,0,0], "namespacenmodl.html":[1,0,0], -"namespacenmodl_1_1ast.html":[1,0,0,0], "namespacenmodl_1_1ast.html":[2,0,0,0], +"namespacenmodl_1_1ast.html":[1,0,0,0], "namespacenmodl_1_1codegen.html":[2,0,0,1], "namespacenmodl_1_1codegen.html":[1,0,0,1], "namespacenmodl_1_1codegen_1_1naming.html":[1,0,0,1,0], @@ -175,28 +179,28 @@ var NAVTREEINDEX29 = "namespacenmodl_1_1details.html":[1,0,0,3], "namespacenmodl_1_1docstring.html":[1,0,0,4], "namespacenmodl_1_1newton.html":[1,0,0,5], -"namespacenmodl_1_1parser.html":[1,0,0,6], "namespacenmodl_1_1parser.html":[2,0,0,3], +"namespacenmodl_1_1parser.html":[1,0,0,6], "namespacenmodl_1_1parser_1_1diffeq.html":[1,0,0,6,0], "namespacenmodl_1_1parser_1_1diffeq.html":[2,0,0,3,0], "namespacenmodl_1_1printer.html":[1,0,0,7], "namespacenmodl_1_1printer.html":[2,0,0,4], -"namespacenmodl_1_1pybind__wrappers.html":[1,0,0,8], "namespacenmodl_1_1pybind__wrappers.html":[2,0,0,5], +"namespacenmodl_1_1pybind__wrappers.html":[1,0,0,8], "namespacenmodl_1_1stringutils.html":[1,0,0,9], -"namespacenmodl_1_1symtab.html":[2,0,0,6], "namespacenmodl_1_1symtab.html":[1,0,0,10], +"namespacenmodl_1_1symtab.html":[2,0,0,6], "namespacenmodl_1_1symtab_1_1syminfo.html":[1,0,0,10,0], "namespacenmodl_1_1test__utils.html":[1,0,0,11], "namespacenmodl_1_1test__utils.html":[2,0,0,7], "namespacenmodl_1_1units.html":[2,0,0,8], "namespacenmodl_1_1units.html":[1,0,0,12], -"namespacenmodl_1_1utils.html":[1,0,0,13], "namespacenmodl_1_1utils.html":[2,0,0,9], -"namespacenmodl_1_1visitor.html":[1,0,0,14], +"namespacenmodl_1_1utils.html":[1,0,0,13], "namespacenmodl_1_1visitor.html":[2,0,0,10], -"namespacenmodl_1_1visitor_1_1test.html":[2,0,0,10,0], +"namespacenmodl_1_1visitor.html":[1,0,0,14], "namespacenmodl_1_1visitor_1_1test.html":[1,0,0,14,0], +"namespacenmodl_1_1visitor_1_1test.html":[2,0,0,10,0], "namespaces.html":[1,0], "net__receive__block_8hpp.html":[3,0,0,0,0,0,0,73], "net__receive__block_8hpp_source.html":[3,0,0,0,0,0,0,73], @@ -245,9 +249,5 @@ var NAVTREEINDEX29 = "nmodl__constructs_8hpp_source.html":[3,0,2,0,9,1], "nmodl__driver_8cpp.html":[3,0,1,4,10], "nmodl__driver_8cpp_source.html":[3,0,1,4,10], -"nmodl__driver_8hpp.html":[3,0,1,4,11], -"nmodl__driver_8hpp_source.html":[3,0,1,4,11], -"nmodl__lexer_8hpp.html":[3,0,1,3,8], -"nmodl__lexer_8hpp.html#ae5b01ac2fa5a6ad5fb97559638abe686":[3,0,1,3,8,0], -"nmodl__lexer_8hpp.html#af699458ba5331ddec7e15a878f42f8f5":[3,0,1,3,8,1] +"nmodl__driver_8hpp.html":[3,0,1,4,11] }; diff --git a/html/doxygen/navtreeindex30.js b/html/doxygen/navtreeindex30.js index 12957fbccd..6bbe9c5dc8 100644 --- a/html/doxygen/navtreeindex30.js +++ b/html/doxygen/navtreeindex30.js @@ -1,5 +1,9 @@ var NAVTREEINDEX30 = { +"nmodl__driver_8hpp_source.html":[3,0,1,4,11], +"nmodl__lexer_8hpp.html":[3,0,1,3,8], +"nmodl__lexer_8hpp.html#ae5b01ac2fa5a6ad5fb97559638abe686":[3,0,1,3,8,0], +"nmodl__lexer_8hpp.html#af699458ba5331ddec7e15a878f42f8f5":[3,0,1,3,8,1], "nmodl__lexer_8hpp_source.html":[3,0,1,3,8], "nmodl__printer_8cpp.html":[3,0,1,5,5], "nmodl__printer_8cpp_source.html":[3,0,1,5,5], @@ -245,9 +249,5 @@ var NAVTREEINDEX30 = "steadystate__visitor_8cpp_source.html":[3,0,1,11,36], "steadystate__visitor_8hpp.html":[3,0,1,11,37], "steadystate__visitor_8hpp_source.html":[3,0,1,11,37], -"string_8hpp.html":[3,0,0,0,0,0,0,106], -"string_8hpp_source.html":[3,0,0,0,0,0,0,106], -"string__utils_8cpp.html":[3,0,1,10,8], -"string__utils_8cpp.html#gadedfb99b5da8fe0c5995b5e881875d45":[3,0,1,10,8,0], -"string__utils_8cpp_source.html":[3,0,1,10,8] +"string_8hpp.html":[3,0,0,0,0,0,0,106] }; diff --git a/html/doxygen/navtreeindex31.js b/html/doxygen/navtreeindex31.js index 5125713425..60fcaa482f 100644 --- a/html/doxygen/navtreeindex31.js +++ b/html/doxygen/navtreeindex31.js @@ -1,5 +1,9 @@ var NAVTREEINDEX31 = { +"string_8hpp_source.html":[3,0,0,0,0,0,0,106], +"string__utils_8cpp.html":[3,0,1,10,8], +"string__utils_8cpp.html#gadedfb99b5da8fe0c5995b5e881875d45":[3,0,1,10,8,0], +"string__utils_8cpp_source.html":[3,0,1,10,8], "string__utils_8hpp.html":[3,0,1,10,9], "string__utils_8hpp.html#ga09e2cad122ecf35cb2d5fbfc4b1daa2e":[3,0,1,10,9,3], "string__utils_8hpp.html#ga287cad41afb0bf66e8767af03a681894":[3,0,1,10,9,1], @@ -245,9 +249,5 @@ var NAVTREEINDEX31 = "structnmodl_1_1utils_1_1_perf_stat.html#a0fee5c14734f25375e5fe87bd386ff8d":[0,7,1,27], "structnmodl_1_1utils_1_1_perf_stat.html#a133f90d3e38f8b1d12b9a2fc3a71f3d3":[0,7,1,16], "structnmodl_1_1utils_1_1_perf_stat.html#a16a7f24dcd16016e8ff74529ff279cbf":[0,7,1,5], -"structnmodl_1_1utils_1_1_perf_stat.html#a173b9fab2ffbd6bfc4e32ab349eeb02a":[0,7,1,6], -"structnmodl_1_1utils_1_1_perf_stat.html#a199d3a4ce658889efc3bce2c83e90505":[0,7,1,34], -"structnmodl_1_1utils_1_1_perf_stat.html#a1ae5a6a039afaaef47fdc302ead7a413":[0,7,1,1], -"structnmodl_1_1utils_1_1_perf_stat.html#a2c3c1c3543a491501dd4555a442fa15a":[0,7,1,35], -"structnmodl_1_1utils_1_1_perf_stat.html#a49ca2f12b6930a3bf83e929227dcbc32":[0,7,1,24] +"structnmodl_1_1utils_1_1_perf_stat.html#a173b9fab2ffbd6bfc4e32ab349eeb02a":[0,7,1,6] }; diff --git a/html/doxygen/navtreeindex32.js b/html/doxygen/navtreeindex32.js index 7a2e3b4bca..f74a9922cd 100644 --- a/html/doxygen/navtreeindex32.js +++ b/html/doxygen/navtreeindex32.js @@ -1,5 +1,9 @@ var NAVTREEINDEX32 = { +"structnmodl_1_1utils_1_1_perf_stat.html#a199d3a4ce658889efc3bce2c83e90505":[0,7,1,34], +"structnmodl_1_1utils_1_1_perf_stat.html#a1ae5a6a039afaaef47fdc302ead7a413":[0,7,1,1], +"structnmodl_1_1utils_1_1_perf_stat.html#a2c3c1c3543a491501dd4555a442fa15a":[0,7,1,35], +"structnmodl_1_1utils_1_1_perf_stat.html#a49ca2f12b6930a3bf83e929227dcbc32":[0,7,1,24], "structnmodl_1_1utils_1_1_perf_stat.html#a51b2949cf8cee86b90c8583998408239":[0,7,1,9], "structnmodl_1_1utils_1_1_perf_stat.html#a5752fb60ccc9f4d46bb11258d3d22be0":[0,7,1,29], "structnmodl_1_1utils_1_1_perf_stat.html#a6339e0000996537265de0d81adf42f59":[0,7,1,25], @@ -245,9 +249,5 @@ var NAVTREEINDEX32 = "test_2unit_2codegen_2codegen__utils_8cpp.html#aa8b1cde8cb086bc78a1a9b13ccf40419":[3,0,2,0,0,4,1], "test_2unit_2codegen_2codegen__utils_8cpp_source.html":[3,0,2,0,0,4], "test_2unit_2codegen_2main_8cpp.html":[3,0,2,0,0,5], -"test_2unit_2codegen_2main_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97":[3,0,2,0,0,5,0], -"test_2unit_2codegen_2main_8cpp_source.html":[3,0,2,0,0,5], -"test_2unit_2modtoken_2modtoken_8cpp.html":[3,0,2,0,3,0], -"test_2unit_2modtoken_2modtoken_8cpp_source.html":[3,0,2,0,3,0], -"test_2unit_2symtab_2symbol__table_8cpp.html":[3,0,2,0,7,0] +"test_2unit_2codegen_2main_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97":[3,0,2,0,0,5,0] }; diff --git a/html/doxygen/navtreeindex33.js b/html/doxygen/navtreeindex33.js index ba229a2075..4e0ada171c 100644 --- a/html/doxygen/navtreeindex33.js +++ b/html/doxygen/navtreeindex33.js @@ -1,5 +1,9 @@ var NAVTREEINDEX33 = { +"test_2unit_2codegen_2main_8cpp_source.html":[3,0,2,0,0,5], +"test_2unit_2modtoken_2modtoken_8cpp.html":[3,0,2,0,3,0], +"test_2unit_2modtoken_2modtoken_8cpp_source.html":[3,0,2,0,3,0], +"test_2unit_2symtab_2symbol__table_8cpp.html":[3,0,2,0,7,0], "test_2unit_2symtab_2symbol__table_8cpp.html#a3412b512c3ebac30608514f7d19c5b18":[3,0,2,0,7,0,2], "test_2unit_2symtab_2symbol__table_8cpp.html#a4d3f8a35d6368f6d53a0d21be3de672c":[3,0,2,0,7,0,4], "test_2unit_2symtab_2symbol__table_8cpp.html#a780700b9cd74cc6da7faa0250d3e64d5":[3,0,2,0,7,0,0], diff --git a/html/doxygen/search/all_1.js b/html/doxygen/search/all_1.js index 4159d92082..655df62557 100644 --- a/html/doxygen/search/all_1.js +++ b/html/doxygen/search/all_1.js @@ -80,7 +80,7 @@ var searchData= ['bop_5fsubtraction_175',['BOP_SUBTRACTION',['../group__ast__prop.html#gga0296e9888cfe8fbbdfefcd752bba3ef0ab9726ec3e58ecfddc083f26c35c9edd0',1,'nmodl::ast']]], ['breakpoint_5fblock_176',['BREAKPOINT_BLOCK',['../group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a018ac26a5a566bf54518e9c2066435d9',1,'nmodl::ast']]], ['breakpoint_5fblock_2ehpp_177',['breakpoint_block.hpp',['../breakpoint__block_8hpp.html',1,'']]], - ['breakpoint_5fcurrent_178',['breakpoint_current',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a40430cd5a36ba2b612adc095952d50a9',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['breakpoint_5fcurrent_178',['breakpoint_current',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aada5b6eeb7fd6f21a4ce2c68da1e2994',1,'nmodl::codegen::CodegenCppVisitor']]], ['breakpoint_5fexist_179',['breakpoint_exist',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a578f6c60b4ca495b24e5b7ae2db448cc',1,'nmodl::codegen::CodegenCppVisitor']]], ['breakpoint_5fnode_180',['breakpoint_node',['../structnmodl_1_1codegen_1_1_codegen_info.html#a4a46dea1ec9ad861822987e3c53e949a',1,'nmodl::codegen::CodegenInfo']]], ['breakpoint_5fto_5fnmodl_181',['breakpoint_to_nmodl',['../sympy__conductance_8cpp.html#a741c4acce9135f2b128dabb4dbc52abb',1,'sympy_conductance.cpp']]], diff --git a/html/doxygen/search/all_10.js b/html/doxygen/search/all_10.js index 0042c500d1..bfce3b533f 100644 --- a/html/doxygen/search/all_10.js +++ b/html/doxygen/search/all_10.js @@ -48,7 +48,7 @@ var searchData= ['read_5fcount_1810',['read_count',['../classnmodl_1_1symtab_1_1_symbol.html#aadb0c58e138049adbb14a7d472a0429d',1,'nmodl::symtab::Symbol']]], ['read_5fion_5fvar_1811',['READ_ION_VAR',['../group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a425c6e7a7fe3b0ed773fc6b6655fd759',1,'nmodl::ast::READ_ION_VAR()'],['../namespacenmodl_1_1symtab_1_1syminfo.html#ad9b6b8559b36d0a500ef5110badcc4dba16fd85df1b2a4aef647b9e849e5adf82',1,'nmodl::symtab::syminfo::read_ion_var()']]], ['read_5fion_5fvar_2ehpp_1812',['read_ion_var.hpp',['../read__ion__var_8hpp.html',1,'']]], - ['read_5fion_5fvariable_5fname_1813',['read_ion_variable_name',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aeb4f46dc88633a2d367cda3aaa650e1e',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['read_5fion_5fvariable_5fname_1813',['read_ion_variable_name',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3ee489972d8827f03490337c96a74b43',1,'nmodl::codegen::CodegenCppVisitor']]], ['readionvar_1814',['ReadIonVar',['../classnmodl_1_1ast_1_1_read_ion_var.html',1,'nmodl::ast::ReadIonVar'],['../classnmodl_1_1ast_1_1_read_ion_var.html#a735f451dc9cd10d422b0ce3c011ed963',1,'nmodl::ast::ReadIonVar::ReadIonVar(Name *name)'],['../classnmodl_1_1ast_1_1_read_ion_var.html#aeb8a5eff809f8ab24863e86c5f543d50',1,'nmodl::ast::ReadIonVar::ReadIonVar(std::shared_ptr< Name > name)'],['../classnmodl_1_1ast_1_1_read_ion_var.html#a321d2b8a0d3a6bb8f7579e2f27f1aec9',1,'nmodl::ast::ReadIonVar::ReadIonVar(const ReadIonVar &obj)']]], ['readionvarvector_1815',['ReadIonVarVector',['../group__ast__vec__type.html#gaa0c97050f4d9ee45495c9500d7be7678',1,'nmodl::ast']]], ['readlist_1816',['readlist',['../classnmodl_1_1ast_1_1_useion.html#aa812111f6f7cfc47bf8cc7b2dbe51008',1,'nmodl::ast::Useion']]], diff --git a/html/doxygen/search/all_13.js b/html/doxygen/search/all_13.js index f172d8a9b8..a3100ae06e 100644 --- a/html/doxygen/search/all_13.js +++ b/html/doxygen/search/all_13.js @@ -70,7 +70,7 @@ var searchData= ['update_5fdefuse_5fchain_2288',['update_defuse_chain',['../classnmodl_1_1visitor_1_1_def_use_analyze_visitor.html#ad4b893f003dec51f192d6f10102630de',1,'nmodl::visitor::DefUseAnalyzeVisitor']]], ['update_5fdt_2289',['UPDATE_DT',['../group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a4fb7ea683a98639d84f8d9b07c33a3a5',1,'nmodl::ast']]], ['update_5fdt_2ehpp_2290',['update_dt.hpp',['../update__dt_8hpp.html',1,'']]], - ['update_5fif_5fion_5fvariable_5fname_2291',['update_if_ion_variable_name',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a992c19b9aa26099d7d1954fe77107b0d',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['update_5fif_5fion_5fvariable_5fname_2291',['update_if_ion_variable_name',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aba3a9521ace5f09f4d2263e4401b33ee',1,'nmodl::codegen::CodegenCppVisitor']]], ['update_5findex_5fsemantics_2292',['update_index_semantics',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae0d8d4e346e244c764911c0c64c2ac1c',1,'nmodl::codegen::CodegenCppVisitor']]], ['update_5fmemory_5fops_2293',['update_memory_ops',['../classnmodl_1_1visitor_1_1_perf_visitor.html#a612892dabaa7522074e18bf3d7a54716',1,'nmodl::visitor::PerfVisitor']]], ['update_5fmode_5finsert_2294',['update_mode_insert',['../classnmodl_1_1symtab_1_1_model_symbol_table.html#abf5eab3a8db5ff75e2c8dd3a32c233aa',1,'nmodl::symtab::ModelSymbolTable']]], diff --git a/html/doxygen/search/all_14.js b/html/doxygen/search/all_14.js index 399500dd4c..104f7b6e0d 100644 --- a/html/doxygen/search/all_14.js +++ b/html/doxygen/search/all_14.js @@ -4,7 +4,7 @@ var searchData= ['valence_2312',['Valence',['../classnmodl_1_1ast_1_1_valence.html',1,'nmodl::ast::Valence'],['../classnmodl_1_1ast_1_1_useion.html#a03c0207cb2f2d4213868a726e0f56929',1,'nmodl::ast::Useion::valence()'],['../classnmodl_1_1ast_1_1_valence.html#acbd1671653f567543a9e225643a0cc89',1,'nmodl::ast::Valence::Valence(Name *type, Double *value)'],['../classnmodl_1_1ast_1_1_valence.html#afb67d26bb621d2788662c5d0d4044181',1,'nmodl::ast::Valence::Valence(std::shared_ptr< Name > type, std::shared_ptr< Double > value)'],['../classnmodl_1_1ast_1_1_valence.html#af9c9657b95a55238325b4b9cce302099',1,'nmodl::ast::Valence::Valence(const Valence &obj)'],['../group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033ad4c282fc67c65a77faf3d6bf6128a069',1,'nmodl::ast::VALENCE()']]], ['valence_2ehpp_2313',['valence.hpp',['../valence_8hpp.html',1,'']]], ['valencevector_2314',['ValenceVector',['../group__ast__vec__type.html#ga94c1f13db006ede6849398172ec460fa',1,'nmodl::ast']]], - ['value_2315',['value',['../classnmodl_1_1symtab_1_1_symbol.html#a4e14d5164984b47f5ea181c02960da6d',1,'nmodl::symtab::Symbol::value()'],['../classnmodl_1_1visitor_1_1_index_remover.html#a2476ea703ce84b841cff7b1815c23842',1,'nmodl::visitor::IndexRemover::value()'],['../classnmodl_1_1ast_1_1_b_a_block_type.html#a9b1b8934600e5fb3a84ef30de53be456',1,'nmodl::ast::BABlockType::value()'],['../classnmodl_1_1ast_1_1_binary_operator.html#a78e2a8807bdd3bdbd7d1138cab6e82aa',1,'nmodl::ast::BinaryOperator::value()'],['../classnmodl_1_1ast_1_1_boolean.html#afafd2493834bf8ff249ea1acbd73b732',1,'nmodl::ast::Boolean::value()'],['../classnmodl_1_1ast_1_1_constant_var.html#a69b7ca36ad10013d7a336506fdf106f4',1,'nmodl::ast::ConstantVar::value()'],['../classnmodl_1_1ast_1_1_define.html#ad4c6d62eb31386e7143d7cef296d0dc5',1,'nmodl::ast::Define::value()'],['../classnmodl_1_1ast_1_1_double.html#adcaf1c4901d81bdc10bef90a53937a56',1,'nmodl::ast::Double::value()'],['../classnmodl_1_1ast_1_1_double_unit.html#a4aec1f2ed586edfbda972face6555117',1,'nmodl::ast::DoubleUnit::value()'],['../classnmodl_1_1ast_1_1_factor_def.html#a7df2f637e432cc3ca5c377619b14ea60',1,'nmodl::ast::FactorDef::value()'],['../classnmodl_1_1ast_1_1_float.html#a16a77a1795222a7b1e6528ad87b23000',1,'nmodl::ast::Float::value()'],['../classnmodl_1_1ast_1_1_integer.html#aeaec2b9afaf14f054c246485e6d15f58',1,'nmodl::ast::Integer::value()'],['../classnmodl_1_1ast_1_1_name.html#ab42bb69ed518812d11f1c193cf947987',1,'nmodl::ast::Name::value()'],['../classnmodl_1_1ast_1_1_param_assign.html#ae23e63d7e3ed3b3afcff22a85c1e46a8',1,'nmodl::ast::ParamAssign::value()'],['../classnmodl_1_1ast_1_1_prime_name.html#a34474c780de39af9f7c0f8243c343735',1,'nmodl::ast::PrimeName::value()'],['../classnmodl_1_1ast_1_1_react_var_name.html#a9c42b533bb1a2efb538d52125fd3ccd2',1,'nmodl::ast::ReactVarName::value()'],['../classnmodl_1_1ast_1_1_reaction_operator.html#a39c15647f7aa4b38e4e56a05c71d4884',1,'nmodl::ast::ReactionOperator::value()'],['../classnmodl_1_1ast_1_1_string.html#adbf40ddad32c859cb81d54f2851e60c1',1,'nmodl::ast::String::value()'],['../classnmodl_1_1ast_1_1_unary_operator.html#accb254bd4dc77c1bd0cb9b4b777591c2',1,'nmodl::ast::UnaryOperator::value()'],['../classnmodl_1_1ast_1_1_unit_state.html#adc0687ac6fae48fa57cd3c807b1f008a',1,'nmodl::ast::UnitState::value()'],['../classnmodl_1_1ast_1_1_update_dt.html#a3c17ff2383d8df31dae0c34abb4fe390',1,'nmodl::ast::UpdateDt::value()'],['../classnmodl_1_1ast_1_1_valence.html#a98c5477463b20add89219dadcda80def',1,'nmodl::ast::Valence::value()'],['../classnmodl_1_1ast_1_1_watch.html#a720c9ed1bf7eff4c79d6fd55420b7a33',1,'nmodl::ast::Watch::value()'],['../classnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor.html#a1e49fcb9c416a45a1607f335948228c1aecc2e9c313faddb07e7da223c1dc5c3f',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::VALUE()']]], + ['value_2315',['VALUE',['../classnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor.html#a1e49fcb9c416a45a1607f335948228c1aecc2e9c313faddb07e7da223c1dc5c3f',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::VALUE()'],['../classnmodl_1_1symtab_1_1_symbol.html#a4e14d5164984b47f5ea181c02960da6d',1,'nmodl::symtab::Symbol::value()'],['../classnmodl_1_1visitor_1_1_index_remover.html#a2476ea703ce84b841cff7b1815c23842',1,'nmodl::visitor::IndexRemover::value()'],['../classnmodl_1_1ast_1_1_b_a_block_type.html#a9b1b8934600e5fb3a84ef30de53be456',1,'nmodl::ast::BABlockType::value()'],['../classnmodl_1_1ast_1_1_binary_operator.html#a78e2a8807bdd3bdbd7d1138cab6e82aa',1,'nmodl::ast::BinaryOperator::value()'],['../classnmodl_1_1ast_1_1_boolean.html#afafd2493834bf8ff249ea1acbd73b732',1,'nmodl::ast::Boolean::value()'],['../classnmodl_1_1ast_1_1_constant_var.html#a69b7ca36ad10013d7a336506fdf106f4',1,'nmodl::ast::ConstantVar::value()'],['../classnmodl_1_1ast_1_1_define.html#ad4c6d62eb31386e7143d7cef296d0dc5',1,'nmodl::ast::Define::value()'],['../classnmodl_1_1ast_1_1_double.html#adcaf1c4901d81bdc10bef90a53937a56',1,'nmodl::ast::Double::value()'],['../classnmodl_1_1ast_1_1_double_unit.html#a4aec1f2ed586edfbda972face6555117',1,'nmodl::ast::DoubleUnit::value()'],['../classnmodl_1_1ast_1_1_factor_def.html#a7df2f637e432cc3ca5c377619b14ea60',1,'nmodl::ast::FactorDef::value()'],['../classnmodl_1_1ast_1_1_float.html#a16a77a1795222a7b1e6528ad87b23000',1,'nmodl::ast::Float::value()'],['../classnmodl_1_1ast_1_1_integer.html#aeaec2b9afaf14f054c246485e6d15f58',1,'nmodl::ast::Integer::value()'],['../classnmodl_1_1ast_1_1_name.html#ab42bb69ed518812d11f1c193cf947987',1,'nmodl::ast::Name::value()'],['../classnmodl_1_1ast_1_1_param_assign.html#ae23e63d7e3ed3b3afcff22a85c1e46a8',1,'nmodl::ast::ParamAssign::value()'],['../classnmodl_1_1ast_1_1_prime_name.html#a34474c780de39af9f7c0f8243c343735',1,'nmodl::ast::PrimeName::value()'],['../classnmodl_1_1ast_1_1_react_var_name.html#a9c42b533bb1a2efb538d52125fd3ccd2',1,'nmodl::ast::ReactVarName::value()'],['../classnmodl_1_1ast_1_1_reaction_operator.html#a39c15647f7aa4b38e4e56a05c71d4884',1,'nmodl::ast::ReactionOperator::value()'],['../classnmodl_1_1ast_1_1_string.html#adbf40ddad32c859cb81d54f2851e60c1',1,'nmodl::ast::String::value()'],['../classnmodl_1_1ast_1_1_unary_operator.html#accb254bd4dc77c1bd0cb9b4b777591c2',1,'nmodl::ast::UnaryOperator::value()'],['../classnmodl_1_1ast_1_1_unit_state.html#adc0687ac6fae48fa57cd3c807b1f008a',1,'nmodl::ast::UnitState::value()'],['../classnmodl_1_1ast_1_1_update_dt.html#a3c17ff2383d8df31dae0c34abb4fe390',1,'nmodl::ast::UpdateDt::value()'],['../classnmodl_1_1ast_1_1_valence.html#a98c5477463b20add89219dadcda80def',1,'nmodl::ast::Valence::value()'],['../classnmodl_1_1ast_1_1_watch.html#a720c9ed1bf7eff4c79d6fd55420b7a33',1,'nmodl::ast::Watch::value()']]], ['values_2316',['values',['../structnmodl_1_1utils_1_1_perf_stat.html#a73b03ee433317593a5a8112f58aa0163',1,'nmodl::utils::PerfStat']]], ['var2dependants_2317',['var2dependants',['../structnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor_1_1_statement_dispenser.html#a64b0e5e760e0c33abe7fa555d77e9da0',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::StatementDispenser']]], ['var2statement_2318',['var2statement',['../structnmodl_1_1visitor_1_1_sympy_replace_solutions_visitor_1_1_statement_dispenser.html#a5349e9d8a2ef3e8bbbd22a23a55eea36',1,'nmodl::visitor::SympyReplaceSolutionsVisitor::StatementDispenser']]], diff --git a/html/doxygen/search/all_15.js b/html/doxygen/search/all_15.js index b1b2ebbb97..69f8edf8c8 100644 --- a/html/doxygen/search/all_15.js +++ b/html/doxygen/search/all_15.js @@ -28,7 +28,7 @@ var searchData= ['write_5fcount_2520',['write_count',['../classnmodl_1_1symtab_1_1_symbol.html#a15fcf08e3fe06db7c24382bb1190fec9',1,'nmodl::symtab::Symbol']]], ['write_5fion_5fvar_2521',['write_ion_var',['../namespacenmodl_1_1symtab_1_1syminfo.html#ad9b6b8559b36d0a500ef5110badcc4dba7b0b4b63b7695c9d325544455f858b7c',1,'nmodl::symtab::syminfo::write_ion_var()'],['../group__ast__type.html#ggac392e49849e60c05e42ea02c7b445033a6a032955d350a7dd5254b35acf0ce26a',1,'nmodl::ast::WRITE_ION_VAR()']]], ['write_5fion_5fvar_2ehpp_2522',['write_ion_var.hpp',['../write__ion__var_8hpp.html',1,'']]], - ['write_5fion_5fvariable_5fname_2523',['write_ion_variable_name',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4c6c17a2eeafae316e104bf5722337fa',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['write_5fion_5fvariable_5fname_2523',['write_ion_variable_name',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8c28e874826634125ad9b5f59511f445',1,'nmodl::codegen::CodegenCppVisitor']]], ['writeionvar_2524',['WriteIonVar',['../classnmodl_1_1ast_1_1_write_ion_var.html',1,'nmodl::ast::WriteIonVar'],['../classnmodl_1_1ast_1_1_write_ion_var.html#a0d00c26daa8658ee7f7fca0a79fcd087',1,'nmodl::ast::WriteIonVar::WriteIonVar(Name *name)'],['../classnmodl_1_1ast_1_1_write_ion_var.html#a253097f550e67e805eeadb3119b9497d',1,'nmodl::ast::WriteIonVar::WriteIonVar(std::shared_ptr< Name > name)'],['../classnmodl_1_1ast_1_1_write_ion_var.html#aeaf6de86af2f842ff7ad994b820cae01',1,'nmodl::ast::WriteIonVar::WriteIonVar(const WriteIonVar &obj)']]], ['writeionvarvector_2525',['WriteIonVarVector',['../group__ast__vec__type.html#ga3fa547a7a2c751581063c09420c195e0',1,'nmodl::ast']]], ['writelist_2526',['writelist',['../classnmodl_1_1ast_1_1_useion.html#a9cbd5a9814d2b8ae4b518ccfc0154c29',1,'nmodl::ast::Useion']]], diff --git a/html/doxygen/search/all_2.js b/html/doxygen/search/all_2.js index 07ba7bff1e..3dd0681d71 100644 --- a/html/doxygen/search/all_2.js +++ b/html/doxygen/search/all_2.js @@ -90,7 +90,7 @@ var searchData= ['compartmentvector_273',['CompartmentVector',['../group__ast__vec__type.html#gad0cfa4a0add172b3fc0998e4038ed91d',1,'nmodl::ast']]], ['compute_274',['compute',['../namespacenmodl_1_1visitor.html#a7b08d91645042b3be9ad57d18fe5af74',1,'nmodl::visitor']]], ['compute_5fmethod_5fname_275',['compute_method_name',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae022e99573f663fc0db935c5c1bb7199',1,'nmodl::codegen::CodegenCppVisitor']]], - ['conc_5fwrite_5fstatement_276',['conc_write_statement',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a805dff5f277ea3b3536a553818fb917a',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['conc_5fwrite_5fstatement_276',['conc_write_statement',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a542c802c8bea31d9a7702831eb385633',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::conc_write_statement()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae29a1c321357b464d7a67ee4fbfabfe3',1,'nmodl::codegen::CodegenCppVisitor::conc_write_statement()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a593b6a70562ebbf42e13fea3b03d9174',1,'nmodl::codegen::CodegenNeuronCppVisitor::conc_write_statement()']]], ['condition_277',['condition',['../classnmodl_1_1ast_1_1_else_if_statement.html#ad9dd476d7781f451d28d8e334c5379a1',1,'nmodl::ast::ElseIfStatement::condition()'],['../classnmodl_1_1ast_1_1_if_statement.html#a48db5ea965ce751850a0957a12da5e4a',1,'nmodl::ast::IfStatement::condition()'],['../classnmodl_1_1ast_1_1_while_statement.html#a1c759c07ef39aa1cbc714441472cff14',1,'nmodl::ast::WhileStatement::condition()']]], ['conditional_5fblock_278',['CONDITIONAL_BLOCK',['../namespacenmodl_1_1visitor.html#a68c860c43f4bea4e1af16c016d2959f9a3a7cacb52c86f2098ddb46d24c3c9763',1,'nmodl::visitor']]], ['conditional_5fblock_5feval_279',['conditional_block_eval',['../classnmodl_1_1visitor_1_1_d_u_instance.html#a6081d84ad38c6cd7ecb556a4d5e3da63',1,'nmodl::visitor::DUInstance']]], diff --git a/html/doxygen/search/all_8.js b/html/doxygen/search/all_8.js index 535dc29f65..6d53f460ff 100644 --- a/html/doxygen/search/all_8.js +++ b/html/doxygen/search/all_8.js @@ -105,11 +105,11 @@ var searchData= ['ion_950',['Ion',['../structnmodl_1_1codegen_1_1_ion.html',1,'nmodl::codegen::Ion'],['../structnmodl_1_1codegen_1_1_ion.html#acd8624aa31dffe4fcf3fbac9efc844d3',1,'nmodl::codegen::Ion::Ion()=delete'],['../structnmodl_1_1codegen_1_1_ion.html#a6266f04720d983a7cd76c92156740b18',1,'nmodl::codegen::Ion::Ion(std::string name)'],['../structnmodl_1_1codegen_1_1_conductance.html#a9f303311f3cd92633f9f2230a88c784a',1,'nmodl::codegen::Conductance::ion()'],['../classnmodl_1_1ast_1_1_conductance_hint.html#a43fb6323e56ce2b0902a6bd21002d8c6',1,'nmodl::ast::ConductanceHint::ion()']]], ['ion_5fhas_5fwrite_5fvariable_951',['ion_has_write_variable',['../structnmodl_1_1codegen_1_1_codegen_info.html#a57b452ff25933eca2595d1bcf2e7fc1a',1,'nmodl::codegen::CodegenInfo']]], ['ion_5fprefix_952',['ION_PREFIX',['../classnmodl_1_1visitor_1_1_verbatim_var_rename_visitor.html#ada5eadd4ae3c95ec6bee081d2a2a809b',1,'nmodl::visitor::VerbatimVarRenameVisitor']]], - ['ion_5fread_5fstatements_953',['ion_read_statements',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2ff6b6d552739a604c1c9c19968dafb4',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], - ['ion_5fread_5fstatements_5foptimized_954',['ion_read_statements_optimized',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a43e3e9beeb7ca80989d361c917491e1e',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], - ['ion_5fvariable_5fstruct_5frequired_955',['ion_variable_struct_required',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7089dc9d4bfda5791d6f95388a877c8b',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['ion_5fread_5fstatements_953',['ion_read_statements',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d8c0140086b0f5284e1cf7c23632463',1,'nmodl::codegen::CodegenCppVisitor']]], + ['ion_5fread_5fstatements_5foptimized_954',['ion_read_statements_optimized',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a26ad42be1c7c9a127b2d806d08e426a6',1,'nmodl::codegen::CodegenCppVisitor']]], + ['ion_5fvariable_5fstruct_5frequired_955',['ion_variable_struct_required',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6e25890e173635c92d41465a2ee4d3a2',1,'nmodl::codegen::CodegenCppVisitor']]], ['ion_5fvarname_5fprefix_956',['ION_VARNAME_PREFIX',['../namespacenmodl_1_1codegen_1_1naming.html#ac1c238efdb0580c8b482fb29bcb0f4da',1,'nmodl::codegen::naming']]], - ['ion_5fwrite_5fstatements_957',['ion_write_statements',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0c07a4568bf732ccc7a6ec9b763bc71b',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['ion_5fwrite_5fstatements_957',['ion_write_statements',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2e2dd82a055dd830e8efc7f1dce03924',1,'nmodl::codegen::CodegenCppVisitor']]], ['ions_958',['ions',['../structnmodl_1_1codegen_1_1_codegen_info.html#a92c83194913f5a2766c912b3ed8ba55e',1,'nmodl::codegen::CodegenInfo']]], ['is_959',['is',['../classnmodl_1_1parser_1_1_verbatim_driver.html#a8a6ecbb4974a05f09c2947f0e500139e',1,'nmodl::parser::VerbatimDriver']]], ['is_5fafter_5fblock_960',['is_after_block',['../classnmodl_1_1ast_1_1_after_block.html#a765d92e65d0b5f56647a7f62b004aa83',1,'nmodl::ast::AfterBlock::is_after_block()'],['../group__ast__class.html#ga17c42e3c60a25fe417647c5937b682c9',1,'nmodl::ast::Ast::is_after_block()']]], diff --git a/html/doxygen/search/all_e.js b/html/doxygen/search/all_e.js index 9739ceb653..0bf81307cf 100644 --- a/html/doxygen/search/all_e.js +++ b/html/doxygen/search/all_e.js @@ -21,7 +21,7 @@ var searchData= ['operator_7c_1522',['operator|',['../namespacenmodl_1_1symtab_1_1syminfo.html#ae193a4319089058de3dcf879dcef248f',1,'nmodl::symtab::syminfo']]], ['operator_7c_3d_1523',['operator|=',['../namespacenmodl_1_1symtab_1_1syminfo.html#a23dd7c5f633e0adf6322d3f427d8f5a9',1,'nmodl::symtab::syminfo']]], ['operator_7e_1524',['operator~',['../namespacenmodl_1_1symtab_1_1syminfo.html#ac2ce7dd65a7614b9137c9be6bd9f0f8d',1,'nmodl::symtab::syminfo']]], - ['optimize_5fion_5fvariable_5fcopies_1525',['optimize_ion_variable_copies',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a58808da4cf7e64ffb1bcb5be20f977e3',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['optimize_5fion_5fvariable_5fcopies_1525',['optimize_ion_variable_copies',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0620e76a8bf6864c3f4a38680f514158',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::optimize_ion_variable_copies()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a81cded985b616728b55976bf7eca4488',1,'nmodl::codegen::CodegenCppVisitor::optimize_ion_variable_copies()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a70bd9cedc2fcae2e924ebcc59c7f728b',1,'nmodl::codegen::CodegenNeuronCppVisitor::optimize_ion_variable_copies()']]], ['optimize_5fionvar_5fcopies_1526',['optimize_ionvar_copies',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac2029b16365753e1e337f82cda0e3350',1,'nmodl::codegen::CodegenCppVisitor']]], ['order_1527',['order',['../classnmodl_1_1symtab_1_1_symbol.html#a1a34941b9493bc7cb5cb049ac4bdd060',1,'nmodl::symtab::Symbol::order()'],['../classnmodl_1_1ast_1_1_prime_name.html#ac68f18e800d8ab96a6f6696a281be604',1,'nmodl::ast::PrimeName::order()']]], ['ordered_5fbinary_5fexprs_1528',['ordered_binary_exprs',['../classnmodl_1_1visitor_1_1_sympy_conductance_visitor.html#a488af4294b5aaa714487ad4124a6bd47',1,'nmodl::visitor::SympyConductanceVisitor']]], diff --git a/html/doxygen/search/all_f.js b/html/doxygen/search/all_f.js index cffbcefc24..872e593127 100644 --- a/html/doxygen/search/all_f.js +++ b/html/doxygen/search/all_f.js @@ -207,7 +207,7 @@ var searchData= ['procedures_1735',['procedures',['../structnmodl_1_1codegen_1_1_codegen_info.html#a60fcb7609e01ff8c213b3aa5818203fc',1,'nmodl::codegen::CodegenInfo']]], ['process_5fconserve_5freac_5fvar_1736',['process_conserve_reac_var',['../classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#ac5d5210f6bdfcc465b16060a4617666b',1,'nmodl::visitor::KineticBlockVisitor']]], ['process_5freac_5fvar_1737',['process_reac_var',['../classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#ae7a3356a1f16710b5363d78766d87b1c',1,'nmodl::visitor::KineticBlockVisitor']]], - ['process_5fshadow_5fupdate_5fstatement_1738',['process_shadow_update_statement',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7b99884ba28c9b21c1ff40bb54ca20f5',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['process_5fshadow_5fupdate_5fstatement_1738',['process_shadow_update_statement',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aa539bb6033a8bcd87fc4eb279bad887a',1,'nmodl::codegen::CodegenCppVisitor']]], ['process_5fvariable_1739',['process_variable',['../classnmodl_1_1visitor_1_1_def_use_analyze_visitor.html#a9e067ed5dcbf4d182ed6626f7585e6bd',1,'nmodl::visitor::DefUseAnalyzeVisitor::process_variable(const std::string &name)'],['../classnmodl_1_1visitor_1_1_def_use_analyze_visitor.html#a87e566fcf029a317582663c07c9ceba1',1,'nmodl::visitor::DefUseAnalyzeVisitor::process_variable(const std::string &name, int index)']]], ['process_5fverbatim_5ftext_1740',['process_verbatim_text',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a592905dcf5bb27083ec0a84f1ab29508',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::process_verbatim_text()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac53419e9abc2d2f9b12acf10507e7954',1,'nmodl::codegen::CodegenCppVisitor::process_verbatim_text()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a13af4fa40fc5b97bfcf91d199fe6a8e2',1,'nmodl::codegen::CodegenNeuronCppVisitor::process_verbatim_text()']]], ['process_5fverbatim_5ftoken_1741',['process_verbatim_token',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4ce5f8dd96c5a12646610da8e40de705',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], diff --git a/html/doxygen/search/functions_1.js b/html/doxygen/search/functions_1.js index 382fdbd054..f4037997c4 100644 --- a/html/doxygen/search/functions_1.js +++ b/html/doxygen/search/functions_1.js @@ -12,7 +12,7 @@ var searchData= ['binaryoperator_3278',['BinaryOperator',['../classnmodl_1_1ast_1_1_binary_operator.html#ad5c2e6dcc9f57d0e4214170d025756a9',1,'nmodl::ast::BinaryOperator::BinaryOperator(BinaryOp value)'],['../classnmodl_1_1ast_1_1_binary_operator.html#aecac61481044ecdaf1e855ac7c03c1de',1,'nmodl::ast::BinaryOperator::BinaryOperator(const BinaryOperator &obj)'],['../classnmodl_1_1ast_1_1_binary_operator.html#a26d1833ed1610d221de0cc880bb8abe5',1,'nmodl::ast::BinaryOperator::BinaryOperator()=default']]], ['blockcomment_3279',['BlockComment',['../classnmodl_1_1ast_1_1_block_comment.html#aa4f183cdfb4f5c942359d99a2914a505',1,'nmodl::ast::BlockComment::BlockComment(String *statement)'],['../classnmodl_1_1ast_1_1_block_comment.html#a14ae3e6a7a2df526660c2172a2ebfb54',1,'nmodl::ast::BlockComment::BlockComment(std::shared_ptr< String > statement)'],['../classnmodl_1_1ast_1_1_block_comment.html#a13f9ddfd5fc32c727bd3c950f106196b',1,'nmodl::ast::BlockComment::BlockComment(const BlockComment &obj)']]], ['boolean_3280',['Boolean',['../classnmodl_1_1ast_1_1_boolean.html#adc92a1a66742c3fe05e7d98d6afe26d5',1,'nmodl::ast::Boolean::Boolean(int value)'],['../classnmodl_1_1ast_1_1_boolean.html#a81e254d29faa7f59ee8b89432b0eb429',1,'nmodl::ast::Boolean::Boolean(const Boolean &obj)']]], - ['breakpoint_5fcurrent_3281',['breakpoint_current',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a40430cd5a36ba2b612adc095952d50a9',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['breakpoint_5fcurrent_3281',['breakpoint_current',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aada5b6eeb7fd6f21a4ce2c68da1e2994',1,'nmodl::codegen::CodegenCppVisitor']]], ['breakpoint_5fexist_3282',['breakpoint_exist',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a578f6c60b4ca495b24e5b7ae2db448cc',1,'nmodl::codegen::CodegenCppVisitor']]], ['breakpoint_5fto_5fnmodl_3283',['breakpoint_to_nmodl',['../sympy__conductance_8cpp.html#a741c4acce9135f2b128dabb4dbc52abb',1,'sympy_conductance.cpp']]], ['breakpointblock_3284',['BreakpointBlock',['../classnmodl_1_1ast_1_1_breakpoint_block.html#a6a386aa3bd7916ac4df98d8f8ad97141',1,'nmodl::ast::BreakpointBlock::BreakpointBlock(StatementBlock *statement_block)'],['../classnmodl_1_1ast_1_1_breakpoint_block.html#a0177cb41b5a3050bf521879a4ef2bfac',1,'nmodl::ast::BreakpointBlock::BreakpointBlock(std::shared_ptr< StatementBlock > statement_block)'],['../classnmodl_1_1ast_1_1_breakpoint_block.html#ad7ffc3c5f9168cf72116c546ca93d9a8',1,'nmodl::ast::BreakpointBlock::BreakpointBlock(const BreakpointBlock &obj)']]], diff --git a/html/doxygen/search/functions_10.js b/html/doxygen/search/functions_10.js index d523f816a0..fd49372f76 100644 --- a/html/doxygen/search/functions_10.js +++ b/html/doxygen/search/functions_10.js @@ -10,7 +10,7 @@ var searchData= ['reactionstatement_4102',['ReactionStatement',['../classnmodl_1_1ast_1_1_reaction_statement.html#afafbcbd321857036a1f31cb69c2177ce',1,'nmodl::ast::ReactionStatement::ReactionStatement(Expression *reaction1, const ReactionOperator &op, Expression *reaction2, Expression *expression1, Expression *expression2)'],['../classnmodl_1_1ast_1_1_reaction_statement.html#af0df67f2cbca2b4ac258385e98bd42b6',1,'nmodl::ast::ReactionStatement::ReactionStatement(std::shared_ptr< Expression > reaction1, const ReactionOperator &op, std::shared_ptr< Expression > reaction2, std::shared_ptr< Expression > expression1, std::shared_ptr< Expression > expression2)'],['../classnmodl_1_1ast_1_1_reaction_statement.html#aca34541fa6ba8804937ed450ee826443',1,'nmodl::ast::ReactionStatement::ReactionStatement(const ReactionStatement &obj)']]], ['reactvarname_4103',['ReactVarName',['../classnmodl_1_1ast_1_1_react_var_name.html#a61dbea61b7ff39fe07cfcbce776fd2b2',1,'nmodl::ast::ReactVarName::ReactVarName(Integer *value, VarName *name)'],['../classnmodl_1_1ast_1_1_react_var_name.html#ac2ef51b622abffd6b67440ed5e1f6415',1,'nmodl::ast::ReactVarName::ReactVarName(std::shared_ptr< Integer > value, std::shared_ptr< VarName > name)'],['../classnmodl_1_1ast_1_1_react_var_name.html#aea3507cfc3fbf885e92c4c3826d7e3e0',1,'nmodl::ast::ReactVarName::ReactVarName(const ReactVarName &obj)']]], ['read_4104',['read',['../classnmodl_1_1symtab_1_1_symbol.html#a7b59c5c239e4e88ba656626d5c6b448c',1,'nmodl::symtab::Symbol']]], - ['read_5fion_5fvariable_5fname_4105',['read_ion_variable_name',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#aeb4f46dc88633a2d367cda3aaa650e1e',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['read_5fion_5fvariable_5fname_4105',['read_ion_variable_name',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a3ee489972d8827f03490337c96a74b43',1,'nmodl::codegen::CodegenCppVisitor']]], ['readionvar_4106',['ReadIonVar',['../classnmodl_1_1ast_1_1_read_ion_var.html#a735f451dc9cd10d422b0ce3c011ed963',1,'nmodl::ast::ReadIonVar::ReadIonVar(Name *name)'],['../classnmodl_1_1ast_1_1_read_ion_var.html#aeb8a5eff809f8ab24863e86c5f543d50',1,'nmodl::ast::ReadIonVar::ReadIonVar(std::shared_ptr< Name > name)'],['../classnmodl_1_1ast_1_1_read_ion_var.html#a321d2b8a0d3a6bb8f7579e2f27f1aec9',1,'nmodl::ast::ReadIonVar::ReadIonVar(const ReadIonVar &obj)']]], ['register_5fmechanism_5farguments_4107',['register_mechanism_arguments',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af7e3a49a86646f3b69a3d387aa4116bb',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::register_mechanism_arguments()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aec3cef47cc3c1e5901b4ff401ce8e725',1,'nmodl::codegen::CodegenCppVisitor::register_mechanism_arguments()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a50026c205b223b41ffe682526735873c',1,'nmodl::codegen::CodegenNeuronCppVisitor::register_mechanism_arguments()']]], ['reindent_5ftext_4108',['reindent_text',['../namespacenmodl_1_1test__utils.html#af64fc17c60e5c8a5b8114147591aec3d',1,'nmodl::test_utils']]], diff --git a/html/doxygen/search/functions_13.js b/html/doxygen/search/functions_13.js index c5e729ee4e..06b5549ce3 100644 --- a/html/doxygen/search/functions_13.js +++ b/html/doxygen/search/functions_13.js @@ -15,7 +15,7 @@ var searchData= ['unroll_5ffor_5floop_4343',['unroll_for_loop',['../namespacenmodl_1_1visitor.html#a29d224493529dd668adf0ccc5cc51ba8',1,'nmodl::visitor']]], ['unwrap_4344',['unwrap',['../namespacenmodl_1_1visitor.html#a2b5db33bfc3c6c9d41c199ad73c3cea7',1,'nmodl::visitor']]], ['update_5fdefuse_5fchain_4345',['update_defuse_chain',['../classnmodl_1_1visitor_1_1_def_use_analyze_visitor.html#ad4b893f003dec51f192d6f10102630de',1,'nmodl::visitor::DefUseAnalyzeVisitor']]], - ['update_5fif_5fion_5fvariable_5fname_4346',['update_if_ion_variable_name',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a992c19b9aa26099d7d1954fe77107b0d',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['update_5fif_5fion_5fvariable_5fname_4346',['update_if_ion_variable_name',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aba3a9521ace5f09f4d2263e4401b33ee',1,'nmodl::codegen::CodegenCppVisitor']]], ['update_5findex_5fsemantics_4347',['update_index_semantics',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae0d8d4e346e244c764911c0c64c2ac1c',1,'nmodl::codegen::CodegenCppVisitor']]], ['update_5fmemory_5fops_4348',['update_memory_ops',['../classnmodl_1_1visitor_1_1_perf_visitor.html#a612892dabaa7522074e18bf3d7a54716',1,'nmodl::visitor::PerfVisitor']]], ['update_5fmode_5finsert_4349',['update_mode_insert',['../classnmodl_1_1symtab_1_1_model_symbol_table.html#abf5eab3a8db5ff75e2c8dd3a32c233aa',1,'nmodl::symtab::ModelSymbolTable']]], diff --git a/html/doxygen/search/functions_15.js b/html/doxygen/search/functions_15.js index 8d9e5c6547..52771469a8 100644 --- a/html/doxygen/search/functions_15.js +++ b/html/doxygen/search/functions_15.js @@ -5,6 +5,6 @@ var searchData= ['whilestatement_4494',['WhileStatement',['../classnmodl_1_1ast_1_1_while_statement.html#ae1ce7020794134936f18d2a7a59f2731',1,'nmodl::ast::WhileStatement::WhileStatement(Expression *condition, StatementBlock *statement_block)'],['../classnmodl_1_1ast_1_1_while_statement.html#ab90f9d5f4d33bb64ad81a74d0ccc9367',1,'nmodl::ast::WhileStatement::WhileStatement(std::shared_ptr< Expression > condition, std::shared_ptr< StatementBlock > statement_block)'],['../classnmodl_1_1ast_1_1_while_statement.html#ad80a8174de613ca16f69655af8effa14',1,'nmodl::ast::WhileStatement::WhileStatement(const WhileStatement &obj)']]], ['wrappedexpression_4495',['WrappedExpression',['../classnmodl_1_1ast_1_1_wrapped_expression.html#ae0a42cf0b7fc6f4471d633efdd5600cb',1,'nmodl::ast::WrappedExpression::WrappedExpression(Expression *expression)'],['../classnmodl_1_1ast_1_1_wrapped_expression.html#a2df08c2c544881d06258b53eddbc33cd',1,'nmodl::ast::WrappedExpression::WrappedExpression(std::shared_ptr< Expression > expression)'],['../classnmodl_1_1ast_1_1_wrapped_expression.html#a8e97a342800b096a1121f356a33d4602',1,'nmodl::ast::WrappedExpression::WrappedExpression(const WrappedExpression &obj)']]], ['write_4496',['write',['../classnmodl_1_1symtab_1_1_symbol.html#af97b6f069ec3b05a7f9a536a70f9fe06',1,'nmodl::symtab::Symbol::write()'],['../classnmodl_1_1visitor_1_1_j_s_o_n_visitor.html#ae4157f16ba5ba44c5ec312531beda0c9',1,'nmodl::visitor::JSONVisitor::write()']]], - ['write_5fion_5fvariable_5fname_4497',['write_ion_variable_name',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4c6c17a2eeafae316e104bf5722337fa',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['write_5fion_5fvariable_5fname_4497',['write_ion_variable_name',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a8c28e874826634125ad9b5f59511f445',1,'nmodl::codegen::CodegenCppVisitor']]], ['writeionvar_4498',['WriteIonVar',['../classnmodl_1_1ast_1_1_write_ion_var.html#a0d00c26daa8658ee7f7fca0a79fcd087',1,'nmodl::ast::WriteIonVar::WriteIonVar(Name *name)'],['../classnmodl_1_1ast_1_1_write_ion_var.html#a253097f550e67e805eeadb3119b9497d',1,'nmodl::ast::WriteIonVar::WriteIonVar(std::shared_ptr< Name > name)'],['../classnmodl_1_1ast_1_1_write_ion_var.html#aeaf6de86af2f842ff7ad994b820cae01',1,'nmodl::ast::WriteIonVar::WriteIonVar(const WriteIonVar &obj)']]] ]; diff --git a/html/doxygen/search/functions_2.js b/html/doxygen/search/functions_2.js index df7581fa10..6d8c00b54e 100644 --- a/html/doxygen/search/functions_2.js +++ b/html/doxygen/search/functions_2.js @@ -34,7 +34,7 @@ var searchData= ['compartment_3317',['Compartment',['../classnmodl_1_1ast_1_1_compartment.html#aaec2f5b08588c2a164ae2ab28da031b2',1,'nmodl::ast::Compartment::Compartment(Name *name, Expression *expression, const NameVector &names)'],['../classnmodl_1_1ast_1_1_compartment.html#abbe42d50f84590bccf4eb75de848592a',1,'nmodl::ast::Compartment::Compartment(std::shared_ptr< Name > name, std::shared_ptr< Expression > expression, const NameVector &names)'],['../classnmodl_1_1ast_1_1_compartment.html#a408f24f0d785cfcbb2d0fc78c44d2216',1,'nmodl::ast::Compartment::Compartment(const Compartment &obj)']]], ['compute_3318',['compute',['../namespacenmodl_1_1visitor.html#a7b08d91645042b3be9ad57d18fe5af74',1,'nmodl::visitor']]], ['compute_5fmethod_5fname_3319',['compute_method_name',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae022e99573f663fc0db935c5c1bb7199',1,'nmodl::codegen::CodegenCppVisitor']]], - ['conc_5fwrite_5fstatement_3320',['conc_write_statement',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a805dff5f277ea3b3536a553818fb917a',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['conc_5fwrite_5fstatement_3320',['conc_write_statement',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a542c802c8bea31d9a7702831eb385633',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::conc_write_statement()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ae29a1c321357b464d7a67ee4fbfabfe3',1,'nmodl::codegen::CodegenCppVisitor::conc_write_statement()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a593b6a70562ebbf42e13fea3b03d9174',1,'nmodl::codegen::CodegenNeuronCppVisitor::conc_write_statement()']]], ['conditional_5fblock_5feval_3321',['conditional_block_eval',['../classnmodl_1_1visitor_1_1_d_u_instance.html#a6081d84ad38c6cd7ecb556a4d5e3da63',1,'nmodl::visitor::DUInstance']]], ['conductance_5fstatement_5fpossible_3322',['conductance_statement_possible',['../namespacenmodl_1_1visitor.html#a3d92643ddacd415369de66d97598adff',1,'nmodl::visitor']]], ['conductancehint_3323',['ConductanceHint',['../classnmodl_1_1ast_1_1_conductance_hint.html#a86c9deff0d7740b92bf1a71696b0cb3e',1,'nmodl::ast::ConductanceHint::ConductanceHint(Name *conductance, Name *ion)'],['../classnmodl_1_1ast_1_1_conductance_hint.html#afbf542c5cd83bf9d5ad2bcab404c3143',1,'nmodl::ast::ConductanceHint::ConductanceHint(std::shared_ptr< Name > conductance, std::shared_ptr< Name > ion)'],['../classnmodl_1_1ast_1_1_conductance_hint.html#a8ef842be7cb85d0db8f0a376d8520f4f',1,'nmodl::ast::ConductanceHint::ConductanceHint(const ConductanceHint &obj)']]], diff --git a/html/doxygen/search/functions_8.js b/html/doxygen/search/functions_8.js index aefc0e7456..d20600d8dc 100644 --- a/html/doxygen/search/functions_8.js +++ b/html/doxygen/search/functions_8.js @@ -43,10 +43,10 @@ var searchData= ['internal_5fmethod_5fparameters_3667',['internal_method_parameters',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#af48766525e3a1c8f88471a9338ae59e7',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::internal_method_parameters()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a32f908e88bbb1c5070b5e011f2955c07',1,'nmodl::codegen::CodegenCppVisitor::internal_method_parameters()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a68499754b87764b2eba30bf38a1edbb4',1,'nmodl::codegen::CodegenNeuronCppVisitor::internal_method_parameters()']]], ['ion_3668',['Ion',['../structnmodl_1_1codegen_1_1_ion.html#acd8624aa31dffe4fcf3fbac9efc844d3',1,'nmodl::codegen::Ion::Ion()=delete'],['../structnmodl_1_1codegen_1_1_ion.html#a6266f04720d983a7cd76c92156740b18',1,'nmodl::codegen::Ion::Ion(std::string name)']]], ['ion_5fhas_5fwrite_5fvariable_3669',['ion_has_write_variable',['../structnmodl_1_1codegen_1_1_codegen_info.html#a57b452ff25933eca2595d1bcf2e7fc1a',1,'nmodl::codegen::CodegenInfo']]], - ['ion_5fread_5fstatements_3670',['ion_read_statements',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a2ff6b6d552739a604c1c9c19968dafb4',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], - ['ion_5fread_5fstatements_5foptimized_3671',['ion_read_statements_optimized',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a43e3e9beeb7ca80989d361c917491e1e',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], - ['ion_5fvariable_5fstruct_5frequired_3672',['ion_variable_struct_required',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7089dc9d4bfda5791d6f95388a877c8b',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], - ['ion_5fwrite_5fstatements_3673',['ion_write_statements',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0c07a4568bf732ccc7a6ec9b763bc71b',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['ion_5fread_5fstatements_3670',['ion_read_statements',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6d8c0140086b0f5284e1cf7c23632463',1,'nmodl::codegen::CodegenCppVisitor']]], + ['ion_5fread_5fstatements_5foptimized_3671',['ion_read_statements_optimized',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a26ad42be1c7c9a127b2d806d08e426a6',1,'nmodl::codegen::CodegenCppVisitor']]], + ['ion_5fvariable_5fstruct_5frequired_3672',['ion_variable_struct_required',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a6e25890e173635c92d41465a2ee4d3a2',1,'nmodl::codegen::CodegenCppVisitor']]], + ['ion_5fwrite_5fstatements_3673',['ion_write_statements',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a2e2dd82a055dd830e8efc7f1dce03924',1,'nmodl::codegen::CodegenCppVisitor']]], ['is_5fafter_5fblock_3674',['is_after_block',['../classnmodl_1_1ast_1_1_after_block.html#a765d92e65d0b5f56647a7f62b004aa83',1,'nmodl::ast::AfterBlock::is_after_block()'],['../group__ast__class.html#ga17c42e3c60a25fe417647c5937b682c9',1,'nmodl::ast::Ast::is_after_block()']]], ['is_5fargument_3675',['is_argument',['../classnmodl_1_1ast_1_1_argument.html#a4c17c12603874d22cf5ba56a3e1c23fe',1,'nmodl::ast::Argument::is_argument()'],['../group__ast__class.html#gaa8f35f9c21bc016b4029f66b07052a19',1,'nmodl::ast::Ast::is_argument()']]], ['is_5farray_3676',['is_array',['../classnmodl_1_1symtab_1_1_symbol.html#a354834097a73cafb38c147c5ebdd8501',1,'nmodl::symtab::Symbol']]], diff --git a/html/doxygen/search/functions_e.js b/html/doxygen/search/functions_e.js index 731239cf56..fc748da179 100644 --- a/html/doxygen/search/functions_e.js +++ b/html/doxygen/search/functions_e.js @@ -12,5 +12,5 @@ var searchData= ['operator_7c_3926',['operator|',['../namespacenmodl_1_1symtab_1_1syminfo.html#ae193a4319089058de3dcf879dcef248f',1,'nmodl::symtab::syminfo']]], ['operator_7c_3d_3927',['operator|=',['../namespacenmodl_1_1symtab_1_1syminfo.html#a23dd7c5f633e0adf6322d3f427d8f5a9',1,'nmodl::symtab::syminfo']]], ['operator_7e_3928',['operator~',['../namespacenmodl_1_1symtab_1_1syminfo.html#ac2ce7dd65a7614b9137c9be6bd9f0f8d',1,'nmodl::symtab::syminfo']]], - ['optimize_5fion_5fvariable_5fcopies_3929',['optimize_ion_variable_copies',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a58808da4cf7e64ffb1bcb5be20f977e3',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]] + ['optimize_5fion_5fvariable_5fcopies_3929',['optimize_ion_variable_copies',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a0620e76a8bf6864c3f4a38680f514158',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::optimize_ion_variable_copies()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#a81cded985b616728b55976bf7eca4488',1,'nmodl::codegen::CodegenCppVisitor::optimize_ion_variable_copies()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a70bd9cedc2fcae2e924ebcc59c7f728b',1,'nmodl::codegen::CodegenNeuronCppVisitor::optimize_ion_variable_copies()']]] ]; diff --git a/html/doxygen/search/functions_f.js b/html/doxygen/search/functions_f.js index 8730c7be55..8ba92a7e0f 100644 --- a/html/doxygen/search/functions_f.js +++ b/html/doxygen/search/functions_f.js @@ -154,7 +154,7 @@ var searchData= ['procedureblock_4081',['ProcedureBlock',['../classnmodl_1_1ast_1_1_procedure_block.html#a0cc76a647e617a1d407fdb578a8a3d57',1,'nmodl::ast::ProcedureBlock::ProcedureBlock(Name *name, const ArgumentVector &parameters, Unit *unit, StatementBlock *statement_block)'],['../classnmodl_1_1ast_1_1_procedure_block.html#a418dcd33b5d0e1b6434c7c65a14c595a',1,'nmodl::ast::ProcedureBlock::ProcedureBlock(std::shared_ptr< Name > name, const ArgumentVector &parameters, std::shared_ptr< Unit > unit, std::shared_ptr< StatementBlock > statement_block)'],['../classnmodl_1_1ast_1_1_procedure_block.html#ad8ca44e8319b70373c78b93bcbb23fdf',1,'nmodl::ast::ProcedureBlock::ProcedureBlock(const ProcedureBlock &obj)']]], ['process_5fconserve_5freac_5fvar_4082',['process_conserve_reac_var',['../classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#ac5d5210f6bdfcc465b16060a4617666b',1,'nmodl::visitor::KineticBlockVisitor']]], ['process_5freac_5fvar_4083',['process_reac_var',['../classnmodl_1_1visitor_1_1_kinetic_block_visitor.html#ae7a3356a1f16710b5363d78766d87b1c',1,'nmodl::visitor::KineticBlockVisitor']]], - ['process_5fshadow_5fupdate_5fstatement_4084',['process_shadow_update_statement',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a7b99884ba28c9b21c1ff40bb54ca20f5',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], + ['process_5fshadow_5fupdate_5fstatement_4084',['process_shadow_update_statement',['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#aa539bb6033a8bcd87fc4eb279bad887a',1,'nmodl::codegen::CodegenCppVisitor']]], ['process_5fvariable_4085',['process_variable',['../classnmodl_1_1visitor_1_1_def_use_analyze_visitor.html#a9e067ed5dcbf4d182ed6626f7585e6bd',1,'nmodl::visitor::DefUseAnalyzeVisitor::process_variable(const std::string &name)'],['../classnmodl_1_1visitor_1_1_def_use_analyze_visitor.html#a87e566fcf029a317582663c07c9ceba1',1,'nmodl::visitor::DefUseAnalyzeVisitor::process_variable(const std::string &name, int index)']]], ['process_5fverbatim_5ftext_4086',['process_verbatim_text',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a592905dcf5bb27083ec0a84f1ab29508',1,'nmodl::codegen::CodegenCoreneuronCppVisitor::process_verbatim_text()'],['../classnmodl_1_1codegen_1_1_codegen_cpp_visitor.html#ac53419e9abc2d2f9b12acf10507e7954',1,'nmodl::codegen::CodegenCppVisitor::process_verbatim_text()'],['../classnmodl_1_1codegen_1_1_codegen_neuron_cpp_visitor.html#a13af4fa40fc5b97bfcf91d199fe6a8e2',1,'nmodl::codegen::CodegenNeuronCppVisitor::process_verbatim_text()']]], ['process_5fverbatim_5ftoken_4087',['process_verbatim_token',['../classnmodl_1_1codegen_1_1_codegen_coreneuron_cpp_visitor.html#a4ce5f8dd96c5a12646610da8e40de705',1,'nmodl::codegen::CodegenCoreneuronCppVisitor']]], diff --git a/html/doxygen/src_2codegen_2codegen__coreneuron__cpp__visitor_8cpp_source.html b/html/doxygen/src_2codegen_2codegen__coreneuron__cpp__visitor_8cpp_source.html index e3f851291e..b7b67ae54f 100644 --- a/html/doxygen/src_2codegen_2codegen__coreneuron__cpp__visitor_8cpp_source.html +++ b/html/doxygen/src_2codegen_2codegen__coreneuron__cpp__visitor_8cpp_source.html @@ -184,3838 +184,3640 @@
                                              88 
                                              89 
                                              90 /**
                                              -
                                              91  * \details Current variable used in breakpoint block could be local variable.
                                              -
                                              92  * In this case, neuron has already renamed the variable name by prepending
                                              -
                                              93  * "_l". In our implementation, the variable could have been renamed by
                                              -
                                              94  * one of the pass. And hence, we search all local variables and check if
                                              -
                                              95  * the variable is renamed. Note that we have to look into the symbol table
                                              -
                                              96  * of statement block and not breakpoint.
                                              -
                                              97  */
                                              -
                                              98 std::string CodegenCoreneuronCppVisitor::breakpoint_current(std::string current) const {
                                              -
                                              99  auto breakpoint = info.breakpoint_node;
                                              -
                                              100  if (breakpoint == nullptr) {
                                              -
                                              101  return current;
                                              -
                                              102  }
                                              -
                                              103  auto symtab = breakpoint->get_statement_block()->get_symbol_table();
                                              -
                                              104  auto variables = symtab->get_variables_with_properties(NmodlType::local_var);
                                              -
                                              105  for (const auto& var: variables) {
                                              -
                                              106  auto renamed_name = var->get_name();
                                              -
                                              107  auto original_name = var->get_original_name();
                                              -
                                              108  if (current == original_name) {
                                              -
                                              109  current = renamed_name;
                                              -
                                              110  break;
                                              -
                                              111  }
                                              -
                                              112  }
                                              -
                                              113  return current;
                                              -
                                              114 }
                                              -
                                              115 
                                              -
                                              116 
                                              -
                                              117 /**
                                              -
                                              118  * \details Depending upon the block type, we have to print read/write ion variables
                                              -
                                              119  * during code generation. Depending on block/procedure being printed, this
                                              -
                                              120  * method return statements as vector. As different code backends could have
                                              -
                                              121  * different variable names, we rely on backend-specific read_ion_variable_name
                                              -
                                              122  * and write_ion_variable_name method which will be overloaded.
                                              -
                                              123  */
                                              -
                                              124 std::vector<std::string> CodegenCoreneuronCppVisitor::ion_read_statements(BlockType type) const {
                                              -
                                              125  if (optimize_ion_variable_copies()) {
                                              -
                                              126  return ion_read_statements_optimized(type);
                                              -
                                              127  }
                                              -
                                              128  std::vector<std::string> statements;
                                              -
                                              129  for (const auto& ion: info.ions) {
                                              -
                                              130  auto name = ion.name;
                                              -
                                              131  for (const auto& var: ion.reads) {
                                              -
                                              132  auto const iter = std::find(ion.implicit_reads.begin(), ion.implicit_reads.end(), var);
                                              -
                                              133  if (iter != ion.implicit_reads.end()) {
                                              -
                                              134  continue;
                                              -
                                              135  }
                                              -
                                              136  auto variable_names = read_ion_variable_name(var);
                                              -
                                              137  auto first = get_variable_name(variable_names.first);
                                              -
                                              138  auto second = get_variable_name(variable_names.second);
                                              -
                                              139  statements.push_back(fmt::format("{} = {};", first, second));
                                              -
                                              140  }
                                              -
                                              141  for (const auto& var: ion.writes) {
                                              -
                                              142  if (ion.is_ionic_conc(var)) {
                                              -
                                              143  auto variables = read_ion_variable_name(var);
                                              -
                                              144  auto first = get_variable_name(variables.first);
                                              -
                                              145  auto second = get_variable_name(variables.second);
                                              -
                                              146  statements.push_back(fmt::format("{} = {};", first, second));
                                              -
                                              147  }
                                              -
                                              148  }
                                              -
                                              149  }
                                              -
                                              150  return statements;
                                              -
                                              151 }
                                              -
                                              152 
                                              +
                                              91  * \details Often top level verbatim blocks use variables with old names.
                                              +
                                              92  * Here we process if we are processing verbatim block at global scope.
                                              +
                                              93  */
                                              +
                                              94 std::string CodegenCoreneuronCppVisitor::process_verbatim_token(const std::string& token) {
                                              +
                                              95  const std::string& name = token;
                                              +
                                              96 
                                              +
                                              97  /*
                                              +
                                              98  * If given token is procedure name and if it's defined
                                              +
                                              99  * in the current mod file then it must be replaced
                                              +
                                              100  */
                                              +
                                              101  if (program_symtab->is_method_defined(token)) {
                                              +
                                              102  return method_name(token);
                                              +
                                              103  }
                                              +
                                              104 
                                              +
                                              105  /*
                                              +
                                              106  * Check if token is commongly used variable name in
                                              +
                                              107  * verbatim block like nt, \c \_threadargs etc. If so, replace
                                              +
                                              108  * it and return.
                                              +
                                              109  */
                                              +
                                              110  auto new_name = replace_if_verbatim_variable(name);
                                              +
                                              111  if (new_name != name) {
                                              +
                                              112  return get_variable_name(new_name, false);
                                              +
                                              113  }
                                              +
                                              114 
                                              +
                                              115  /*
                                              +
                                              116  * For top level verbatim blocks we shouldn't replace variable
                                              +
                                              117  * names with Instance because arguments are provided from coreneuron
                                              +
                                              118  * and they are missing inst.
                                              +
                                              119  */
                                              +
                                              120  auto use_instance = !printing_top_verbatim_blocks;
                                              +
                                              121  return get_variable_name(token, use_instance);
                                              +
                                              122 }
                                              +
                                              123 
                                              +
                                              124 
                                              +
                                              125 /**
                                              +
                                              126  * \details This can be override in the backend. For example, parameters can be constant
                                              +
                                              127  * except in INITIAL block where they are set to 0. As initial block is/can be
                                              +
                                              128  * executed on c++/cpu backend, gpu backend can mark the parameter as constant.
                                              +
                                              129  */
                                              +
                                              130 bool CodegenCoreneuronCppVisitor::is_constant_variable(const std::string& name) const {
                                              +
                                              131  auto symbol = program_symtab->lookup_in_scope(name);
                                              +
                                              132  bool is_constant = false;
                                              +
                                              133  if (symbol != nullptr) {
                                              +
                                              134  // per mechanism ion variables needs to be updated from neuron/coreneuron values
                                              +
                                              135  if (info.is_ion_variable(name)) {
                                              +
                                              136  is_constant = false;
                                              +
                                              137  }
                                              +
                                              138  // for parameter variable to be const, make sure it's write count is 0
                                              +
                                              139  // and it's not used in the verbatim block
                                              +
                                              140  else if (symbol->has_any_property(NmodlType::param_assign) &&
                                              +
                                              141  info.variables_in_verbatim.find(name) == info.variables_in_verbatim.end() &&
                                              +
                                              142  symbol->get_write_count() == 0) {
                                              +
                                              143  is_constant = true;
                                              +
                                              144  }
                                              +
                                              145  }
                                              +
                                              146  return is_constant;
                                              +
                                              147 }
                                              +
                                              148 
                                              +
                                              149 
                                              +
                                              150 /****************************************************************************************/
                                              +
                                              151 /* Backend specific routines */
                                              +
                                              152 /****************************************************************************************/
                                              153 
                                              - -
                                              155  BlockType type) const {
                                              -
                                              156  std::vector<std::string> statements;
                                              -
                                              157  for (const auto& ion: info.ions) {
                                              -
                                              158  for (const auto& var: ion.writes) {
                                              -
                                              159  if (ion.is_ionic_conc(var)) {
                                              -
                                              160  auto variables = read_ion_variable_name(var);
                                              -
                                              161  auto first = "ionvar." + variables.first;
                                              -
                                              162  const auto& second = get_variable_name(variables.second);
                                              -
                                              163  statements.push_back(fmt::format("{} = {};", first, second));
                                              -
                                              164  }
                                              -
                                              165  }
                                              -
                                              166  }
                                              -
                                              167  return statements;
                                              -
                                              168 }
                                              +
                                              154 
                                              + +
                                              156  // backend specific, do nothing
                                              +
                                              157 }
                                              +
                                              158 
                                              +
                                              159 
                                              + +
                                              161  // backend specific, do nothing
                                              +
                                              162 }
                                              +
                                              163 
                                              +
                                              164 
                                              + +
                                              166  // backend specific, do nothing
                                              +
                                              167 }
                                              +
                                              168 
                                              169 
                                              -
                                              170 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
                                              -
                                              171 std::vector<ShadowUseStatement> CodegenCoreneuronCppVisitor::ion_write_statements(BlockType type) {
                                              -
                                              172  std::vector<ShadowUseStatement> statements;
                                              -
                                              173  for (const auto& ion: info.ions) {
                                              -
                                              174  std::string concentration;
                                              -
                                              175  auto name = ion.name;
                                              -
                                              176  for (const auto& var: ion.writes) {
                                              -
                                              177  auto variable_names = write_ion_variable_name(var);
                                              -
                                              178  if (ion.is_ionic_current(var)) {
                                              -
                                              179  if (type == BlockType::Equation) {
                                              -
                                              180  auto current = breakpoint_current(var);
                                              -
                                              181  auto lhs = variable_names.first;
                                              -
                                              182  auto op = "+=";
                                              -
                                              183  auto rhs = get_variable_name(current);
                                              -
                                              184  if (info.point_process) {
                                              -
                                              185  auto area = get_variable_name(naming::NODE_AREA_VARIABLE);
                                              -
                                              186  rhs += fmt::format("*(1.e2/{})", area);
                                              -
                                              187  }
                                              -
                                              188  statements.push_back(ShadowUseStatement{lhs, op, rhs});
                                              -
                                              189  }
                                              -
                                              190  } else {
                                              -
                                              191  if (!ion.is_rev_potential(var)) {
                                              -
                                              192  concentration = var;
                                              -
                                              193  }
                                              -
                                              194  auto lhs = variable_names.first;
                                              -
                                              195  auto op = "=";
                                              -
                                              196  auto rhs = get_variable_name(variable_names.second);
                                              -
                                              197  statements.push_back(ShadowUseStatement{lhs, op, rhs});
                                              -
                                              198  }
                                              -
                                              199  }
                                              -
                                              200 
                                              -
                                              201  if (type == BlockType::Initial && !concentration.empty()) {
                                              -
                                              202  int index = 0;
                                              -
                                              203  if (ion.is_intra_cell_conc(concentration)) {
                                              -
                                              204  index = 1;
                                              -
                                              205  } else if (ion.is_extra_cell_conc(concentration)) {
                                              -
                                              206  index = 2;
                                              -
                                              207  } else {
                                              -
                                              208  /// \todo Unhandled case in neuron implementation
                                              -
                                              209  throw std::logic_error(fmt::format("codegen error for {} ion", ion.name));
                                              -
                                              210  }
                                              -
                                              211  auto ion_type_name = fmt::format("{}_type", ion.name);
                                              -
                                              212  auto lhs = fmt::format("int {}", ion_type_name);
                                              -
                                              213  auto op = "=";
                                              -
                                              214  auto rhs = get_variable_name(ion_type_name);
                                              -
                                              215  statements.push_back(ShadowUseStatement{lhs, op, rhs});
                                              -
                                              216  auto statement = conc_write_statement(ion.name, concentration, index);
                                              -
                                              217  statements.push_back(ShadowUseStatement{statement, "", ""});
                                              -
                                              218  }
                                              -
                                              219  }
                                              -
                                              220  return statements;
                                              + +
                                              171  // backend specific, do nothing
                                              +
                                              172 }
                                              +
                                              173 
                                              +
                                              174 
                                              + +
                                              176  // backend specific, do nothing
                                              +
                                              177 }
                                              +
                                              178 
                                              +
                                              179 
                                              + +
                                              181  // backend specific, do nothing
                                              +
                                              182 }
                                              +
                                              183 
                                              +
                                              184 
                                              + +
                                              186  // backend specific, do nothing
                                              +
                                              187 }
                                              +
                                              188 
                                              +
                                              189 
                                              +
                                              190 /**
                                              +
                                              191  * \details Each kernel such as \c nrn\_init, \c nrn\_state and \c nrn\_cur could be offloaded
                                              +
                                              192  * to accelerator. In this case, at very top level, we print pragma
                                              +
                                              193  * for data present. For example:
                                              +
                                              194  *
                                              +
                                              195  * \code{.cpp}
                                              +
                                              196  * void nrn_state(...) {
                                              +
                                              197  * #pragma acc data present (nt, ml...)
                                              +
                                              198  * {
                                              +
                                              199  *
                                              +
                                              200  * }
                                              +
                                              201  * }
                                              +
                                              202  * \endcode
                                              +
                                              203  */
                                              + +
                                              205  // backend specific, do nothing
                                              +
                                              206 }
                                              +
                                              207 
                                              +
                                              208 
                                              + +
                                              210  // backend specific, do nothing
                                              +
                                              211 }
                                              +
                                              212 
                                              +
                                              213 
                                              + +
                                              215  // backend specific, do nothing
                                              +
                                              216 }
                                              +
                                              217 
                                              +
                                              218 
                                              + +
                                              220  // backend specific, do nothing
                                              221 }
                                              222 
                                              223 
                                              224 /**
                                              -
                                              225  * \details Often top level verbatim blocks use variables with old names.
                                              -
                                              226  * Here we process if we are processing verbatim block at global scope.
                                              -
                                              227  */
                                              -
                                              228 std::string CodegenCoreneuronCppVisitor::process_verbatim_token(const std::string& token) {
                                              -
                                              229  const std::string& name = token;
                                              -
                                              230 
                                              -
                                              231  /*
                                              -
                                              232  * If given token is procedure name and if it's defined
                                              -
                                              233  * in the current mod file then it must be replaced
                                              -
                                              234  */
                                              -
                                              235  if (program_symtab->is_method_defined(token)) {
                                              -
                                              236  return method_name(token);
                                              -
                                              237  }
                                              -
                                              238 
                                              -
                                              239  /*
                                              -
                                              240  * Check if token is commongly used variable name in
                                              -
                                              241  * verbatim block like nt, \c \_threadargs etc. If so, replace
                                              -
                                              242  * it and return.
                                              -
                                              243  */
                                              -
                                              244  auto new_name = replace_if_verbatim_variable(name);
                                              -
                                              245  if (new_name != name) {
                                              -
                                              246  return get_variable_name(new_name, false);
                                              -
                                              247  }
                                              -
                                              248 
                                              -
                                              249  /*
                                              -
                                              250  * For top level verbatim blocks we shouldn't replace variable
                                              -
                                              251  * names with Instance because arguments are provided from coreneuron
                                              -
                                              252  * and they are missing inst.
                                              -
                                              253  */
                                              -
                                              254  auto use_instance = !printing_top_verbatim_blocks;
                                              -
                                              255  return get_variable_name(token, use_instance);
                                              +
                                              225  * \details Depending programming model and compiler, we print compiler hint
                                              +
                                              226  * for parallelization. For example:
                                              +
                                              227  *
                                              +
                                              228  * \code
                                              +
                                              229  * #pragma omp simd
                                              +
                                              230  * for(int id = 0; id < nodecount; id++) {
                                              +
                                              231  *
                                              +
                                              232  * #pragma acc parallel loop
                                              +
                                              233  * for(int id = 0; id < nodecount; id++) {
                                              +
                                              234  * \endcode
                                              +
                                              235  */
                                              + +
                                              237  BlockType /* type */,
                                              +
                                              238  const ast::Block* block) {
                                              +
                                              239  // ivdep allows SIMD parallelisation of a block/loop but doesn't provide
                                              +
                                              240  // a standard mechanism for atomics. Also, even with openmp 5.0, openmp
                                              +
                                              241  // atomics do not enable vectorisation under "omp simd" (gives compiler
                                              +
                                              242  // error with gcc < 9 if atomic and simd pragmas are nested). So, emit
                                              +
                                              243  // ivdep/simd pragma when no MUTEXLOCK/MUTEXUNLOCK/PROTECT statements
                                              +
                                              244  // are used in the given block.
                                              +
                                              245  std::vector<std::shared_ptr<const ast::Ast>> nodes;
                                              +
                                              246  if (block) {
                                              +
                                              247  nodes = collect_nodes(*block,
                                              + + + +
                                              251  }
                                              +
                                              252  if (nodes.empty()) {
                                              +
                                              253  printer->add_line("#pragma omp simd");
                                              +
                                              254  printer->add_line("#pragma ivdep");
                                              +
                                              255  }
                                              256 }
                                              257 
                                              258 
                                              - -
                                              260  return optimize_ion_variable_copies() && info.ion_has_write_variable();
                                              + +
                                              260  return info.point_process;
                                              261 }
                                              262 
                                              -
                                              263 
                                              -
                                              264 /**
                                              -
                                              265  * \details This can be override in the backend. For example, parameters can be constant
                                              -
                                              266  * except in INITIAL block where they are set to 0. As initial block is/can be
                                              -
                                              267  * executed on c++/cpu backend, gpu backend can mark the parameter as constant.
                                              -
                                              268  */
                                              -
                                              269 bool CodegenCoreneuronCppVisitor::is_constant_variable(const std::string& name) const {
                                              -
                                              270  auto symbol = program_symtab->lookup_in_scope(name);
                                              -
                                              271  bool is_constant = false;
                                              -
                                              272  if (symbol != nullptr) {
                                              -
                                              273  // per mechanism ion variables needs to be updated from neuron/coreneuron values
                                              -
                                              274  if (info.is_ion_variable(name)) {
                                              -
                                              275  is_constant = false;
                                              -
                                              276  }
                                              -
                                              277  // for parameter variable to be const, make sure it's write count is 0
                                              -
                                              278  // and it's not used in the verbatim block
                                              -
                                              279  else if (symbol->has_any_property(NmodlType::param_assign) &&
                                              -
                                              280  info.variables_in_verbatim.find(name) == info.variables_in_verbatim.end() &&
                                              -
                                              281  symbol->get_write_count() == 0) {
                                              -
                                              282  is_constant = true;
                                              -
                                              283  }
                                              -
                                              284  }
                                              -
                                              285  return is_constant;
                                              -
                                              286 }
                                              -
                                              287 
                                              -
                                              288 
                                              -
                                              289 /****************************************************************************************/
                                              -
                                              290 /* Backend specific routines */
                                              -
                                              291 /****************************************************************************************/
                                              -
                                              292 
                                              -
                                              293 
                                              - -
                                              295  // backend specific, do nothing
                                              -
                                              296 }
                                              -
                                              297 
                                              -
                                              298 
                                              - -
                                              300  // backend specific, do nothing
                                              -
                                              301 }
                                              -
                                              302 
                                              -
                                              303 
                                              - -
                                              305  // backend specific, do nothing
                                              -
                                              306 }
                                              -
                                              307 
                                              -
                                              308 
                                              - -
                                              310  // backend specific, do nothing
                                              -
                                              311 }
                                              -
                                              312 
                                              -
                                              313 
                                              - -
                                              315  // backend specific, do nothing
                                              -
                                              316 }
                                              -
                                              317 
                                              -
                                              318 
                                              - -
                                              320  // backend specific, do nothing
                                              -
                                              321 }
                                              -
                                              322 
                                              -
                                              323 
                                              - -
                                              325  // backend specific, do nothing
                                              -
                                              326 }
                                              -
                                              327 
                                              -
                                              328 
                                              -
                                              329 /**
                                              -
                                              330  * \details Each kernel such as \c nrn\_init, \c nrn\_state and \c nrn\_cur could be offloaded
                                              -
                                              331  * to accelerator. In this case, at very top level, we print pragma
                                              -
                                              332  * for data present. For example:
                                              -
                                              333  *
                                              -
                                              334  * \code{.cpp}
                                              -
                                              335  * void nrn_state(...) {
                                              -
                                              336  * #pragma acc data present (nt, ml...)
                                              -
                                              337  * {
                                              -
                                              338  *
                                              -
                                              339  * }
                                              -
                                              340  * }
                                              -
                                              341  * \endcode
                                              -
                                              342  */
                                              - -
                                              344  // backend specific, do nothing
                                              -
                                              345 }
                                              -
                                              346 
                                              -
                                              347 
                                              - -
                                              349  // backend specific, do nothing
                                              +
                                              263 
                                              + +
                                              265  if (info.point_process) {
                                              +
                                              266  printer->fmt_line("double* shadow_rhs = nt->{};", naming::NTHREAD_RHS_SHADOW);
                                              +
                                              267  printer->fmt_line("double* shadow_d = nt->{};", naming::NTHREAD_D_SHADOW);
                                              +
                                              268  }
                                              +
                                              269 }
                                              +
                                              270 
                                              +
                                              271 
                                              + +
                                              273  if (info.point_process) {
                                              +
                                              274  printer->add_line("shadow_rhs[id] = rhs;");
                                              +
                                              275  printer->add_line("shadow_d[id] = g;");
                                              +
                                              276  } else {
                                              +
                                              277  auto rhs_op = operator_for_rhs();
                                              +
                                              278  auto d_op = operator_for_d();
                                              +
                                              279  printer->fmt_line("vec_rhs[node_id] {} rhs;", rhs_op);
                                              +
                                              280  printer->fmt_line("vec_d[node_id] {} g;", d_op);
                                              +
                                              281  }
                                              +
                                              282 }
                                              +
                                              283 
                                              +
                                              284 
                                              + +
                                              286  auto rhs_op = operator_for_rhs();
                                              +
                                              287  auto d_op = operator_for_d();
                                              +
                                              288  if (info.point_process) {
                                              +
                                              289  printer->add_line("int node_id = node_index[id];");
                                              +
                                              290  printer->fmt_line("vec_rhs[node_id] {} shadow_rhs[id];", rhs_op);
                                              +
                                              291  printer->fmt_line("vec_d[node_id] {} shadow_d[id];", d_op);
                                              +
                                              292  }
                                              +
                                              293 }
                                              +
                                              294 
                                              +
                                              295 
                                              +
                                              296 /**
                                              +
                                              297  * In the current implementation of CPU/CPP backend we need to emit atomic pragma
                                              +
                                              298  * only with PROTECT construct (atomic rduction requirement for other cases on CPU
                                              +
                                              299  * is handled via separate shadow vectors).
                                              +
                                              300  */
                                              + +
                                              302  printer->add_line("#pragma omp atomic update");
                                              +
                                              303 }
                                              +
                                              304 
                                              +
                                              305 
                                              + +
                                              307  // backend specific, nothing for cpu
                                              +
                                              308 }
                                              +
                                              309 
                                              +
                                              310 
                                              + +
                                              312  // backend specific, nothing for cpu
                                              +
                                              313 }
                                              +
                                              314 
                                              +
                                              315 
                                              + +
                                              317  // no separate namespace for C++ (cpu) backend
                                              +
                                              318 }
                                              +
                                              319 
                                              +
                                              320 
                                              + +
                                              322  // no separate namespace for C++ (cpu) backend
                                              +
                                              323 }
                                              +
                                              324 
                                              +
                                              325 
                                              + +
                                              327  // backend specific, nothing for cpu
                                              +
                                              328 }
                                              +
                                              329 
                                              +
                                              330 
                                              + +
                                              332  return optimize_ionvar_copies;
                                              +
                                              333 }
                                              +
                                              334 
                                              +
                                              335 
                                              + +
                                              337  printer->add_newline(2);
                                              +
                                              338  auto args = "size_t num, size_t size, size_t alignment = 16";
                                              +
                                              339  printer->fmt_push_block("static inline void* mem_alloc({})", args);
                                              +
                                              340  printer->add_line("void* ptr;");
                                              +
                                              341  printer->add_line("posix_memalign(&ptr, alignment, num*size);");
                                              +
                                              342  printer->add_line("memset(ptr, 0, size);");
                                              +
                                              343  printer->add_line("return ptr;");
                                              +
                                              344  printer->pop_block();
                                              +
                                              345 
                                              +
                                              346  printer->add_newline(2);
                                              +
                                              347  printer->push_block("static inline void mem_free(void* ptr)");
                                              +
                                              348  printer->add_line("free(ptr);");
                                              +
                                              349  printer->pop_block();
                                              350 }
                                              351 
                                              352 
                                              - -
                                              354  // backend specific, do nothing
                                              -
                                              355 }
                                              -
                                              356 
                                              -
                                              357 
                                              - -
                                              359  // backend specific, do nothing
                                              -
                                              360 }
                                              -
                                              361 
                                              -
                                              362 
                                              -
                                              363 /**
                                              -
                                              364  * \details Depending programming model and compiler, we print compiler hint
                                              -
                                              365  * for parallelization. For example:
                                              -
                                              366  *
                                              -
                                              367  * \code
                                              -
                                              368  * #pragma omp simd
                                              -
                                              369  * for(int id = 0; id < nodecount; id++) {
                                              -
                                              370  *
                                              -
                                              371  * #pragma acc parallel loop
                                              -
                                              372  * for(int id = 0; id < nodecount; id++) {
                                              -
                                              373  * \endcode
                                              -
                                              374  */
                                              - -
                                              376  BlockType /* type */,
                                              -
                                              377  const ast::Block* block) {
                                              -
                                              378  // ivdep allows SIMD parallelisation of a block/loop but doesn't provide
                                              -
                                              379  // a standard mechanism for atomics. Also, even with openmp 5.0, openmp
                                              -
                                              380  // atomics do not enable vectorisation under "omp simd" (gives compiler
                                              -
                                              381  // error with gcc < 9 if atomic and simd pragmas are nested). So, emit
                                              -
                                              382  // ivdep/simd pragma when no MUTEXLOCK/MUTEXUNLOCK/PROTECT statements
                                              -
                                              383  // are used in the given block.
                                              -
                                              384  std::vector<std::shared_ptr<const ast::Ast>> nodes;
                                              -
                                              385  if (block) {
                                              -
                                              386  nodes = collect_nodes(*block,
                                              - - - -
                                              390  }
                                              -
                                              391  if (nodes.empty()) {
                                              -
                                              392  printer->add_line("#pragma omp simd");
                                              -
                                              393  printer->add_line("#pragma ivdep");
                                              -
                                              394  }
                                              -
                                              395 }
                                              -
                                              396 
                                              -
                                              397 
                                              - -
                                              399  return info.point_process;
                                              -
                                              400 }
                                              -
                                              401 
                                              -
                                              402 
                                              - -
                                              404  if (info.point_process) {
                                              -
                                              405  printer->fmt_line("double* shadow_rhs = nt->{};", naming::NTHREAD_RHS_SHADOW);
                                              -
                                              406  printer->fmt_line("double* shadow_d = nt->{};", naming::NTHREAD_D_SHADOW);
                                              -
                                              407  }
                                              -
                                              408 }
                                              -
                                              409 
                                              -
                                              410 
                                              - -
                                              412  if (info.point_process) {
                                              -
                                              413  printer->add_line("shadow_rhs[id] = rhs;");
                                              -
                                              414  printer->add_line("shadow_d[id] = g;");
                                              -
                                              415  } else {
                                              -
                                              416  auto rhs_op = operator_for_rhs();
                                              -
                                              417  auto d_op = operator_for_d();
                                              -
                                              418  printer->fmt_line("vec_rhs[node_id] {} rhs;", rhs_op);
                                              -
                                              419  printer->fmt_line("vec_d[node_id] {} g;", d_op);
                                              -
                                              420  }
                                              + +
                                              354  printer->add_newline(2);
                                              +
                                              355  printer->push_block("static inline void coreneuron_abort()");
                                              +
                                              356  printer->add_line("abort();");
                                              +
                                              357  printer->pop_block();
                                              +
                                              358 }
                                              +
                                              359 
                                              +
                                              360 
                                              +
                                              361 /****************************************************************************************/
                                              +
                                              362 /* Printing routines for code generation */
                                              +
                                              363 /****************************************************************************************/
                                              +
                                              364 
                                              +
                                              365 
                                              + +
                                              367  if (info.top_verbatim_blocks.empty()) {
                                              +
                                              368  return;
                                              +
                                              369  }
                                              +
                                              370  print_namespace_stop();
                                              +
                                              371 
                                              +
                                              372  printer->add_newline(2);
                                              +
                                              373  printer->add_line("using namespace coreneuron;");
                                              +
                                              374 
                                              +
                                              375  printing_top_verbatim_blocks = true;
                                              +
                                              376 
                                              +
                                              377  for (const auto& block: info.top_blocks) {
                                              +
                                              378  if (block->is_verbatim()) {
                                              +
                                              379  printer->add_newline(2);
                                              +
                                              380  block->accept(*this);
                                              +
                                              381  }
                                              +
                                              382  }
                                              +
                                              383 
                                              +
                                              384  printing_top_verbatim_blocks = false;
                                              +
                                              385 
                                              +
                                              386  print_namespace_start();
                                              +
                                              387 }
                                              +
                                              388 
                                              +
                                              389 
                                              + +
                                              391  if (info.functions.empty() && info.procedures.empty()) {
                                              +
                                              392  return;
                                              +
                                              393  }
                                              +
                                              394 
                                              +
                                              395  printer->add_newline(2);
                                              +
                                              396  for (const auto& node: info.functions) {
                                              +
                                              397  print_function_declaration(*node, node->get_node_name());
                                              +
                                              398  printer->add_text(';');
                                              +
                                              399  printer->add_newline();
                                              +
                                              400  }
                                              +
                                              401  for (const auto& node: info.procedures) {
                                              +
                                              402  print_function_declaration(*node, node->get_node_name());
                                              +
                                              403  printer->add_text(';');
                                              +
                                              404  printer->add_newline();
                                              +
                                              405  }
                                              +
                                              406 }
                                              +
                                              407 
                                              +
                                              408 
                                              +
                                              409 static const TableStatement* get_table_statement(const ast::Block& node) {
                                              +
                                              410  // TableStatementVisitor v;
                                              +
                                              411 
                                              +
                                              412  const auto& table_statements = collect_nodes(node, {AstNodeType::TABLE_STATEMENT});
                                              +
                                              413 
                                              +
                                              414  if (table_statements.size() != 1) {
                                              +
                                              415  auto message = fmt::format("One table statement expected in {} found {}",
                                              +
                                              416  node.get_node_name(),
                                              +
                                              417  table_statements.size());
                                              +
                                              418  throw std::runtime_error(message);
                                              +
                                              419  }
                                              +
                                              420  return dynamic_cast<const TableStatement*>(table_statements.front().get());
                                              421 }
                                              422 
                                              423 
                                              - -
                                              425  auto rhs_op = operator_for_rhs();
                                              -
                                              426  auto d_op = operator_for_d();
                                              -
                                              427  if (info.point_process) {
                                              -
                                              428  printer->add_line("int node_id = node_index[id];");
                                              -
                                              429  printer->fmt_line("vec_rhs[node_id] {} shadow_rhs[id];", rhs_op);
                                              -
                                              430  printer->fmt_line("vec_d[node_id] {} shadow_d[id];", d_op);
                                              -
                                              431  }
                                              -
                                              432 }
                                              -
                                              433 
                                              -
                                              434 
                                              -
                                              435 /**
                                              -
                                              436  * In the current implementation of CPU/CPP backend we need to emit atomic pragma
                                              -
                                              437  * only with PROTECT construct (atomic rduction requirement for other cases on CPU
                                              -
                                              438  * is handled via separate shadow vectors).
                                              -
                                              439  */
                                              - -
                                              441  printer->add_line("#pragma omp atomic update");
                                              -
                                              442 }
                                              -
                                              443 
                                              -
                                              444 
                                              - -
                                              446  // backend specific, nothing for cpu
                                              -
                                              447 }
                                              -
                                              448 
                                              -
                                              449 
                                              - -
                                              451  // backend specific, nothing for cpu
                                              -
                                              452 }
                                              -
                                              453 
                                              -
                                              454 
                                              - -
                                              456  // no separate namespace for C++ (cpu) backend
                                              -
                                              457 }
                                              -
                                              458 
                                              -
                                              459 
                                              - -
                                              461  // no separate namespace for C++ (cpu) backend
                                              -
                                              462 }
                                              -
                                              463 
                                              -
                                              464 
                                              - -
                                              466  // backend specific, nothing for cpu
                                              -
                                              467 }
                                              -
                                              468 
                                              -
                                              469 
                                              - -
                                              471  return optimize_ionvar_copies;
                                              -
                                              472 }
                                              -
                                              473 
                                              +
                                              424 std::tuple<bool, int> CodegenCoreneuronCppVisitor::check_if_var_is_array(const std::string& name) {
                                              +
                                              425  auto symbol = program_symtab->lookup_in_scope(name);
                                              +
                                              426  if (!symbol) {
                                              +
                                              427  throw std::runtime_error(
                                              +
                                              428  fmt::format("CodegenCoreneuronCppVisitor:: {} not found in symbol table!", name));
                                              +
                                              429  }
                                              +
                                              430  if (symbol->is_array()) {
                                              +
                                              431  return {true, symbol->get_length()};
                                              +
                                              432  } else {
                                              +
                                              433  return {false, 0};
                                              +
                                              434  }
                                              +
                                              435 }
                                              +
                                              436 
                                              +
                                              437 
                                              + +
                                              439  auto statement = get_table_statement(node);
                                              +
                                              440  auto table_variables = statement->get_table_vars();
                                              +
                                              441  auto depend_variables = statement->get_depend_vars();
                                              +
                                              442  const auto& from = statement->get_from();
                                              +
                                              443  const auto& to = statement->get_to();
                                              +
                                              444  auto name = node.get_node_name();
                                              +
                                              445  auto internal_params = internal_method_parameters();
                                              +
                                              446  auto with = statement->get_with()->eval();
                                              +
                                              447  auto use_table_var = get_variable_name(naming::USE_TABLE_VARIABLE);
                                              +
                                              448  auto tmin_name = get_variable_name("tmin_" + name);
                                              +
                                              449  auto mfac_name = get_variable_name("mfac_" + name);
                                              +
                                              450  auto float_type = default_float_data_type();
                                              +
                                              451 
                                              +
                                              452  printer->add_newline(2);
                                              +
                                              453  print_device_method_annotation();
                                              +
                                              454  printer->fmt_push_block("void check_{}({})",
                                              +
                                              455  method_name(name),
                                              +
                                              456  get_parameter_str(internal_params));
                                              +
                                              457  {
                                              +
                                              458  printer->fmt_push_block("if ({} == 0)", use_table_var);
                                              +
                                              459  printer->add_line("return;");
                                              +
                                              460  printer->pop_block();
                                              +
                                              461 
                                              +
                                              462  printer->add_line("static bool make_table = true;");
                                              +
                                              463  for (const auto& variable: depend_variables) {
                                              +
                                              464  printer->fmt_line("static {} save_{};", float_type, variable->get_node_name());
                                              +
                                              465  }
                                              +
                                              466 
                                              +
                                              467  for (const auto& variable: depend_variables) {
                                              +
                                              468  const auto& var_name = variable->get_node_name();
                                              +
                                              469  const auto& instance_name = get_variable_name(var_name);
                                              +
                                              470  printer->fmt_push_block("if (save_{} != {})", var_name, instance_name);
                                              +
                                              471  printer->add_line("make_table = true;");
                                              +
                                              472  printer->pop_block();
                                              +
                                              473  }
                                              474 
                                              - -
                                              476  printer->add_newline(2);
                                              -
                                              477  auto args = "size_t num, size_t size, size_t alignment = 16";
                                              -
                                              478  printer->fmt_push_block("static inline void* mem_alloc({})", args);
                                              -
                                              479  printer->add_line("void* ptr;");
                                              -
                                              480  printer->add_line("posix_memalign(&ptr, alignment, num*size);");
                                              -
                                              481  printer->add_line("memset(ptr, 0, size);");
                                              -
                                              482  printer->add_line("return ptr;");
                                              -
                                              483  printer->pop_block();
                                              +
                                              475  printer->push_block("if (make_table)");
                                              +
                                              476  {
                                              +
                                              477  printer->add_line("make_table = false;");
                                              +
                                              478 
                                              +
                                              479  printer->add_indent();
                                              +
                                              480  printer->add_text(tmin_name, " = ");
                                              +
                                              481  from->accept(*this);
                                              +
                                              482  printer->add_text(';');
                                              +
                                              483  printer->add_newline();
                                              484 
                                              -
                                              485  printer->add_newline(2);
                                              -
                                              486  printer->push_block("static inline void mem_free(void* ptr)");
                                              -
                                              487  printer->add_line("free(ptr);");
                                              -
                                              488  printer->pop_block();
                                              -
                                              489 }
                                              +
                                              485  printer->add_indent();
                                              +
                                              486  printer->add_text("double tmax = ");
                                              +
                                              487  to->accept(*this);
                                              +
                                              488  printer->add_text(';');
                                              +
                                              489  printer->add_newline();
                                              490 
                                              491 
                                              - -
                                              493  printer->add_newline(2);
                                              -
                                              494  printer->push_block("static inline void coreneuron_abort()");
                                              -
                                              495  printer->add_line("abort();");
                                              -
                                              496  printer->pop_block();
                                              -
                                              497 }
                                              -
                                              498 
                                              -
                                              499 
                                              -
                                              500 /****************************************************************************************/
                                              -
                                              501 /* Printing routines for code generation */
                                              -
                                              502 /****************************************************************************************/
                                              -
                                              503 
                                              -
                                              504 
                                              - -
                                              506  if (info.top_verbatim_blocks.empty()) {
                                              -
                                              507  return;
                                              -
                                              508  }
                                              -
                                              509  print_namespace_stop();
                                              -
                                              510 
                                              -
                                              511  printer->add_newline(2);
                                              -
                                              512  printer->add_line("using namespace coreneuron;");
                                              -
                                              513 
                                              -
                                              514  printing_top_verbatim_blocks = true;
                                              -
                                              515 
                                              -
                                              516  for (const auto& block: info.top_blocks) {
                                              -
                                              517  if (block->is_verbatim()) {
                                              -
                                              518  printer->add_newline(2);
                                              -
                                              519  block->accept(*this);
                                              -
                                              520  }
                                              -
                                              521  }
                                              +
                                              492  printer->fmt_line("double dx = (tmax-{}) / {}.;", tmin_name, with);
                                              +
                                              493  printer->fmt_line("{} = 1./dx;", mfac_name);
                                              +
                                              494 
                                              +
                                              495  printer->fmt_line("double x = {};", tmin_name);
                                              +
                                              496  printer->fmt_push_block("for (std::size_t i = 0; i < {}; x += dx, i++)", with + 1);
                                              +
                                              497  auto function = method_name("f_" + name);
                                              +
                                              498  if (node.is_procedure_block()) {
                                              +
                                              499  printer->fmt_line("{}({}, x);", function, internal_method_arguments());
                                              +
                                              500  for (const auto& variable: table_variables) {
                                              +
                                              501  auto var_name = variable->get_node_name();
                                              +
                                              502  auto instance_name = get_variable_name(var_name);
                                              +
                                              503  auto table_name = get_variable_name("t_" + var_name);
                                              +
                                              504  auto [is_array, array_length] = check_if_var_is_array(var_name);
                                              +
                                              505  if (is_array) {
                                              +
                                              506  for (int j = 0; j < array_length; j++) {
                                              +
                                              507  printer->fmt_line(
                                              +
                                              508  "{}[{}][i] = {}[{}];", table_name, j, instance_name, j);
                                              +
                                              509  }
                                              +
                                              510  } else {
                                              +
                                              511  printer->fmt_line("{}[i] = {};", table_name, instance_name);
                                              +
                                              512  }
                                              +
                                              513  }
                                              +
                                              514  } else {
                                              +
                                              515  auto table_name = get_variable_name("t_" + name);
                                              +
                                              516  printer->fmt_line("{}[i] = {}({}, x);",
                                              +
                                              517  table_name,
                                              +
                                              518  function,
                                              +
                                              519  internal_method_arguments());
                                              +
                                              520  }
                                              +
                                              521  printer->pop_block();
                                              522 
                                              -
                                              523  printing_top_verbatim_blocks = false;
                                              -
                                              524 
                                              -
                                              525  print_namespace_start();
                                              -
                                              526 }
                                              -
                                              527 
                                              -
                                              528 
                                              - -
                                              530  if (info.functions.empty() && info.procedures.empty()) {
                                              -
                                              531  return;
                                              -
                                              532  }
                                              +
                                              523  for (const auto& variable: depend_variables) {
                                              +
                                              524  auto var_name = variable->get_node_name();
                                              +
                                              525  auto instance_name = get_variable_name(var_name);
                                              +
                                              526  printer->fmt_line("save_{} = {};", var_name, instance_name);
                                              +
                                              527  }
                                              +
                                              528  }
                                              +
                                              529  printer->pop_block();
                                              +
                                              530  }
                                              +
                                              531  printer->pop_block();
                                              +
                                              532 }
                                              533 
                                              -
                                              534  printer->add_newline(2);
                                              -
                                              535  for (const auto& node: info.functions) {
                                              -
                                              536  print_function_declaration(*node, node->get_node_name());
                                              -
                                              537  printer->add_text(';');
                                              -
                                              538  printer->add_newline();
                                              -
                                              539  }
                                              -
                                              540  for (const auto& node: info.procedures) {
                                              -
                                              541  print_function_declaration(*node, node->get_node_name());
                                              -
                                              542  printer->add_text(';');
                                              -
                                              543  printer->add_newline();
                                              -
                                              544  }
                                              -
                                              545 }
                                              -
                                              546 
                                              -
                                              547 
                                              -
                                              548 static const TableStatement* get_table_statement(const ast::Block& node) {
                                              -
                                              549  // TableStatementVisitor v;
                                              -
                                              550 
                                              -
                                              551  const auto& table_statements = collect_nodes(node, {AstNodeType::TABLE_STATEMENT});
                                              -
                                              552 
                                              -
                                              553  if (table_statements.size() != 1) {
                                              -
                                              554  auto message = fmt::format("One table statement expected in {} found {}",
                                              -
                                              555  node.get_node_name(),
                                              -
                                              556  table_statements.size());
                                              -
                                              557  throw std::runtime_error(message);
                                              -
                                              558  }
                                              -
                                              559  return dynamic_cast<const TableStatement*>(table_statements.front().get());
                                              -
                                              560 }
                                              -
                                              561 
                                              -
                                              562 
                                              -
                                              563 std::tuple<bool, int> CodegenCoreneuronCppVisitor::check_if_var_is_array(const std::string& name) {
                                              -
                                              564  auto symbol = program_symtab->lookup_in_scope(name);
                                              -
                                              565  if (!symbol) {
                                              -
                                              566  throw std::runtime_error(
                                              -
                                              567  fmt::format("CodegenCoreneuronCppVisitor:: {} not found in symbol table!", name));
                                              -
                                              568  }
                                              -
                                              569  if (symbol->is_array()) {
                                              -
                                              570  return {true, symbol->get_length()};
                                              -
                                              571  } else {
                                              -
                                              572  return {false, 0};
                                              -
                                              573  }
                                              -
                                              574 }
                                              -
                                              575 
                                              -
                                              576 
                                              - -
                                              578  auto statement = get_table_statement(node);
                                              -
                                              579  auto table_variables = statement->get_table_vars();
                                              -
                                              580  auto depend_variables = statement->get_depend_vars();
                                              -
                                              581  const auto& from = statement->get_from();
                                              -
                                              582  const auto& to = statement->get_to();
                                              -
                                              583  auto name = node.get_node_name();
                                              -
                                              584  auto internal_params = internal_method_parameters();
                                              -
                                              585  auto with = statement->get_with()->eval();
                                              -
                                              586  auto use_table_var = get_variable_name(naming::USE_TABLE_VARIABLE);
                                              -
                                              587  auto tmin_name = get_variable_name("tmin_" + name);
                                              -
                                              588  auto mfac_name = get_variable_name("mfac_" + name);
                                              -
                                              589  auto float_type = default_float_data_type();
                                              -
                                              590 
                                              -
                                              591  printer->add_newline(2);
                                              -
                                              592  print_device_method_annotation();
                                              -
                                              593  printer->fmt_push_block("void check_{}({})",
                                              -
                                              594  method_name(name),
                                              -
                                              595  get_parameter_str(internal_params));
                                              -
                                              596  {
                                              -
                                              597  printer->fmt_push_block("if ({} == 0)", use_table_var);
                                              -
                                              598  printer->add_line("return;");
                                              -
                                              599  printer->pop_block();
                                              -
                                              600 
                                              -
                                              601  printer->add_line("static bool make_table = true;");
                                              -
                                              602  for (const auto& variable: depend_variables) {
                                              -
                                              603  printer->fmt_line("static {} save_{};", float_type, variable->get_node_name());
                                              -
                                              604  }
                                              -
                                              605 
                                              -
                                              606  for (const auto& variable: depend_variables) {
                                              -
                                              607  const auto& var_name = variable->get_node_name();
                                              -
                                              608  const auto& instance_name = get_variable_name(var_name);
                                              -
                                              609  printer->fmt_push_block("if (save_{} != {})", var_name, instance_name);
                                              -
                                              610  printer->add_line("make_table = true;");
                                              -
                                              611  printer->pop_block();
                                              -
                                              612  }
                                              -
                                              613 
                                              -
                                              614  printer->push_block("if (make_table)");
                                              -
                                              615  {
                                              -
                                              616  printer->add_line("make_table = false;");
                                              -
                                              617 
                                              -
                                              618  printer->add_indent();
                                              -
                                              619  printer->add_text(tmin_name, " = ");
                                              -
                                              620  from->accept(*this);
                                              -
                                              621  printer->add_text(';');
                                              -
                                              622  printer->add_newline();
                                              -
                                              623 
                                              -
                                              624  printer->add_indent();
                                              -
                                              625  printer->add_text("double tmax = ");
                                              -
                                              626  to->accept(*this);
                                              -
                                              627  printer->add_text(';');
                                              -
                                              628  printer->add_newline();
                                              -
                                              629 
                                              -
                                              630 
                                              -
                                              631  printer->fmt_line("double dx = (tmax-{}) / {}.;", tmin_name, with);
                                              -
                                              632  printer->fmt_line("{} = 1./dx;", mfac_name);
                                              -
                                              633 
                                              -
                                              634  printer->fmt_line("double x = {};", tmin_name);
                                              -
                                              635  printer->fmt_push_block("for (std::size_t i = 0; i < {}; x += dx, i++)", with + 1);
                                              -
                                              636  auto function = method_name("f_" + name);
                                              -
                                              637  if (node.is_procedure_block()) {
                                              -
                                              638  printer->fmt_line("{}({}, x);", function, internal_method_arguments());
                                              -
                                              639  for (const auto& variable: table_variables) {
                                              -
                                              640  auto var_name = variable->get_node_name();
                                              -
                                              641  auto instance_name = get_variable_name(var_name);
                                              -
                                              642  auto table_name = get_variable_name("t_" + var_name);
                                              -
                                              643  auto [is_array, array_length] = check_if_var_is_array(var_name);
                                              -
                                              644  if (is_array) {
                                              -
                                              645  for (int j = 0; j < array_length; j++) {
                                              -
                                              646  printer->fmt_line(
                                              -
                                              647  "{}[{}][i] = {}[{}];", table_name, j, instance_name, j);
                                              -
                                              648  }
                                              -
                                              649  } else {
                                              -
                                              650  printer->fmt_line("{}[i] = {};", table_name, instance_name);
                                              -
                                              651  }
                                              -
                                              652  }
                                              -
                                              653  } else {
                                              -
                                              654  auto table_name = get_variable_name("t_" + name);
                                              -
                                              655  printer->fmt_line("{}[i] = {}({}, x);",
                                              -
                                              656  table_name,
                                              -
                                              657  function,
                                              -
                                              658  internal_method_arguments());
                                              -
                                              659  }
                                              -
                                              660  printer->pop_block();
                                              -
                                              661 
                                              -
                                              662  for (const auto& variable: depend_variables) {
                                              -
                                              663  auto var_name = variable->get_node_name();
                                              -
                                              664  auto instance_name = get_variable_name(var_name);
                                              -
                                              665  printer->fmt_line("save_{} = {};", var_name, instance_name);
                                              -
                                              666  }
                                              -
                                              667  }
                                              -
                                              668  printer->pop_block();
                                              -
                                              669  }
                                              -
                                              670  printer->pop_block();
                                              -
                                              671 }
                                              -
                                              672 
                                              -
                                              673 
                                              - -
                                              675  auto name = node.get_node_name();
                                              -
                                              676  auto statement = get_table_statement(node);
                                              -
                                              677  auto table_variables = statement->get_table_vars();
                                              -
                                              678  auto with = statement->get_with()->eval();
                                              -
                                              679  auto use_table_var = get_variable_name(naming::USE_TABLE_VARIABLE);
                                              -
                                              680  auto tmin_name = get_variable_name("tmin_" + name);
                                              -
                                              681  auto mfac_name = get_variable_name("mfac_" + name);
                                              -
                                              682  auto function_name = method_name("f_" + name);
                                              -
                                              683 
                                              -
                                              684  printer->add_newline(2);
                                              -
                                              685  print_function_declaration(node, name);
                                              -
                                              686  printer->push_block();
                                              -
                                              687  {
                                              -
                                              688  const auto& params = node.get_parameters();
                                              -
                                              689  printer->fmt_push_block("if ({} == 0)", use_table_var);
                                              -
                                              690  if (node.is_procedure_block()) {
                                              -
                                              691  printer->fmt_line("{}({}, {});",
                                              -
                                              692  function_name,
                                              -
                                              693  internal_method_arguments(),
                                              -
                                              694  params[0].get()->get_node_name());
                                              -
                                              695  printer->add_line("return 0;");
                                              -
                                              696  } else {
                                              -
                                              697  printer->fmt_line("return {}({}, {});",
                                              -
                                              698  function_name,
                                              -
                                              699  internal_method_arguments(),
                                              -
                                              700  params[0].get()->get_node_name());
                                              -
                                              701  }
                                              -
                                              702  printer->pop_block();
                                              -
                                              703 
                                              -
                                              704  printer->fmt_line("double xi = {} * ({} - {});",
                                              -
                                              705  mfac_name,
                                              -
                                              706  params[0].get()->get_node_name(),
                                              -
                                              707  tmin_name);
                                              -
                                              708  printer->push_block("if (isnan(xi))");
                                              -
                                              709  if (node.is_procedure_block()) {
                                              -
                                              710  for (const auto& var: table_variables) {
                                              -
                                              711  auto var_name = get_variable_name(var->get_node_name());
                                              -
                                              712  auto [is_array, array_length] = check_if_var_is_array(var->get_node_name());
                                              -
                                              713  if (is_array) {
                                              -
                                              714  for (int j = 0; j < array_length; j++) {
                                              -
                                              715  printer->fmt_line("{}[{}] = xi;", var_name, j);
                                              -
                                              716  }
                                              -
                                              717  } else {
                                              -
                                              718  printer->fmt_line("{} = xi;", var_name);
                                              -
                                              719  }
                                              -
                                              720  }
                                              -
                                              721  printer->add_line("return 0;");
                                              -
                                              722  } else {
                                              -
                                              723  printer->add_line("return xi;");
                                              -
                                              724  }
                                              -
                                              725  printer->pop_block();
                                              +
                                              534 
                                              + +
                                              536  auto name = node.get_node_name();
                                              +
                                              537  auto statement = get_table_statement(node);
                                              +
                                              538  auto table_variables = statement->get_table_vars();
                                              +
                                              539  auto with = statement->get_with()->eval();
                                              +
                                              540  auto use_table_var = get_variable_name(naming::USE_TABLE_VARIABLE);
                                              +
                                              541  auto tmin_name = get_variable_name("tmin_" + name);
                                              +
                                              542  auto mfac_name = get_variable_name("mfac_" + name);
                                              +
                                              543  auto function_name = method_name("f_" + name);
                                              +
                                              544 
                                              +
                                              545  printer->add_newline(2);
                                              +
                                              546  print_function_declaration(node, name);
                                              +
                                              547  printer->push_block();
                                              +
                                              548  {
                                              +
                                              549  const auto& params = node.get_parameters();
                                              +
                                              550  printer->fmt_push_block("if ({} == 0)", use_table_var);
                                              +
                                              551  if (node.is_procedure_block()) {
                                              +
                                              552  printer->fmt_line("{}({}, {});",
                                              +
                                              553  function_name,
                                              +
                                              554  internal_method_arguments(),
                                              +
                                              555  params[0].get()->get_node_name());
                                              +
                                              556  printer->add_line("return 0;");
                                              +
                                              557  } else {
                                              +
                                              558  printer->fmt_line("return {}({}, {});",
                                              +
                                              559  function_name,
                                              +
                                              560  internal_method_arguments(),
                                              +
                                              561  params[0].get()->get_node_name());
                                              +
                                              562  }
                                              +
                                              563  printer->pop_block();
                                              +
                                              564 
                                              +
                                              565  printer->fmt_line("double xi = {} * ({} - {});",
                                              +
                                              566  mfac_name,
                                              +
                                              567  params[0].get()->get_node_name(),
                                              +
                                              568  tmin_name);
                                              +
                                              569  printer->push_block("if (isnan(xi))");
                                              +
                                              570  if (node.is_procedure_block()) {
                                              +
                                              571  for (const auto& var: table_variables) {
                                              +
                                              572  auto var_name = get_variable_name(var->get_node_name());
                                              +
                                              573  auto [is_array, array_length] = check_if_var_is_array(var->get_node_name());
                                              +
                                              574  if (is_array) {
                                              +
                                              575  for (int j = 0; j < array_length; j++) {
                                              +
                                              576  printer->fmt_line("{}[{}] = xi;", var_name, j);
                                              +
                                              577  }
                                              +
                                              578  } else {
                                              +
                                              579  printer->fmt_line("{} = xi;", var_name);
                                              +
                                              580  }
                                              +
                                              581  }
                                              +
                                              582  printer->add_line("return 0;");
                                              +
                                              583  } else {
                                              +
                                              584  printer->add_line("return xi;");
                                              +
                                              585  }
                                              +
                                              586  printer->pop_block();
                                              +
                                              587 
                                              +
                                              588  printer->fmt_push_block("if (xi <= 0. || xi >= {}.)", with);
                                              +
                                              589  printer->fmt_line("int index = (xi <= 0.) ? 0 : {};", with);
                                              +
                                              590  if (node.is_procedure_block()) {
                                              +
                                              591  for (const auto& variable: table_variables) {
                                              +
                                              592  auto var_name = variable->get_node_name();
                                              +
                                              593  auto instance_name = get_variable_name(var_name);
                                              +
                                              594  auto table_name = get_variable_name("t_" + var_name);
                                              +
                                              595  auto [is_array, array_length] = check_if_var_is_array(var_name);
                                              +
                                              596  if (is_array) {
                                              +
                                              597  for (int j = 0; j < array_length; j++) {
                                              +
                                              598  printer->fmt_line(
                                              +
                                              599  "{}[{}] = {}[{}][index];", instance_name, j, table_name, j);
                                              +
                                              600  }
                                              +
                                              601  } else {
                                              +
                                              602  printer->fmt_line("{} = {}[index];", instance_name, table_name);
                                              +
                                              603  }
                                              +
                                              604  }
                                              +
                                              605  printer->add_line("return 0;");
                                              +
                                              606  } else {
                                              +
                                              607  auto table_name = get_variable_name("t_" + name);
                                              +
                                              608  printer->fmt_line("return {}[index];", table_name);
                                              +
                                              609  }
                                              +
                                              610  printer->pop_block();
                                              +
                                              611 
                                              +
                                              612  printer->add_line("int i = int(xi);");
                                              +
                                              613  printer->add_line("double theta = xi - double(i);");
                                              +
                                              614  if (node.is_procedure_block()) {
                                              +
                                              615  for (const auto& var: table_variables) {
                                              +
                                              616  auto var_name = var->get_node_name();
                                              +
                                              617  auto instance_name = get_variable_name(var_name);
                                              +
                                              618  auto table_name = get_variable_name("t_" + var_name);
                                              +
                                              619  auto [is_array, array_length] = check_if_var_is_array(var->get_node_name());
                                              +
                                              620  if (is_array) {
                                              +
                                              621  for (size_t j = 0; j < array_length; j++) {
                                              +
                                              622  printer->fmt_line(
                                              +
                                              623  "{0}[{1}] = {2}[{1}][i] + theta*({2}[{1}][i+1]-{2}[{1}][i]);",
                                              +
                                              624  instance_name,
                                              +
                                              625  j,
                                              +
                                              626  table_name);
                                              +
                                              627  }
                                              +
                                              628  } else {
                                              +
                                              629  printer->fmt_line("{0} = {1}[i] + theta*({1}[i+1]-{1}[i]);",
                                              +
                                              630  instance_name,
                                              +
                                              631  table_name);
                                              +
                                              632  }
                                              +
                                              633  }
                                              +
                                              634  printer->add_line("return 0;");
                                              +
                                              635  } else {
                                              +
                                              636  auto table_name = get_variable_name("t_" + name);
                                              +
                                              637  printer->fmt_line("return {0}[i] + theta * ({0}[i+1] - {0}[i]);", table_name);
                                              +
                                              638  }
                                              +
                                              639  }
                                              +
                                              640  printer->pop_block();
                                              +
                                              641 }
                                              +
                                              642 
                                              +
                                              643 
                                              + +
                                              645  if (info.table_count == 0) {
                                              +
                                              646  return;
                                              +
                                              647  }
                                              +
                                              648 
                                              +
                                              649  printer->add_newline(2);
                                              +
                                              650  auto name = method_name("check_table_thread");
                                              +
                                              651  auto parameters = external_method_parameters(true);
                                              +
                                              652 
                                              +
                                              653  printer->fmt_push_block("static void {} ({})", name, parameters);
                                              +
                                              654  printer->add_line("setup_instance(nt, ml);");
                                              +
                                              655  printer->fmt_line("auto* const inst = static_cast<{0}*>(ml->instance);", instance_struct());
                                              +
                                              656  printer->add_line("double v = 0;");
                                              +
                                              657 
                                              +
                                              658  for (const auto& function: info.functions_with_table) {
                                              +
                                              659  auto method_name_str = method_name("check_" + function->get_node_name());
                                              +
                                              660  auto arguments = internal_method_arguments();
                                              +
                                              661  printer->fmt_line("{}({});", method_name_str, arguments);
                                              +
                                              662  }
                                              +
                                              663 
                                              +
                                              664  printer->pop_block();
                                              +
                                              665 }
                                              +
                                              666 
                                              +
                                              667 
                                              + +
                                              669  const std::string& name) {
                                              +
                                              670  printer->add_newline(2);
                                              +
                                              671  print_function_declaration(node, name);
                                              +
                                              672  printer->add_text(" ");
                                              +
                                              673  printer->push_block();
                                              +
                                              674 
                                              +
                                              675  // function requires return variable declaration
                                              +
                                              676  if (node.is_function_block()) {
                                              +
                                              677  auto type = default_float_data_type();
                                              +
                                              678  printer->fmt_line("{} ret_{} = 0.0;", type, name);
                                              +
                                              679  } else {
                                              +
                                              680  printer->fmt_line("int ret_{} = 0;", name);
                                              +
                                              681  }
                                              +
                                              682 
                                              +
                                              683  print_statement_block(*node.get_statement_block(), false, false);
                                              +
                                              684  printer->fmt_line("return ret_{};", name);
                                              +
                                              685  printer->pop_block();
                                              +
                                              686 }
                                              +
                                              687 
                                              +
                                              688 
                                              + +
                                              690  auto name = node.get_node_name();
                                              +
                                              691 
                                              +
                                              692  if (info.function_uses_table(name)) {
                                              +
                                              693  auto new_name = "f_" + name;
                                              +
                                              694  print_function_or_procedure(node, new_name);
                                              +
                                              695  print_table_check_function(node);
                                              +
                                              696  print_table_replacement_function(node);
                                              +
                                              697  } else {
                                              +
                                              698  print_function_or_procedure(node, name);
                                              +
                                              699  }
                                              +
                                              700 }
                                              +
                                              701 
                                              +
                                              702 
                                              + +
                                              704  print_function_procedure_helper(node);
                                              +
                                              705 }
                                              +
                                              706 
                                              +
                                              707 
                                              + +
                                              709  auto name = node.get_node_name();
                                              +
                                              710 
                                              +
                                              711  // name of return variable
                                              +
                                              712  std::string return_var;
                                              +
                                              713  if (info.function_uses_table(name)) {
                                              +
                                              714  return_var = "ret_f_" + name;
                                              +
                                              715  } else {
                                              +
                                              716  return_var = "ret_" + name;
                                              +
                                              717  }
                                              +
                                              718 
                                              +
                                              719  // first rename return variable name
                                              +
                                              720  auto block = node.get_statement_block().get();
                                              +
                                              721  RenameVisitor v(name, return_var);
                                              +
                                              722  block->accept(v);
                                              +
                                              723 
                                              +
                                              724  print_function_procedure_helper(node);
                                              +
                                              725 }
                                              726 
                                              -
                                              727  printer->fmt_push_block("if (xi <= 0. || xi >= {}.)", with);
                                              -
                                              728  printer->fmt_line("int index = (xi <= 0.) ? 0 : {};", with);
                                              -
                                              729  if (node.is_procedure_block()) {
                                              -
                                              730  for (const auto& variable: table_variables) {
                                              -
                                              731  auto var_name = variable->get_node_name();
                                              -
                                              732  auto instance_name = get_variable_name(var_name);
                                              -
                                              733  auto table_name = get_variable_name("t_" + var_name);
                                              -
                                              734  auto [is_array, array_length] = check_if_var_is_array(var_name);
                                              -
                                              735  if (is_array) {
                                              -
                                              736  for (int j = 0; j < array_length; j++) {
                                              -
                                              737  printer->fmt_line(
                                              -
                                              738  "{}[{}] = {}[{}][index];", instance_name, j, table_name, j);
                                              -
                                              739  }
                                              -
                                              740  } else {
                                              -
                                              741  printer->fmt_line("{} = {}[index];", instance_name, table_name);
                                              -
                                              742  }
                                              -
                                              743  }
                                              -
                                              744  printer->add_line("return 0;");
                                              -
                                              745  } else {
                                              -
                                              746  auto table_name = get_variable_name("t_" + name);
                                              -
                                              747  printer->fmt_line("return {}[index];", table_name);
                                              -
                                              748  }
                                              -
                                              749  printer->pop_block();
                                              -
                                              750 
                                              -
                                              751  printer->add_line("int i = int(xi);");
                                              -
                                              752  printer->add_line("double theta = xi - double(i);");
                                              -
                                              753  if (node.is_procedure_block()) {
                                              -
                                              754  for (const auto& var: table_variables) {
                                              -
                                              755  auto var_name = var->get_node_name();
                                              -
                                              756  auto instance_name = get_variable_name(var_name);
                                              -
                                              757  auto table_name = get_variable_name("t_" + var_name);
                                              -
                                              758  auto [is_array, array_length] = check_if_var_is_array(var->get_node_name());
                                              -
                                              759  if (is_array) {
                                              -
                                              760  for (size_t j = 0; j < array_length; j++) {
                                              -
                                              761  printer->fmt_line(
                                              -
                                              762  "{0}[{1}] = {2}[{1}][i] + theta*({2}[{1}][i+1]-{2}[{1}][i]);",
                                              -
                                              763  instance_name,
                                              -
                                              764  j,
                                              -
                                              765  table_name);
                                              -
                                              766  }
                                              -
                                              767  } else {
                                              -
                                              768  printer->fmt_line("{0} = {1}[i] + theta*({1}[i+1]-{1}[i]);",
                                              -
                                              769  instance_name,
                                              -
                                              770  table_name);
                                              -
                                              771  }
                                              -
                                              772  }
                                              -
                                              773  printer->add_line("return 0;");
                                              -
                                              774  } else {
                                              -
                                              775  auto table_name = get_variable_name("t_" + name);
                                              -
                                              776  printer->fmt_line("return {0}[i] + theta * ({0}[i+1] - {0}[i]);", table_name);
                                              -
                                              777  }
                                              -
                                              778  }
                                              -
                                              779  printer->pop_block();
                                              -
                                              780 }
                                              -
                                              781 
                                              -
                                              782 
                                              - -
                                              784  if (info.table_count == 0) {
                                              -
                                              785  return;
                                              -
                                              786  }
                                              -
                                              787 
                                              -
                                              788  printer->add_newline(2);
                                              -
                                              789  auto name = method_name("check_table_thread");
                                              -
                                              790  auto parameters = external_method_parameters(true);
                                              -
                                              791 
                                              -
                                              792  printer->fmt_push_block("static void {} ({})", name, parameters);
                                              -
                                              793  printer->add_line("setup_instance(nt, ml);");
                                              -
                                              794  printer->fmt_line("auto* const inst = static_cast<{0}*>(ml->instance);", instance_struct());
                                              -
                                              795  printer->add_line("double v = 0;");
                                              -
                                              796 
                                              -
                                              797  for (const auto& function: info.functions_with_table) {
                                              -
                                              798  auto method_name_str = method_name("check_" + function->get_node_name());
                                              -
                                              799  auto arguments = internal_method_arguments();
                                              -
                                              800  printer->fmt_line("{}({});", method_name_str, arguments);
                                              -
                                              801  }
                                              -
                                              802 
                                              -
                                              803  printer->pop_block();
                                              -
                                              804 }
                                              -
                                              805 
                                              -
                                              806 
                                              - -
                                              808  const std::string& name) {
                                              -
                                              809  printer->add_newline(2);
                                              -
                                              810  print_function_declaration(node, name);
                                              -
                                              811  printer->add_text(" ");
                                              -
                                              812  printer->push_block();
                                              -
                                              813 
                                              -
                                              814  // function requires return variable declaration
                                              -
                                              815  if (node.is_function_block()) {
                                              -
                                              816  auto type = default_float_data_type();
                                              -
                                              817  printer->fmt_line("{} ret_{} = 0.0;", type, name);
                                              -
                                              818  } else {
                                              -
                                              819  printer->fmt_line("int ret_{} = 0;", name);
                                              -
                                              820  }
                                              -
                                              821 
                                              -
                                              822  print_statement_block(*node.get_statement_block(), false, false);
                                              -
                                              823  printer->fmt_line("return ret_{};", name);
                                              -
                                              824  printer->pop_block();
                                              -
                                              825 }
                                              -
                                              826 
                                              -
                                              827 
                                              - -
                                              829  auto name = node.get_node_name();
                                              +
                                              727 
                                              + +
                                              729  auto name = node.get_node_name();
                                              +
                                              730  const auto& p = node.get_parameters();
                                              +
                                              731  auto params = internal_method_parameters();
                                              +
                                              732  for (const auto& i: p) {
                                              +
                                              733  params.emplace_back("", "double", "", i->get_node_name());
                                              +
                                              734  }
                                              +
                                              735  printer->fmt_line("double {}({})", method_name(name), get_parameter_str(params));
                                              +
                                              736  printer->push_block();
                                              +
                                              737  printer->fmt_line("double _arg[{}];", p.size());
                                              +
                                              738  for (size_t i = 0; i < p.size(); ++i) {
                                              +
                                              739  printer->fmt_line("_arg[{}] = {};", i, p[i]->get_node_name());
                                              +
                                              740  }
                                              +
                                              741  printer->fmt_line("return hoc_func_table({}, {}, _arg);",
                                              +
                                              742  get_variable_name(std::string("_ptable_" + name), true),
                                              +
                                              743  p.size());
                                              +
                                              744  printer->pop_block();
                                              +
                                              745 
                                              +
                                              746  printer->fmt_push_block("double table_{}()", method_name(name));
                                              +
                                              747  printer->fmt_line("hoc_spec_table(&{}, {});",
                                              +
                                              748  get_variable_name(std::string("_ptable_" + name)),
                                              +
                                              749  p.size());
                                              +
                                              750  printer->add_line("return 0.;");
                                              +
                                              751  printer->pop_block();
                                              +
                                              752 }
                                              +
                                              753 
                                              +
                                              754 
                                              +
                                              755 /**
                                              +
                                              756  * @brief Checks whether the functor_block generated by sympy solver modifies any variable outside
                                              +
                                              757  * its scope. If it does then return false, so that the operator() of the struct functor of the
                                              +
                                              758  * Eigen Newton solver doesn't have const qualifier.
                                              +
                                              759  *
                                              +
                                              760  * @param variable_block Statement Block of the variables declarations used in the functor struct of
                                              +
                                              761  * the solver
                                              +
                                              762  * @param functor_block Actual code being printed in the operator() of the functor struct of the
                                              +
                                              763  * solver
                                              +
                                              764  * @return True if operator() is const else False
                                              +
                                              765  */
                                              + +
                                              767  const ast::StatementBlock& functor_block) {
                                              +
                                              768  // Create complete_block with both variable declarations (done in variable_block) and solver
                                              +
                                              769  // part (done in functor_block) to be able to run the SymtabVisitor and DefUseAnalyzeVisitor
                                              +
                                              770  // then and get the proper DUChains for the variables defined in the variable_block
                                              +
                                              771  ast::StatementBlock complete_block(functor_block);
                                              +
                                              772  // Typically variable_block has only one statement, a statement containing the declaration
                                              +
                                              773  // of the local variables
                                              +
                                              774  for (const auto& statement: variable_block.get_statements()) {
                                              +
                                              775  complete_block.insert_statement(complete_block.get_statements().begin(), statement);
                                              +
                                              776  }
                                              +
                                              777 
                                              +
                                              778  // Create Symbol Table for complete_block
                                              +
                                              779  auto model_symbol_table = std::make_shared<symtab::ModelSymbolTable>();
                                              +
                                              780  SymtabVisitor(model_symbol_table.get()).visit_statement_block(complete_block);
                                              +
                                              781  // Initialize DefUseAnalyzeVisitor to generate the DUChains for the variables defined in the
                                              +
                                              782  // variable_block
                                              +
                                              783  DefUseAnalyzeVisitor v(*complete_block.get_symbol_table());
                                              +
                                              784 
                                              +
                                              785  // Check the DUChains for all the variables in the variable_block
                                              +
                                              786  // If variable is defined in complete_block don't add const quilifier in operator()
                                              +
                                              787  auto is_functor_const = true;
                                              +
                                              788  const auto& variables = collect_nodes(variable_block, {ast::AstNodeType::LOCAL_VAR});
                                              +
                                              789  for (const auto& variable: variables) {
                                              +
                                              790  const auto& chain = v.analyze(complete_block, variable->get_node_name());
                                              +
                                              791  is_functor_const = !(chain.eval() == DUState::D || chain.eval() == DUState::LD ||
                                              +
                                              792  chain.eval() == DUState::CD);
                                              +
                                              793  if (!is_functor_const) {
                                              +
                                              794  break;
                                              +
                                              795  }
                                              +
                                              796  }
                                              +
                                              797 
                                              +
                                              798  return is_functor_const;
                                              +
                                              799 }
                                              +
                                              800 
                                              +
                                              801 
                                              + +
                                              803  const ast::EigenNewtonSolverBlock& node) {
                                              +
                                              804  // functor that evaluates F(X) and J(X) for
                                              +
                                              805  // Newton solver
                                              +
                                              806  auto float_type = default_float_data_type();
                                              +
                                              807  int N = node.get_n_state_vars()->get_value();
                                              +
                                              808 
                                              +
                                              809  const auto functor_name = info.functor_names[&node];
                                              +
                                              810  printer->fmt_push_block("struct {0}", functor_name);
                                              +
                                              811  printer->add_line("NrnThread* nt;");
                                              +
                                              812  printer->add_line(instance_struct(), "* inst;");
                                              +
                                              813  printer->add_line("int id, pnodecount;");
                                              +
                                              814  printer->add_line("double v;");
                                              +
                                              815  printer->add_line("const Datum* indexes;");
                                              +
                                              816  printer->add_line("double* data;");
                                              +
                                              817  printer->add_line("ThreadDatum* thread;");
                                              +
                                              818 
                                              +
                                              819  if (ion_variable_struct_required()) {
                                              +
                                              820  print_ion_variable();
                                              +
                                              821  }
                                              +
                                              822 
                                              +
                                              823  print_statement_block(*node.get_variable_block(), false, false);
                                              +
                                              824  printer->add_newline();
                                              +
                                              825 
                                              +
                                              826  printer->push_block("void initialize()");
                                              +
                                              827  print_statement_block(*node.get_initialize_block(), false, false);
                                              +
                                              828  printer->pop_block();
                                              +
                                              829  printer->add_newline();
                                              830 
                                              -
                                              831  if (info.function_uses_table(name)) {
                                              -
                                              832  auto new_name = "f_" + name;
                                              -
                                              833  print_function_or_procedure(node, new_name);
                                              -
                                              834  print_table_check_function(node);
                                              -
                                              835  print_table_replacement_function(node);
                                              -
                                              836  } else {
                                              -
                                              837  print_function_or_procedure(node, name);
                                              -
                                              838  }
                                              -
                                              839 }
                                              -
                                              840 
                                              +
                                              831  printer->fmt_line(
                                              +
                                              832  "{0}(NrnThread* nt, {1}* inst, int id, int pnodecount, double v, const Datum* indexes, "
                                              +
                                              833  "double* data, ThreadDatum* thread) : "
                                              +
                                              834  "nt{{nt}}, inst{{inst}}, id{{id}}, pnodecount{{pnodecount}}, v{{v}}, indexes{{indexes}}, "
                                              +
                                              835  "data{{data}}, thread{{thread}} "
                                              +
                                              836  "{{}}",
                                              +
                                              837  functor_name,
                                              +
                                              838  instance_struct());
                                              +
                                              839 
                                              +
                                              840  printer->add_indent();
                                              841 
                                              - -
                                              843  print_function_procedure_helper(node);
                                              -
                                              844 }
                                              -
                                              845 
                                              -
                                              846 
                                              - -
                                              848  auto name = node.get_node_name();
                                              -
                                              849 
                                              -
                                              850  // name of return variable
                                              -
                                              851  std::string return_var;
                                              -
                                              852  if (info.function_uses_table(name)) {
                                              -
                                              853  return_var = "ret_f_" + name;
                                              -
                                              854  } else {
                                              -
                                              855  return_var = "ret_" + name;
                                              -
                                              856  }
                                              -
                                              857 
                                              -
                                              858  // first rename return variable name
                                              -
                                              859  auto block = node.get_statement_block().get();
                                              -
                                              860  RenameVisitor v(name, return_var);
                                              -
                                              861  block->accept(v);
                                              -
                                              862 
                                              -
                                              863  print_function_procedure_helper(node);
                                              -
                                              864 }
                                              -
                                              865 
                                              -
                                              866 
                                              - -
                                              868  auto name = node.get_node_name();
                                              -
                                              869  const auto& p = node.get_parameters();
                                              -
                                              870  auto params = internal_method_parameters();
                                              -
                                              871  for (const auto& i: p) {
                                              -
                                              872  params.emplace_back("", "double", "", i->get_node_name());
                                              -
                                              873  }
                                              -
                                              874  printer->fmt_line("double {}({})", method_name(name), get_parameter_str(params));
                                              -
                                              875  printer->push_block();
                                              -
                                              876  printer->fmt_line("double _arg[{}];", p.size());
                                              -
                                              877  for (size_t i = 0; i < p.size(); ++i) {
                                              -
                                              878  printer->fmt_line("_arg[{}] = {};", i, p[i]->get_node_name());
                                              -
                                              879  }
                                              -
                                              880  printer->fmt_line("return hoc_func_table({}, {}, _arg);",
                                              -
                                              881  get_variable_name(std::string("_ptable_" + name), true),
                                              -
                                              882  p.size());
                                              -
                                              883  printer->pop_block();
                                              +
                                              842  const auto& variable_block = *node.get_variable_block();
                                              +
                                              843  const auto& functor_block = *node.get_functor_block();
                                              +
                                              844 
                                              +
                                              845  printer->fmt_text(
                                              +
                                              846  "void operator()(const Eigen::Matrix<{0}, {1}, 1>& nmodl_eigen_xm, Eigen::Matrix<{0}, {1}, "
                                              +
                                              847  "1>& nmodl_eigen_fm, "
                                              +
                                              848  "Eigen::Matrix<{0}, {1}, {1}>& nmodl_eigen_jm) {2}",
                                              +
                                              849  float_type,
                                              +
                                              850  N,
                                              +
                                              851  is_functor_const(variable_block, functor_block) ? "const " : "");
                                              +
                                              852  printer->push_block();
                                              +
                                              853  printer->fmt_line("const {}* nmodl_eigen_x = nmodl_eigen_xm.data();", float_type);
                                              +
                                              854  printer->fmt_line("{}* nmodl_eigen_j = nmodl_eigen_jm.data();", float_type);
                                              +
                                              855  printer->fmt_line("{}* nmodl_eigen_f = nmodl_eigen_fm.data();", float_type);
                                              +
                                              856  print_statement_block(functor_block, false, false);
                                              +
                                              857  printer->pop_block();
                                              +
                                              858  printer->add_newline();
                                              +
                                              859 
                                              +
                                              860  // assign newton solver results in matrix X to state vars
                                              +
                                              861  printer->push_block("void finalize()");
                                              +
                                              862  print_statement_block(*node.get_finalize_block(), false, false);
                                              +
                                              863  printer->pop_block();
                                              +
                                              864 
                                              +
                                              865  printer->pop_block(";");
                                              +
                                              866 }
                                              +
                                              867 
                                              +
                                              868 
                                              +
                                              869 void CodegenCoreneuronCppVisitor::print_eigen_linear_solver(const std::string& float_type, int N) {
                                              +
                                              870  if (N <= 4) {
                                              +
                                              871  // Faster compared to LU, given the template specialization in Eigen.
                                              +
                                              872  printer->add_multi_line(R"CODE(
                                              +
                                              873  bool invertible;
                                              +
                                              874  nmodl_eigen_jm.computeInverseWithCheck(nmodl_eigen_jm_inv,invertible);
                                              +
                                              875  nmodl_eigen_xm = nmodl_eigen_jm_inv*nmodl_eigen_fm;
                                              +
                                              876  if (!invertible) assert(false && "Singular or ill-conditioned matrix (Eigen::inverse)!");
                                              +
                                              877  )CODE");
                                              +
                                              878  } else {
                                              +
                                              879  // In Eigen the default storage order is ColMajor.
                                              +
                                              880  // Crout's implementation requires matrices stored in RowMajor order (C++-style arrays).
                                              +
                                              881  // Therefore, the transposeInPlace is critical such that the data() method to give the rows
                                              +
                                              882  // instead of the columns.
                                              +
                                              883  printer->add_line("if (!nmodl_eigen_jm.IsRowMajor) nmodl_eigen_jm.transposeInPlace();");
                                              884 
                                              -
                                              885  printer->fmt_push_block("double table_{}()", method_name(name));
                                              -
                                              886  printer->fmt_line("hoc_spec_table(&{}, {});",
                                              -
                                              887  get_variable_name(std::string("_ptable_" + name)),
                                              -
                                              888  p.size());
                                              -
                                              889  printer->add_line("return 0.;");
                                              -
                                              890  printer->pop_block();
                                              -
                                              891 }
                                              -
                                              892 
                                              -
                                              893 
                                              -
                                              894 /**
                                              -
                                              895  * @brief Checks whether the functor_block generated by sympy solver modifies any variable outside
                                              -
                                              896  * its scope. If it does then return false, so that the operator() of the struct functor of the
                                              -
                                              897  * Eigen Newton solver doesn't have const qualifier.
                                              -
                                              898  *
                                              -
                                              899  * @param variable_block Statement Block of the variables declarations used in the functor struct of
                                              -
                                              900  * the solver
                                              -
                                              901  * @param functor_block Actual code being printed in the operator() of the functor struct of the
                                              -
                                              902  * solver
                                              -
                                              903  * @return True if operator() is const else False
                                              -
                                              904  */
                                              - -
                                              906  const ast::StatementBlock& functor_block) {
                                              -
                                              907  // Create complete_block with both variable declarations (done in variable_block) and solver
                                              -
                                              908  // part (done in functor_block) to be able to run the SymtabVisitor and DefUseAnalyzeVisitor
                                              -
                                              909  // then and get the proper DUChains for the variables defined in the variable_block
                                              -
                                              910  ast::StatementBlock complete_block(functor_block);
                                              -
                                              911  // Typically variable_block has only one statement, a statement containing the declaration
                                              -
                                              912  // of the local variables
                                              -
                                              913  for (const auto& statement: variable_block.get_statements()) {
                                              -
                                              914  complete_block.insert_statement(complete_block.get_statements().begin(), statement);
                                              -
                                              915  }
                                              -
                                              916 
                                              -
                                              917  // Create Symbol Table for complete_block
                                              -
                                              918  auto model_symbol_table = std::make_shared<symtab::ModelSymbolTable>();
                                              -
                                              919  SymtabVisitor(model_symbol_table.get()).visit_statement_block(complete_block);
                                              -
                                              920  // Initialize DefUseAnalyzeVisitor to generate the DUChains for the variables defined in the
                                              -
                                              921  // variable_block
                                              -
                                              922  DefUseAnalyzeVisitor v(*complete_block.get_symbol_table());
                                              -
                                              923 
                                              -
                                              924  // Check the DUChains for all the variables in the variable_block
                                              -
                                              925  // If variable is defined in complete_block don't add const quilifier in operator()
                                              -
                                              926  auto is_functor_const = true;
                                              -
                                              927  const auto& variables = collect_nodes(variable_block, {ast::AstNodeType::LOCAL_VAR});
                                              -
                                              928  for (const auto& variable: variables) {
                                              -
                                              929  const auto& chain = v.analyze(complete_block, variable->get_node_name());
                                              -
                                              930  is_functor_const = !(chain.eval() == DUState::D || chain.eval() == DUState::LD ||
                                              -
                                              931  chain.eval() == DUState::CD);
                                              -
                                              932  if (!is_functor_const) {
                                              -
                                              933  break;
                                              -
                                              934  }
                                              -
                                              935  }
                                              -
                                              936 
                                              -
                                              937  return is_functor_const;
                                              -
                                              938 }
                                              -
                                              939 
                                              -
                                              940 
                                              - -
                                              942  const ast::EigenNewtonSolverBlock& node) {
                                              -
                                              943  // functor that evaluates F(X) and J(X) for
                                              -
                                              944  // Newton solver
                                              -
                                              945  auto float_type = default_float_data_type();
                                              -
                                              946  int N = node.get_n_state_vars()->get_value();
                                              -
                                              947 
                                              -
                                              948  const auto functor_name = info.functor_names[&node];
                                              -
                                              949  printer->fmt_push_block("struct {0}", functor_name);
                                              -
                                              950  printer->add_line("NrnThread* nt;");
                                              -
                                              951  printer->add_line(instance_struct(), "* inst;");
                                              -
                                              952  printer->add_line("int id, pnodecount;");
                                              -
                                              953  printer->add_line("double v;");
                                              -
                                              954  printer->add_line("const Datum* indexes;");
                                              -
                                              955  printer->add_line("double* data;");
                                              -
                                              956  printer->add_line("ThreadDatum* thread;");
                                              -
                                              957 
                                              -
                                              958  if (ion_variable_struct_required()) {
                                              -
                                              959  print_ion_variable();
                                              -
                                              960  }
                                              -
                                              961 
                                              -
                                              962  print_statement_block(*node.get_variable_block(), false, false);
                                              -
                                              963  printer->add_newline();
                                              -
                                              964 
                                              -
                                              965  printer->push_block("void initialize()");
                                              -
                                              966  print_statement_block(*node.get_initialize_block(), false, false);
                                              -
                                              967  printer->pop_block();
                                              -
                                              968  printer->add_newline();
                                              -
                                              969 
                                              -
                                              970  printer->fmt_line(
                                              -
                                              971  "{0}(NrnThread* nt, {1}* inst, int id, int pnodecount, double v, const Datum* indexes, "
                                              -
                                              972  "double* data, ThreadDatum* thread) : "
                                              -
                                              973  "nt{{nt}}, inst{{inst}}, id{{id}}, pnodecount{{pnodecount}}, v{{v}}, indexes{{indexes}}, "
                                              -
                                              974  "data{{data}}, thread{{thread}} "
                                              -
                                              975  "{{}}",
                                              -
                                              976  functor_name,
                                              -
                                              977  instance_struct());
                                              -
                                              978 
                                              -
                                              979  printer->add_indent();
                                              -
                                              980 
                                              -
                                              981  const auto& variable_block = *node.get_variable_block();
                                              -
                                              982  const auto& functor_block = *node.get_functor_block();
                                              -
                                              983 
                                              -
                                              984  printer->fmt_text(
                                              -
                                              985  "void operator()(const Eigen::Matrix<{0}, {1}, 1>& nmodl_eigen_xm, Eigen::Matrix<{0}, {1}, "
                                              -
                                              986  "1>& nmodl_eigen_fm, "
                                              -
                                              987  "Eigen::Matrix<{0}, {1}, {1}>& nmodl_eigen_jm) {2}",
                                              -
                                              988  float_type,
                                              -
                                              989  N,
                                              -
                                              990  is_functor_const(variable_block, functor_block) ? "const " : "");
                                              -
                                              991  printer->push_block();
                                              -
                                              992  printer->fmt_line("const {}* nmodl_eigen_x = nmodl_eigen_xm.data();", float_type);
                                              -
                                              993  printer->fmt_line("{}* nmodl_eigen_j = nmodl_eigen_jm.data();", float_type);
                                              -
                                              994  printer->fmt_line("{}* nmodl_eigen_f = nmodl_eigen_fm.data();", float_type);
                                              -
                                              995  print_statement_block(functor_block, false, false);
                                              -
                                              996  printer->pop_block();
                                              -
                                              997  printer->add_newline();
                                              -
                                              998 
                                              -
                                              999  // assign newton solver results in matrix X to state vars
                                              -
                                              1000  printer->push_block("void finalize()");
                                              -
                                              1001  print_statement_block(*node.get_finalize_block(), false, false);
                                              -
                                              1002  printer->pop_block();
                                              -
                                              1003 
                                              -
                                              1004  printer->pop_block(";");
                                              -
                                              1005 }
                                              -
                                              1006 
                                              -
                                              1007 
                                              -
                                              1008 void CodegenCoreneuronCppVisitor::print_eigen_linear_solver(const std::string& float_type, int N) {
                                              -
                                              1009  if (N <= 4) {
                                              -
                                              1010  // Faster compared to LU, given the template specialization in Eigen.
                                              -
                                              1011  printer->add_multi_line(R"CODE(
                                              -
                                              1012  bool invertible;
                                              -
                                              1013  nmodl_eigen_jm.computeInverseWithCheck(nmodl_eigen_jm_inv,invertible);
                                              -
                                              1014  nmodl_eigen_xm = nmodl_eigen_jm_inv*nmodl_eigen_fm;
                                              -
                                              1015  if (!invertible) assert(false && "Singular or ill-conditioned matrix (Eigen::inverse)!");
                                              -
                                              1016  )CODE");
                                              -
                                              1017  } else {
                                              -
                                              1018  // In Eigen the default storage order is ColMajor.
                                              -
                                              1019  // Crout's implementation requires matrices stored in RowMajor order (C++-style arrays).
                                              -
                                              1020  // Therefore, the transposeInPlace is critical such that the data() method to give the rows
                                              -
                                              1021  // instead of the columns.
                                              -
                                              1022  printer->add_line("if (!nmodl_eigen_jm.IsRowMajor) nmodl_eigen_jm.transposeInPlace();");
                                              -
                                              1023 
                                              -
                                              1024  // pivot vector
                                              -
                                              1025  printer->fmt_line("Eigen::Matrix<int, {}, 1> pivot;", N);
                                              -
                                              1026  printer->fmt_line("Eigen::Matrix<{0}, {1}, 1> rowmax;", float_type, N);
                                              -
                                              1027 
                                              -
                                              1028  // In-place LU-Decomposition (Crout Algo) : Jm is replaced by its LU-decomposition
                                              -
                                              1029  printer->fmt_line(
                                              -
                                              1030  "if (nmodl::crout::Crout<{0}>({1}, nmodl_eigen_jm.data(), pivot.data(), rowmax.data()) "
                                              -
                                              1031  "< 0) assert(false && \"Singular or ill-conditioned matrix (nmodl::crout)!\");",
                                              -
                                              1032  float_type,
                                              -
                                              1033  N);
                                              -
                                              1034 
                                              -
                                              1035  // Solve the linear system : Forward/Backward substitution part
                                              -
                                              1036  printer->fmt_line(
                                              -
                                              1037  "nmodl::crout::solveCrout<{0}>({1}, nmodl_eigen_jm.data(), nmodl_eigen_fm.data(), "
                                              -
                                              1038  "nmodl_eigen_xm.data(), pivot.data());",
                                              -
                                              1039  float_type,
                                              -
                                              1040  N);
                                              -
                                              1041  }
                                              -
                                              1042 }
                                              -
                                              1043 
                                              -
                                              1044 
                                              -
                                              1045 /****************************************************************************************/
                                              -
                                              1046 /* Code-specific helper routines */
                                              -
                                              1047 /****************************************************************************************/
                                              -
                                              1048 
                                              -
                                              1049 
                                              - -
                                              1051  if (ion_variable_struct_required()) {
                                              -
                                              1052  return "id, pnodecount, inst, ionvar, data, indexes, thread, nt, v";
                                              -
                                              1053  }
                                              -
                                              1054  return "id, pnodecount, inst, data, indexes, thread, nt, v";
                                              -
                                              1055 }
                                              -
                                              1056 
                                              -
                                              1057 
                                              -
                                              1058 /**
                                              -
                                              1059  * @todo: figure out how to correctly handle qualifiers
                                              -
                                              1060  */
                                              - -
                                              1062  ParamVector params;
                                              -
                                              1063  params.emplace_back("", "int", "", "id");
                                              -
                                              1064  params.emplace_back("", "int", "", "pnodecount");
                                              -
                                              1065  params.emplace_back("", fmt::format("{}*", instance_struct()), "", "inst");
                                              -
                                              1066  if (ion_variable_struct_required()) {
                                              -
                                              1067  params.emplace_back("", "IonCurVar&", "", "ionvar");
                                              -
                                              1068  }
                                              -
                                              1069  params.emplace_back("", "double*", "", "data");
                                              -
                                              1070  params.emplace_back("const ", "Datum*", "", "indexes");
                                              -
                                              1071  params.emplace_back("", "ThreadDatum*", "", "thread");
                                              -
                                              1072  params.emplace_back("", "NrnThread*", "", "nt");
                                              -
                                              1073  params.emplace_back("", "double", "", "v");
                                              -
                                              1074  return params;
                                              -
                                              1075 }
                                              -
                                              1076 
                                              -
                                              1077 
                                              - -
                                              1079  return "id, pnodecount, data, indexes, thread, nt, ml, v";
                                              -
                                              1080 }
                                              -
                                              1081 
                                              -
                                              1082 
                                              - -
                                              1084  if (table) {
                                              -
                                              1085  return "int id, int pnodecount, double* data, Datum* indexes, "
                                              -
                                              1086  "ThreadDatum* thread, NrnThread* nt, Memb_list* ml, int tml_id";
                                              -
                                              1087  }
                                              -
                                              1088  return "int id, int pnodecount, double* data, Datum* indexes, "
                                              -
                                              1089  "ThreadDatum* thread, NrnThread* nt, Memb_list* ml, double v";
                                              -
                                              1090 }
                                              -
                                              1091 
                                              -
                                              1092 
                                              - -
                                              1094  if (ion_variable_struct_required()) {
                                              -
                                              1095  return "id, pnodecount, ionvar, data, indexes, thread, nt, ml, v";
                                              -
                                              1096  }
                                              -
                                              1097  return "id, pnodecount, data, indexes, thread, nt, ml, v";
                                              -
                                              1098 }
                                              -
                                              1099 
                                              -
                                              1100 
                                              -
                                              1101 /**
                                              -
                                              1102  * Function call arguments when function or procedure is defined in the
                                              -
                                              1103  * same mod file itself
                                              -
                                              1104  */
                                              - -
                                              1106  if (ion_variable_struct_required()) {
                                              -
                                              1107  return "id, pnodecount, inst, ionvar, data, indexes, thread, nt, v";
                                              -
                                              1108  }
                                              -
                                              1109  return "id, pnodecount, inst, data, indexes, thread, nt, v";
                                              +
                                              885  // pivot vector
                                              +
                                              886  printer->fmt_line("Eigen::Matrix<int, {}, 1> pivot;", N);
                                              +
                                              887  printer->fmt_line("Eigen::Matrix<{0}, {1}, 1> rowmax;", float_type, N);
                                              +
                                              888 
                                              +
                                              889  // In-place LU-Decomposition (Crout Algo) : Jm is replaced by its LU-decomposition
                                              +
                                              890  printer->fmt_line(
                                              +
                                              891  "if (nmodl::crout::Crout<{0}>({1}, nmodl_eigen_jm.data(), pivot.data(), rowmax.data()) "
                                              +
                                              892  "< 0) assert(false && \"Singular or ill-conditioned matrix (nmodl::crout)!\");",
                                              +
                                              893  float_type,
                                              +
                                              894  N);
                                              +
                                              895 
                                              +
                                              896  // Solve the linear system : Forward/Backward substitution part
                                              +
                                              897  printer->fmt_line(
                                              +
                                              898  "nmodl::crout::solveCrout<{0}>({1}, nmodl_eigen_jm.data(), nmodl_eigen_fm.data(), "
                                              +
                                              899  "nmodl_eigen_xm.data(), pivot.data());",
                                              +
                                              900  float_type,
                                              +
                                              901  N);
                                              +
                                              902  }
                                              +
                                              903 }
                                              +
                                              904 
                                              +
                                              905 
                                              +
                                              906 /****************************************************************************************/
                                              +
                                              907 /* Code-specific helper routines */
                                              +
                                              908 /****************************************************************************************/
                                              +
                                              909 
                                              +
                                              910 
                                              + +
                                              912  if (ion_variable_struct_required()) {
                                              +
                                              913  return "id, pnodecount, inst, ionvar, data, indexes, thread, nt, v";
                                              +
                                              914  }
                                              +
                                              915  return "id, pnodecount, inst, data, indexes, thread, nt, v";
                                              +
                                              916 }
                                              +
                                              917 
                                              +
                                              918 
                                              +
                                              919 /**
                                              +
                                              920  * @todo: figure out how to correctly handle qualifiers
                                              +
                                              921  */
                                              + +
                                              923  ParamVector params;
                                              +
                                              924  params.emplace_back("", "int", "", "id");
                                              +
                                              925  params.emplace_back("", "int", "", "pnodecount");
                                              +
                                              926  params.emplace_back("", fmt::format("{}*", instance_struct()), "", "inst");
                                              +
                                              927  if (ion_variable_struct_required()) {
                                              +
                                              928  params.emplace_back("", "IonCurVar&", "", "ionvar");
                                              +
                                              929  }
                                              +
                                              930  params.emplace_back("", "double*", "", "data");
                                              +
                                              931  params.emplace_back("const ", "Datum*", "", "indexes");
                                              +
                                              932  params.emplace_back("", "ThreadDatum*", "", "thread");
                                              +
                                              933  params.emplace_back("", "NrnThread*", "", "nt");
                                              +
                                              934  params.emplace_back("", "double", "", "v");
                                              +
                                              935  return params;
                                              +
                                              936 }
                                              +
                                              937 
                                              +
                                              938 
                                              + +
                                              940  return "id, pnodecount, data, indexes, thread, nt, ml, v";
                                              +
                                              941 }
                                              +
                                              942 
                                              +
                                              943 
                                              + +
                                              945  if (table) {
                                              +
                                              946  return "int id, int pnodecount, double* data, Datum* indexes, "
                                              +
                                              947  "ThreadDatum* thread, NrnThread* nt, Memb_list* ml, int tml_id";
                                              +
                                              948  }
                                              +
                                              949  return "int id, int pnodecount, double* data, Datum* indexes, "
                                              +
                                              950  "ThreadDatum* thread, NrnThread* nt, Memb_list* ml, double v";
                                              +
                                              951 }
                                              +
                                              952 
                                              +
                                              953 
                                              + +
                                              955  if (ion_variable_struct_required()) {
                                              +
                                              956  return "id, pnodecount, ionvar, data, indexes, thread, nt, ml, v";
                                              +
                                              957  }
                                              +
                                              958  return "id, pnodecount, data, indexes, thread, nt, ml, v";
                                              +
                                              959 }
                                              +
                                              960 
                                              +
                                              961 
                                              +
                                              962 /**
                                              +
                                              963  * Function call arguments when function or procedure is defined in the
                                              +
                                              964  * same mod file itself
                                              +
                                              965  */
                                              + +
                                              967  if (ion_variable_struct_required()) {
                                              +
                                              968  return "id, pnodecount, inst, ionvar, data, indexes, thread, nt, v";
                                              +
                                              969  }
                                              +
                                              970  return "id, pnodecount, inst, data, indexes, thread, nt, v";
                                              +
                                              971 }
                                              +
                                              972 
                                              +
                                              973 
                                              +
                                              974 /**
                                              +
                                              975  * Replace commonly used variables in the verbatim blocks into their corresponding
                                              +
                                              976  * variable name in the new code generation backend.
                                              +
                                              977  */
                                              + + +
                                              980  name = naming::VERBATIM_VARIABLES_MAPPING.at(name);
                                              +
                                              981  }
                                              +
                                              982 
                                              +
                                              983  /**
                                              +
                                              984  * if function is defined the same mod file then the arguments must
                                              +
                                              985  * contain mechanism instance as well.
                                              +
                                              986  */
                                              +
                                              987  if (name == naming::THREAD_ARGS) {
                                              +
                                              988  if (internal_method_call_encountered) {
                                              +
                                              989  name = nrn_thread_internal_arguments();
                                              +
                                              990  internal_method_call_encountered = false;
                                              +
                                              991  } else {
                                              +
                                              992  name = nrn_thread_arguments();
                                              +
                                              993  }
                                              +
                                              994  }
                                              +
                                              995  if (name == naming::THREAD_ARGS_PROTO) {
                                              +
                                              996  name = external_method_parameters();
                                              +
                                              997  }
                                              +
                                              998  return name;
                                              +
                                              999 }
                                              +
                                              1000 
                                              +
                                              1001 
                                              +
                                              1002 /**
                                              +
                                              1003  * Processing commonly used constructs in the verbatim blocks.
                                              +
                                              1004  * @todo : this is still ad-hoc and requires re-implementation to
                                              +
                                              1005  * handle it more elegantly.
                                              +
                                              1006  */
                                              +
                                              1007 std::string CodegenCoreneuronCppVisitor::process_verbatim_text(std::string const& text) {
                                              + +
                                              1009  driver.scan_string(text);
                                              +
                                              1010  auto tokens = driver.all_tokens();
                                              +
                                              1011  std::string result;
                                              +
                                              1012  for (size_t i = 0; i < tokens.size(); i++) {
                                              +
                                              1013  auto token = tokens[i];
                                              +
                                              1014 
                                              +
                                              1015  // check if we have function call in the verbatim block where
                                              +
                                              1016  // function is defined in the same mod file
                                              +
                                              1017  if (program_symtab->is_method_defined(token) && tokens[i + 1] == "(") {
                                              +
                                              1018  internal_method_call_encountered = true;
                                              +
                                              1019  }
                                              +
                                              1020  auto name = process_verbatim_token(token);
                                              +
                                              1021 
                                              +
                                              1022  if (token == (std::string("_") + naming::TQITEM_VARIABLE)) {
                                              +
                                              1023  name.insert(0, 1, '&');
                                              +
                                              1024  }
                                              +
                                              1025  if (token == "_STRIDE") {
                                              +
                                              1026  name = "pnodecount+id";
                                              +
                                              1027  }
                                              +
                                              1028  result += name;
                                              +
                                              1029  }
                                              +
                                              1030  return result;
                                              +
                                              1031 }
                                              +
                                              1032 
                                              +
                                              1033 
                                              + +
                                              1035  auto nrn_channel_info_var_name = get_channel_info_var_name();
                                              +
                                              1036  auto nrn_cur = nrn_cur_required() ? method_name(naming::NRN_CUR_METHOD) : "nullptr";
                                              +
                                              1037  auto nrn_state = nrn_state_required() ? method_name(naming::NRN_STATE_METHOD) : "nullptr";
                                              +
                                              1038  auto nrn_alloc = method_name(naming::NRN_ALLOC_METHOD);
                                              +
                                              1039  auto nrn_init = method_name(naming::NRN_INIT_METHOD);
                                              +
                                              1040  auto const nrn_private_constructor = method_name(naming::NRN_PRIVATE_CONSTRUCTOR_METHOD);
                                              +
                                              1041  auto const nrn_private_destructor = method_name(naming::NRN_PRIVATE_DESTRUCTOR_METHOD);
                                              +
                                              1042  return fmt::format("{}, {}, {}, nullptr, {}, {}, {}, {}, first_pointer_var_index()",
                                              +
                                              1043  nrn_channel_info_var_name,
                                              +
                                              1044  nrn_alloc,
                                              +
                                              1045  nrn_cur,
                                              +
                                              1046  nrn_state,
                                              +
                                              1047  nrn_init,
                                              +
                                              1048  nrn_private_constructor,
                                              +
                                              1049  nrn_private_destructor);
                                              +
                                              1050 }
                                              +
                                              1051 
                                              +
                                              1052 
                                              +
                                              1053 std::string CodegenCoreneuronCppVisitor::conc_write_statement(const std::string& ion_name,
                                              +
                                              1054  const std::string& concentration,
                                              +
                                              1055  int index) {
                                              +
                                              1056  auto conc_var_name = get_variable_name(naming::ION_VARNAME_PREFIX + concentration);
                                              +
                                              1057  auto style_var_name = get_variable_name("style_" + ion_name);
                                              +
                                              1058  return fmt::format(
                                              +
                                              1059  "nrn_wrote_conc({}_type,"
                                              +
                                              1060  " &({}),"
                                              +
                                              1061  " {},"
                                              +
                                              1062  " {},"
                                              +
                                              1063  " nrn_ion_global_map,"
                                              +
                                              1064  " {},"
                                              +
                                              1065  " nt->_ml_list[{}_type]->_nodecount_padded)",
                                              +
                                              1066  ion_name,
                                              +
                                              1067  conc_var_name,
                                              +
                                              1068  index,
                                              +
                                              1069  style_var_name,
                                              +
                                              1070  get_variable_name(naming::CELSIUS_VARIABLE),
                                              +
                                              1071  ion_name);
                                              +
                                              1072 }
                                              +
                                              1073 
                                              +
                                              1074 
                                              +
                                              1075 /****************************************************************************************/
                                              +
                                              1076 /* Code-specific printing routines for code generation */
                                              +
                                              1077 /****************************************************************************************/
                                              +
                                              1078 
                                              +
                                              1079 
                                              + +
                                              1081  printer->add_newline(2);
                                              +
                                              1082  print_device_method_annotation();
                                              +
                                              1083  printer->push_block("static inline int first_pointer_var_index()");
                                              +
                                              1084  printer->fmt_line("return {};", info.first_pointer_var_index);
                                              +
                                              1085  printer->pop_block();
                                              +
                                              1086 }
                                              +
                                              1087 
                                              +
                                              1088 
                                              + +
                                              1090  printer->add_newline(2);
                                              +
                                              1091  print_device_method_annotation();
                                              +
                                              1092  printer->push_block("static inline int first_random_var_index()");
                                              +
                                              1093  printer->fmt_line("return {};", info.first_random_var_index);
                                              +
                                              1094  printer->pop_block();
                                              +
                                              1095 }
                                              +
                                              1096 
                                              +
                                              1097 
                                              + +
                                              1099  printer->add_newline(2);
                                              +
                                              1100  print_device_method_annotation();
                                              +
                                              1101  printer->push_block("static inline int float_variables_size()");
                                              +
                                              1102  printer->fmt_line("return {};", float_variables_size());
                                              +
                                              1103  printer->pop_block();
                                              +
                                              1104 
                                              +
                                              1105  printer->add_newline(2);
                                              +
                                              1106  print_device_method_annotation();
                                              +
                                              1107  printer->push_block("static inline int int_variables_size()");
                                              +
                                              1108  printer->fmt_line("return {};", int_variables_size());
                                              +
                                              1109  printer->pop_block();
                                              1110 }
                                              1111 
                                              -
                                              1112 
                                              -
                                              1113 /**
                                              -
                                              1114  * Replace commonly used variables in the verbatim blocks into their corresponding
                                              -
                                              1115  * variable name in the new code generation backend.
                                              -
                                              1116  */
                                              - - -
                                              1119  name = naming::VERBATIM_VARIABLES_MAPPING.at(name);
                                              -
                                              1120  }
                                              -
                                              1121 
                                              -
                                              1122  /**
                                              -
                                              1123  * if function is defined the same mod file then the arguments must
                                              -
                                              1124  * contain mechanism instance as well.
                                              -
                                              1125  */
                                              -
                                              1126  if (name == naming::THREAD_ARGS) {
                                              -
                                              1127  if (internal_method_call_encountered) {
                                              -
                                              1128  name = nrn_thread_internal_arguments();
                                              -
                                              1129  internal_method_call_encountered = false;
                                              -
                                              1130  } else {
                                              -
                                              1131  name = nrn_thread_arguments();
                                              -
                                              1132  }
                                              -
                                              1133  }
                                              -
                                              1134  if (name == naming::THREAD_ARGS_PROTO) {
                                              -
                                              1135  name = external_method_parameters();
                                              -
                                              1136  }
                                              -
                                              1137  return name;
                                              -
                                              1138 }
                                              -
                                              1139 
                                              -
                                              1140 
                                              -
                                              1141 /**
                                              -
                                              1142  * Processing commonly used constructs in the verbatim blocks.
                                              -
                                              1143  * @todo : this is still ad-hoc and requires re-implementation to
                                              -
                                              1144  * handle it more elegantly.
                                              -
                                              1145  */
                                              -
                                              1146 std::string CodegenCoreneuronCppVisitor::process_verbatim_text(std::string const& text) {
                                              - -
                                              1148  driver.scan_string(text);
                                              -
                                              1149  auto tokens = driver.all_tokens();
                                              -
                                              1150  std::string result;
                                              -
                                              1151  for (size_t i = 0; i < tokens.size(); i++) {
                                              -
                                              1152  auto token = tokens[i];
                                              -
                                              1153 
                                              -
                                              1154  // check if we have function call in the verbatim block where
                                              -
                                              1155  // function is defined in the same mod file
                                              -
                                              1156  if (program_symtab->is_method_defined(token) && tokens[i + 1] == "(") {
                                              -
                                              1157  internal_method_call_encountered = true;
                                              -
                                              1158  }
                                              -
                                              1159  auto name = process_verbatim_token(token);
                                              -
                                              1160 
                                              -
                                              1161  if (token == (std::string("_") + naming::TQITEM_VARIABLE)) {
                                              -
                                              1162  name.insert(0, 1, '&');
                                              -
                                              1163  }
                                              -
                                              1164  if (token == "_STRIDE") {
                                              -
                                              1165  name = "pnodecount+id";
                                              -
                                              1166  }
                                              -
                                              1167  result += name;
                                              -
                                              1168  }
                                              -
                                              1169  return result;
                                              -
                                              1170 }
                                              -
                                              1171 
                                              -
                                              1172 
                                              - -
                                              1174  auto nrn_channel_info_var_name = get_channel_info_var_name();
                                              -
                                              1175  auto nrn_cur = nrn_cur_required() ? method_name(naming::NRN_CUR_METHOD) : "nullptr";
                                              -
                                              1176  auto nrn_state = nrn_state_required() ? method_name(naming::NRN_STATE_METHOD) : "nullptr";
                                              -
                                              1177  auto nrn_alloc = method_name(naming::NRN_ALLOC_METHOD);
                                              -
                                              1178  auto nrn_init = method_name(naming::NRN_INIT_METHOD);
                                              -
                                              1179  auto const nrn_private_constructor = method_name(naming::NRN_PRIVATE_CONSTRUCTOR_METHOD);
                                              -
                                              1180  auto const nrn_private_destructor = method_name(naming::NRN_PRIVATE_DESTRUCTOR_METHOD);
                                              -
                                              1181  return fmt::format("{}, {}, {}, nullptr, {}, {}, {}, {}, first_pointer_var_index()",
                                              -
                                              1182  nrn_channel_info_var_name,
                                              -
                                              1183  nrn_alloc,
                                              -
                                              1184  nrn_cur,
                                              -
                                              1185  nrn_state,
                                              -
                                              1186  nrn_init,
                                              -
                                              1187  nrn_private_constructor,
                                              -
                                              1188  nrn_private_destructor);
                                              -
                                              1189 }
                                              -
                                              1190 
                                              -
                                              1191 
                                              -
                                              1192 std::pair<std::string, std::string> CodegenCoreneuronCppVisitor::read_ion_variable_name(
                                              -
                                              1193  const std::string& name) {
                                              -
                                              1194  return {name, naming::ION_VARNAME_PREFIX + name};
                                              -
                                              1195 }
                                              -
                                              1196 
                                              -
                                              1197 
                                              -
                                              1198 std::pair<std::string, std::string> CodegenCoreneuronCppVisitor::write_ion_variable_name(
                                              -
                                              1199  const std::string& name) {
                                              -
                                              1200  return {naming::ION_VARNAME_PREFIX + name, name};
                                              -
                                              1201 }
                                              -
                                              1202 
                                              -
                                              1203 
                                              -
                                              1204 std::string CodegenCoreneuronCppVisitor::conc_write_statement(const std::string& ion_name,
                                              -
                                              1205  const std::string& concentration,
                                              -
                                              1206  int index) {
                                              -
                                              1207  auto conc_var_name = get_variable_name(naming::ION_VARNAME_PREFIX + concentration);
                                              -
                                              1208  auto style_var_name = get_variable_name("style_" + ion_name);
                                              -
                                              1209  return fmt::format(
                                              -
                                              1210  "nrn_wrote_conc({}_type,"
                                              -
                                              1211  " &({}),"
                                              -
                                              1212  " {},"
                                              -
                                              1213  " {},"
                                              -
                                              1214  " nrn_ion_global_map,"
                                              -
                                              1215  " {},"
                                              -
                                              1216  " nt->_ml_list[{}_type]->_nodecount_padded)",
                                              -
                                              1217  ion_name,
                                              -
                                              1218  conc_var_name,
                                              -
                                              1219  index,
                                              -
                                              1220  style_var_name,
                                              -
                                              1221  get_variable_name(naming::CELSIUS_VARIABLE),
                                              -
                                              1222  ion_name);
                                              -
                                              1223 }
                                              -
                                              1224 
                                              -
                                              1225 
                                              -
                                              1226 /**
                                              -
                                              1227  * If mechanisms dependency level execution is enabled then certain updates
                                              -
                                              1228  * like ionic current contributions needs to be atomically updated. In this
                                              -
                                              1229  * case we first update current mechanism's shadow vector and then add statement
                                              -
                                              1230  * to queue that will be used in reduction queue.
                                              -
                                              1231  */
                                              - -
                                              1233  const ShadowUseStatement& statement,
                                              -
                                              1234  BlockType /* type */) {
                                              -
                                              1235  // when there is no operator or rhs then that statement doesn't need shadow update
                                              -
                                              1236  if (statement.op.empty() && statement.rhs.empty()) {
                                              -
                                              1237  auto text = statement.lhs + ";";
                                              -
                                              1238  return text;
                                              -
                                              1239  }
                                              -
                                              1240 
                                              -
                                              1241  // return regular statement
                                              -
                                              1242  auto lhs = get_variable_name(statement.lhs);
                                              -
                                              1243  auto text = fmt::format("{} {} {};", lhs, statement.op, statement.rhs);
                                              -
                                              1244  return text;
                                              -
                                              1245 }
                                              -
                                              1246 
                                              -
                                              1247 
                                              -
                                              1248 /****************************************************************************************/
                                              -
                                              1249 /* Code-specific printing routines for code generation */
                                              -
                                              1250 /****************************************************************************************/
                                              -
                                              1251 
                                              -
                                              1252 
                                              - -
                                              1254  printer->add_newline(2);
                                              -
                                              1255  print_device_method_annotation();
                                              -
                                              1256  printer->push_block("static inline int first_pointer_var_index()");
                                              -
                                              1257  printer->fmt_line("return {};", info.first_pointer_var_index);
                                              -
                                              1258  printer->pop_block();
                                              -
                                              1259 }
                                              -
                                              1260 
                                              -
                                              1261 
                                              - -
                                              1263  printer->add_newline(2);
                                              -
                                              1264  print_device_method_annotation();
                                              -
                                              1265  printer->push_block("static inline int first_random_var_index()");
                                              -
                                              1266  printer->fmt_line("return {};", info.first_random_var_index);
                                              -
                                              1267  printer->pop_block();
                                              -
                                              1268 }
                                              -
                                              1269 
                                              -
                                              1270 
                                              - -
                                              1272  printer->add_newline(2);
                                              -
                                              1273  print_device_method_annotation();
                                              -
                                              1274  printer->push_block("static inline int float_variables_size()");
                                              -
                                              1275  printer->fmt_line("return {};", float_variables_size());
                                              -
                                              1276  printer->pop_block();
                                              +
                                              1112 
                                              + +
                                              1114  if (!net_receive_exist()) {
                                              +
                                              1115  return;
                                              +
                                              1116  }
                                              +
                                              1117  printer->add_newline(2);
                                              +
                                              1118  print_device_method_annotation();
                                              +
                                              1119  printer->push_block("static inline int num_net_receive_args()");
                                              +
                                              1120  printer->fmt_line("return {};", info.num_net_receive_parameters);
                                              +
                                              1121  printer->pop_block();
                                              +
                                              1122 }
                                              +
                                              1123 
                                              +
                                              1124 
                                              + +
                                              1126  printer->add_newline(2);
                                              +
                                              1127  print_device_method_annotation();
                                              +
                                              1128  printer->push_block("static inline int get_mech_type()");
                                              +
                                              1129  // false => get it from the host-only global struct, not the instance structure
                                              +
                                              1130  printer->fmt_line("return {};", get_variable_name("mech_type", false));
                                              +
                                              1131  printer->pop_block();
                                              +
                                              1132 }
                                              +
                                              1133 
                                              +
                                              1134 
                                              + +
                                              1136  printer->add_newline(2);
                                              +
                                              1137  print_device_method_annotation();
                                              +
                                              1138  printer->push_block("static inline Memb_list* get_memb_list(NrnThread* nt)");
                                              +
                                              1139  printer->push_block("if (!nt->_ml_list)");
                                              +
                                              1140  printer->add_line("return nullptr;");
                                              +
                                              1141  printer->pop_block();
                                              +
                                              1142  printer->add_line("return nt->_ml_list[get_mech_type()];");
                                              +
                                              1143  printer->pop_block();
                                              +
                                              1144 }
                                              +
                                              1145 
                                              +
                                              1146 
                                              + +
                                              1148  printer->add_newline(2);
                                              +
                                              1149  printer->push_block("namespace coreneuron");
                                              +
                                              1150 }
                                              +
                                              1151 
                                              +
                                              1152 
                                              + +
                                              1154  printer->pop_block();
                                              +
                                              1155 }
                                              +
                                              1156 
                                              +
                                              1157 
                                              +
                                              1158 /**
                                              +
                                              1159  * \details There are three types of thread variables currently considered:
                                              +
                                              1160  * - top local thread variables
                                              +
                                              1161  * - thread variables in the mod file
                                              +
                                              1162  * - thread variables for solver
                                              +
                                              1163  *
                                              +
                                              1164  * These variables are allocated into different thread structures and have
                                              +
                                              1165  * corresponding thread ids. Thread id start from 0. In mod2c implementation,
                                              +
                                              1166  * thread_data_index is increased at various places and it is used to
                                              +
                                              1167  * decide the index of thread.
                                              +
                                              1168  */
                                              + +
                                              1170  if (info.vectorize && info.derivimplicit_used()) {
                                              +
                                              1171  int tid = info.derivimplicit_var_thread_id;
                                              +
                                              1172  int list = info.derivimplicit_list_num;
                                              +
                                              1173 
                                              +
                                              1174  // clang-format off
                                              +
                                              1175  printer->add_newline(2);
                                              +
                                              1176  printer->add_line("/** thread specific helper routines for derivimplicit */");
                                              +
                                              1177 
                                              +
                                              1178  printer->add_newline(1);
                                              +
                                              1179  printer->fmt_push_block("static inline int* deriv{}_advance(ThreadDatum* thread)", list);
                                              +
                                              1180  printer->fmt_line("return &(thread[{}].i);", tid);
                                              +
                                              1181  printer->pop_block();
                                              +
                                              1182  printer->add_newline();
                                              +
                                              1183 
                                              +
                                              1184  printer->fmt_push_block("static inline int dith{}()", list);
                                              +
                                              1185  printer->fmt_line("return {};", tid+1);
                                              +
                                              1186  printer->pop_block();
                                              +
                                              1187  printer->add_newline();
                                              +
                                              1188 
                                              +
                                              1189  printer->fmt_push_block("static inline void** newtonspace{}(ThreadDatum* thread)", list);
                                              +
                                              1190  printer->fmt_line("return &(thread[{}]._pvoid);", tid+2);
                                              +
                                              1191  printer->pop_block();
                                              +
                                              1192  }
                                              +
                                              1193 
                                              +
                                              1194  if (info.vectorize && !info.thread_variables.empty()) {
                                              +
                                              1195  printer->add_newline(2);
                                              +
                                              1196  printer->add_line("/** tid for thread variables */");
                                              +
                                              1197  printer->push_block("static inline int thread_var_tid()");
                                              +
                                              1198  printer->fmt_line("return {};", info.thread_var_thread_id);
                                              +
                                              1199  printer->pop_block();
                                              +
                                              1200  }
                                              +
                                              1201 
                                              +
                                              1202  if (info.vectorize && !info.top_local_variables.empty()) {
                                              +
                                              1203  printer->add_newline(2);
                                              +
                                              1204  printer->add_line("/** tid for top local tread variables */");
                                              +
                                              1205  printer->push_block("static inline int top_local_var_tid()");
                                              +
                                              1206  printer->fmt_line("return {};", info.top_local_thread_id);
                                              +
                                              1207  printer->pop_block();
                                              +
                                              1208  }
                                              +
                                              1209  // clang-format on
                                              +
                                              1210 }
                                              +
                                              1211 
                                              +
                                              1212 
                                              +
                                              1213 /****************************************************************************************/
                                              +
                                              1214 /* Routines for returning variable name */
                                              +
                                              1215 /****************************************************************************************/
                                              +
                                              1216 
                                              +
                                              1217 
                                              + +
                                              1219  bool use_instance) const {
                                              +
                                              1220  auto name = symbol->get_name();
                                              +
                                              1221  auto dimension = symbol->get_length();
                                              +
                                              1222  auto position = position_of_float_var(name);
                                              +
                                              1223  // clang-format off
                                              +
                                              1224  if (symbol->is_array()) {
                                              +
                                              1225  if (use_instance) {
                                              +
                                              1226  return fmt::format("(inst->{}+id*{})", name, dimension);
                                              +
                                              1227  }
                                              +
                                              1228  return fmt::format("(data + {}*pnodecount + id*{})", position, dimension);
                                              +
                                              1229  }
                                              +
                                              1230  if (use_instance) {
                                              +
                                              1231  return fmt::format("inst->{}[id]", name);
                                              +
                                              1232  }
                                              +
                                              1233  return fmt::format("data[{}*pnodecount + id]", position);
                                              +
                                              1234  // clang-format on
                                              +
                                              1235 }
                                              +
                                              1236 
                                              +
                                              1237 
                                              + +
                                              1239  const std::string& name,
                                              +
                                              1240  bool use_instance) const {
                                              +
                                              1241  auto position = position_of_int_var(name);
                                              +
                                              1242  // clang-format off
                                              +
                                              1243  if (symbol.is_index) {
                                              +
                                              1244  if (use_instance) {
                                              +
                                              1245  return fmt::format("inst->{}[{}]", name, position);
                                              +
                                              1246  }
                                              +
                                              1247  return fmt::format("indexes[{}]", position);
                                              +
                                              1248  }
                                              +
                                              1249  if (symbol.is_integer) {
                                              +
                                              1250  if (use_instance) {
                                              +
                                              1251  return fmt::format("inst->{}[{}*pnodecount+id]", name, position);
                                              +
                                              1252  }
                                              +
                                              1253  return fmt::format("indexes[{}*pnodecount+id]", position);
                                              +
                                              1254  }
                                              +
                                              1255  if (use_instance) {
                                              +
                                              1256  return fmt::format("inst->{}[indexes[{}*pnodecount + id]]", name, position);
                                              +
                                              1257  }
                                              +
                                              1258  auto data = symbol.is_vdata ? "_vdata" : "_data";
                                              +
                                              1259  return fmt::format("nt->{}[indexes[{}*pnodecount + id]]", data, position);
                                              +
                                              1260  // clang-format on
                                              +
                                              1261 }
                                              +
                                              1262 
                                              +
                                              1263 
                                              + +
                                              1265  bool use_instance) const {
                                              +
                                              1266  if (use_instance) {
                                              +
                                              1267  return fmt::format("inst->{}->{}", naming::INST_GLOBAL_MEMBER, symbol->get_name());
                                              +
                                              1268  } else {
                                              +
                                              1269  return fmt::format("{}.{}", global_struct_instance(), symbol->get_name());
                                              +
                                              1270  }
                                              +
                                              1271 }
                                              +
                                              1272 
                                              +
                                              1273 
                                              +
                                              1274 std::string CodegenCoreneuronCppVisitor::get_variable_name(const std::string& name,
                                              +
                                              1275  bool use_instance) const {
                                              +
                                              1276  const std::string& varname = update_if_ion_variable_name(name);
                                              1277 
                                              -
                                              1278  printer->add_newline(2);
                                              -
                                              1279  print_device_method_annotation();
                                              -
                                              1280  printer->push_block("static inline int int_variables_size()");
                                              -
                                              1281  printer->fmt_line("return {};", int_variables_size());
                                              -
                                              1282  printer->pop_block();
                                              -
                                              1283 }
                                              -
                                              1284 
                                              -
                                              1285 
                                              - -
                                              1287  if (!net_receive_exist()) {
                                              -
                                              1288  return;
                                              -
                                              1289  }
                                              -
                                              1290  printer->add_newline(2);
                                              -
                                              1291  print_device_method_annotation();
                                              -
                                              1292  printer->push_block("static inline int num_net_receive_args()");
                                              -
                                              1293  printer->fmt_line("return {};", info.num_net_receive_parameters);
                                              -
                                              1294  printer->pop_block();
                                              -
                                              1295 }
                                              -
                                              1296 
                                              -
                                              1297 
                                              - -
                                              1299  printer->add_newline(2);
                                              -
                                              1300  print_device_method_annotation();
                                              -
                                              1301  printer->push_block("static inline int get_mech_type()");
                                              -
                                              1302  // false => get it from the host-only global struct, not the instance structure
                                              -
                                              1303  printer->fmt_line("return {};", get_variable_name("mech_type", false));
                                              -
                                              1304  printer->pop_block();
                                              -
                                              1305 }
                                              -
                                              1306 
                                              -
                                              1307 
                                              - -
                                              1309  printer->add_newline(2);
                                              -
                                              1310  print_device_method_annotation();
                                              -
                                              1311  printer->push_block("static inline Memb_list* get_memb_list(NrnThread* nt)");
                                              -
                                              1312  printer->push_block("if (!nt->_ml_list)");
                                              -
                                              1313  printer->add_line("return nullptr;");
                                              -
                                              1314  printer->pop_block();
                                              -
                                              1315  printer->add_line("return nt->_ml_list[get_mech_type()];");
                                              -
                                              1316  printer->pop_block();
                                              -
                                              1317 }
                                              -
                                              1318 
                                              -
                                              1319 
                                              - -
                                              1321  printer->add_newline(2);
                                              -
                                              1322  printer->push_block("namespace coreneuron");
                                              -
                                              1323 }
                                              -
                                              1324 
                                              -
                                              1325 
                                              - -
                                              1327  printer->pop_block();
                                              -
                                              1328 }
                                              -
                                              1329 
                                              -
                                              1330 
                                              -
                                              1331 /**
                                              -
                                              1332  * \details There are three types of thread variables currently considered:
                                              -
                                              1333  * - top local thread variables
                                              -
                                              1334  * - thread variables in the mod file
                                              -
                                              1335  * - thread variables for solver
                                              -
                                              1336  *
                                              -
                                              1337  * These variables are allocated into different thread structures and have
                                              -
                                              1338  * corresponding thread ids. Thread id start from 0. In mod2c implementation,
                                              -
                                              1339  * thread_data_index is increased at various places and it is used to
                                              -
                                              1340  * decide the index of thread.
                                              -
                                              1341  */
                                              - -
                                              1343  if (info.vectorize && info.derivimplicit_used()) {
                                              -
                                              1344  int tid = info.derivimplicit_var_thread_id;
                                              -
                                              1345  int list = info.derivimplicit_list_num;
                                              +
                                              1278  // clang-format off
                                              +
                                              1279  auto symbol_comparator = [&varname](const SymbolType& sym) {
                                              +
                                              1280  return varname == sym->get_name();
                                              +
                                              1281  };
                                              +
                                              1282 
                                              +
                                              1283  auto index_comparator = [&varname](const IndexVariableInfo& var) {
                                              +
                                              1284  return varname == var.symbol->get_name();
                                              +
                                              1285  };
                                              +
                                              1286  // clang-format on
                                              +
                                              1287 
                                              +
                                              1288  // float variable
                                              +
                                              1289  auto f = std::find_if(codegen_float_variables.begin(),
                                              +
                                              1290  codegen_float_variables.end(),
                                              +
                                              1291  symbol_comparator);
                                              +
                                              1292  if (f != codegen_float_variables.end()) {
                                              +
                                              1293  return float_variable_name(*f, use_instance);
                                              +
                                              1294  }
                                              +
                                              1295 
                                              +
                                              1296  // integer variable
                                              +
                                              1297  auto i =
                                              +
                                              1298  std::find_if(codegen_int_variables.begin(), codegen_int_variables.end(), index_comparator);
                                              +
                                              1299  if (i != codegen_int_variables.end()) {
                                              +
                                              1300  return int_variable_name(*i, varname, use_instance);
                                              +
                                              1301  }
                                              +
                                              1302 
                                              +
                                              1303  // global variable
                                              +
                                              1304  auto g = std::find_if(codegen_global_variables.begin(),
                                              +
                                              1305  codegen_global_variables.end(),
                                              +
                                              1306  symbol_comparator);
                                              +
                                              1307  if (g != codegen_global_variables.end()) {
                                              +
                                              1308  return global_variable_name(*g, use_instance);
                                              +
                                              1309  }
                                              +
                                              1310 
                                              +
                                              1311  if (varname == naming::NTHREAD_DT_VARIABLE) {
                                              +
                                              1312  return std::string("nt->_") + naming::NTHREAD_DT_VARIABLE;
                                              +
                                              1313  }
                                              +
                                              1314 
                                              +
                                              1315  // t in net_receive method is an argument to function and hence it should
                                              +
                                              1316  // ne used instead of nt->_t which is current time of thread
                                              +
                                              1317  if (varname == naming::NTHREAD_T_VARIABLE && !printing_net_receive) {
                                              +
                                              1318  return std::string("nt->_") + naming::NTHREAD_T_VARIABLE;
                                              +
                                              1319  }
                                              +
                                              1320 
                                              +
                                              1321  auto const iter =
                                              +
                                              1322  std::find_if(info.neuron_global_variables.begin(),
                                              +
                                              1323  info.neuron_global_variables.end(),
                                              +
                                              1324  [&varname](auto const& entry) { return entry.first->get_name() == varname; });
                                              +
                                              1325  if (iter != info.neuron_global_variables.end()) {
                                              +
                                              1326  std::string ret;
                                              +
                                              1327  if (use_instance) {
                                              +
                                              1328  ret = "*(inst->";
                                              +
                                              1329  }
                                              +
                                              1330  ret.append(varname);
                                              +
                                              1331  if (use_instance) {
                                              +
                                              1332  ret.append(")");
                                              +
                                              1333  }
                                              +
                                              1334  return ret;
                                              +
                                              1335  }
                                              +
                                              1336 
                                              +
                                              1337  // otherwise return original name
                                              +
                                              1338  return varname;
                                              +
                                              1339 }
                                              +
                                              1340 
                                              +
                                              1341 
                                              +
                                              1342 /****************************************************************************************/
                                              +
                                              1343 /* Main printing routines for code generation */
                                              +
                                              1344 /****************************************************************************************/
                                              +
                                              1345 
                                              1346 
                                              -
                                              1347  // clang-format off
                                              -
                                              1348  printer->add_newline(2);
                                              -
                                              1349  printer->add_line("/** thread specific helper routines for derivimplicit */");
                                              -
                                              1350 
                                              -
                                              1351  printer->add_newline(1);
                                              -
                                              1352  printer->fmt_push_block("static inline int* deriv{}_advance(ThreadDatum* thread)", list);
                                              -
                                              1353  printer->fmt_line("return &(thread[{}].i);", tid);
                                              -
                                              1354  printer->pop_block();
                                              -
                                              1355  printer->add_newline();
                                              -
                                              1356 
                                              -
                                              1357  printer->fmt_push_block("static inline int dith{}()", list);
                                              -
                                              1358  printer->fmt_line("return {};", tid+1);
                                              -
                                              1359  printer->pop_block();
                                              -
                                              1360  printer->add_newline();
                                              -
                                              1361 
                                              -
                                              1362  printer->fmt_push_block("static inline void** newtonspace{}(ThreadDatum* thread)", list);
                                              -
                                              1363  printer->fmt_line("return &(thread[{}]._pvoid);", tid+2);
                                              -
                                              1364  printer->pop_block();
                                              -
                                              1365  }
                                              + +
                                              1348  time_t current_time{};
                                              +
                                              1349  time(&current_time);
                                              +
                                              1350  std::string data_time_str{std::ctime(&current_time)};
                                              +
                                              1351  auto version = nmodl::Version::NMODL_VERSION + " [" + nmodl::Version::GIT_REVISION + "]";
                                              +
                                              1352 
                                              +
                                              1353  printer->add_line("/*********************************************************");
                                              +
                                              1354  printer->add_line("Model Name : ", info.mod_suffix);
                                              +
                                              1355  printer->add_line("Filename : ", info.mod_file, ".mod");
                                              +
                                              1356  printer->add_line("NMODL Version : ", nmodl_version());
                                              +
                                              1357  printer->fmt_line("Vectorized : {}", info.vectorize);
                                              +
                                              1358  printer->fmt_line("Threadsafe : {}", info.thread_safe);
                                              +
                                              1359  printer->add_line("Created : ", stringutils::trim(data_time_str));
                                              +
                                              1360  printer->add_line("Simulator : ", simulator_name());
                                              +
                                              1361  printer->add_line("Backend : ", backend_name());
                                              +
                                              1362  printer->add_line("NMODL Compiler : ", version);
                                              +
                                              1363  printer->add_line("*********************************************************/");
                                              +
                                              1364 }
                                              +
                                              1365 
                                              1366 
                                              -
                                              1367  if (info.vectorize && !info.thread_variables.empty()) {
                                              -
                                              1368  printer->add_newline(2);
                                              -
                                              1369  printer->add_line("/** tid for thread variables */");
                                              -
                                              1370  printer->push_block("static inline int thread_var_tid()");
                                              -
                                              1371  printer->fmt_line("return {};", info.thread_var_thread_id);
                                              -
                                              1372  printer->pop_block();
                                              -
                                              1373  }
                                              -
                                              1374 
                                              -
                                              1375  if (info.vectorize && !info.top_local_variables.empty()) {
                                              -
                                              1376  printer->add_newline(2);
                                              -
                                              1377  printer->add_line("/** tid for top local tread variables */");
                                              -
                                              1378  printer->push_block("static inline int top_local_var_tid()");
                                              -
                                              1379  printer->fmt_line("return {};", info.top_local_thread_id);
                                              -
                                              1380  printer->pop_block();
                                              -
                                              1381  }
                                              -
                                              1382  // clang-format on
                                              -
                                              1383 }
                                              -
                                              1384 
                                              -
                                              1385 
                                              -
                                              1386 /****************************************************************************************/
                                              -
                                              1387 /* Routines for returning variable name */
                                              -
                                              1388 /****************************************************************************************/
                                              -
                                              1389 
                                              -
                                              1390 
                                              - -
                                              1392  bool use_instance) const {
                                              -
                                              1393  auto name = symbol->get_name();
                                              -
                                              1394  auto dimension = symbol->get_length();
                                              -
                                              1395  auto position = position_of_float_var(name);
                                              -
                                              1396  // clang-format off
                                              -
                                              1397  if (symbol->is_array()) {
                                              -
                                              1398  if (use_instance) {
                                              -
                                              1399  return fmt::format("(inst->{}+id*{})", name, dimension);
                                              -
                                              1400  }
                                              -
                                              1401  return fmt::format("(data + {}*pnodecount + id*{})", position, dimension);
                                              -
                                              1402  }
                                              -
                                              1403  if (use_instance) {
                                              -
                                              1404  return fmt::format("inst->{}[id]", name);
                                              -
                                              1405  }
                                              -
                                              1406  return fmt::format("data[{}*pnodecount + id]", position);
                                              -
                                              1407  // clang-format on
                                              + +
                                              1368  printer->add_newline();
                                              +
                                              1369  printer->add_multi_line(R"CODE(
                                              +
                                              1370  #include <math.h>
                                              +
                                              1371  #include <stdio.h>
                                              +
                                              1372  #include <stdlib.h>
                                              +
                                              1373  #include <string.h>
                                              +
                                              1374  )CODE");
                                              +
                                              1375 }
                                              +
                                              1376 
                                              +
                                              1377 
                                              + +
                                              1379  printer->add_newline();
                                              +
                                              1380  printer->add_multi_line(R"CODE(
                                              +
                                              1381  #include <coreneuron/gpu/nrn_acc_manager.hpp>
                                              +
                                              1382  #include <coreneuron/mechanism/mech/mod2c_core_thread.hpp>
                                              +
                                              1383  #include <coreneuron/mechanism/register_mech.hpp>
                                              +
                                              1384  #include <coreneuron/nrnconf.h>
                                              +
                                              1385  #include <coreneuron/nrniv/nrniv_decl.h>
                                              +
                                              1386  #include <coreneuron/sim/multicore.hpp>
                                              +
                                              1387  #include <coreneuron/sim/scopmath/newton_thread.hpp>
                                              +
                                              1388  #include <coreneuron/utils/ivocvect.hpp>
                                              +
                                              1389  #include <coreneuron/utils/nrnoc_aux.hpp>
                                              +
                                              1390  #include <coreneuron/utils/randoms/nrnran123.h>
                                              +
                                              1391  )CODE");
                                              +
                                              1392  if (info.eigen_newton_solver_exist) {
                                              +
                                              1393  printer->add_line("#include <newton/newton.hpp>");
                                              +
                                              1394  }
                                              +
                                              1395  if (info.eigen_linear_solver_exist) {
                                              +
                                              1396  if (std::accumulate(info.state_vars.begin(),
                                              +
                                              1397  info.state_vars.end(),
                                              +
                                              1398  0,
                                              +
                                              1399  [](int l, const SymbolType& variable) {
                                              +
                                              1400  return l += variable->get_length();
                                              +
                                              1401  }) > 4) {
                                              +
                                              1402  printer->add_line("#include <crout/crout.hpp>");
                                              +
                                              1403  } else {
                                              +
                                              1404  printer->add_line("#include <Eigen/Dense>");
                                              +
                                              1405  printer->add_line("#include <Eigen/LU>");
                                              +
                                              1406  }
                                              +
                                              1407  }
                                              1408 }
                                              1409 
                                              1410 
                                              - -
                                              1412  const std::string& name,
                                              -
                                              1413  bool use_instance) const {
                                              -
                                              1414  auto position = position_of_int_var(name);
                                              -
                                              1415  // clang-format off
                                              -
                                              1416  if (symbol.is_index) {
                                              -
                                              1417  if (use_instance) {
                                              -
                                              1418  return fmt::format("inst->{}[{}]", name, position);
                                              -
                                              1419  }
                                              -
                                              1420  return fmt::format("indexes[{}]", position);
                                              -
                                              1421  }
                                              -
                                              1422  if (symbol.is_integer) {
                                              -
                                              1423  if (use_instance) {
                                              -
                                              1424  return fmt::format("inst->{}[{}*pnodecount+id]", name, position);
                                              -
                                              1425  }
                                              -
                                              1426  return fmt::format("indexes[{}*pnodecount+id]", position);
                                              -
                                              1427  }
                                              -
                                              1428  if (use_instance) {
                                              -
                                              1429  return fmt::format("inst->{}[indexes[{}*pnodecount + id]]", name, position);
                                              -
                                              1430  }
                                              -
                                              1431  auto data = symbol.is_vdata ? "_vdata" : "_data";
                                              -
                                              1432  return fmt::format("nt->{}[indexes[{}*pnodecount + id]]", data, position);
                                              -
                                              1433  // clang-format on
                                              -
                                              1434 }
                                              -
                                              1435 
                                              -
                                              1436 
                                              - -
                                              1438  bool use_instance) const {
                                              -
                                              1439  if (use_instance) {
                                              -
                                              1440  return fmt::format("inst->{}->{}", naming::INST_GLOBAL_MEMBER, symbol->get_name());
                                              -
                                              1441  } else {
                                              -
                                              1442  return fmt::format("{}.{}", global_struct_instance(), symbol->get_name());
                                              -
                                              1443  }
                                              -
                                              1444 }
                                              -
                                              1445 
                                              -
                                              1446 
                                              - -
                                              1448  const std::string& name) const {
                                              -
                                              1449  std::string result(name);
                                              -
                                              1450  if (ion_variable_struct_required()) {
                                              -
                                              1451  if (info.is_ion_read_variable(name)) {
                                              -
                                              1452  result = naming::ION_VARNAME_PREFIX + name;
                                              -
                                              1453  }
                                              -
                                              1454  if (info.is_ion_write_variable(name)) {
                                              -
                                              1455  result = "ionvar." + name;
                                              -
                                              1456  }
                                              -
                                              1457  if (info.is_current(name)) {
                                              -
                                              1458  result = "ionvar." + name;
                                              -
                                              1459  }
                                              -
                                              1460  }
                                              -
                                              1461  return result;
                                              -
                                              1462 }
                                              -
                                              1463 
                                              -
                                              1464 
                                              -
                                              1465 std::string CodegenCoreneuronCppVisitor::get_variable_name(const std::string& name,
                                              -
                                              1466  bool use_instance) const {
                                              -
                                              1467  const std::string& varname = update_if_ion_variable_name(name);
                                              -
                                              1468 
                                              -
                                              1469  // clang-format off
                                              -
                                              1470  auto symbol_comparator = [&varname](const SymbolType& sym) {
                                              -
                                              1471  return varname == sym->get_name();
                                              -
                                              1472  };
                                              -
                                              1473 
                                              -
                                              1474  auto index_comparator = [&varname](const IndexVariableInfo& var) {
                                              -
                                              1475  return varname == var.symbol->get_name();
                                              -
                                              1476  };
                                              -
                                              1477  // clang-format on
                                              -
                                              1478 
                                              -
                                              1479  // float variable
                                              -
                                              1480  auto f = std::find_if(codegen_float_variables.begin(),
                                              -
                                              1481  codegen_float_variables.end(),
                                              -
                                              1482  symbol_comparator);
                                              -
                                              1483  if (f != codegen_float_variables.end()) {
                                              -
                                              1484  return float_variable_name(*f, use_instance);
                                              -
                                              1485  }
                                              -
                                              1486 
                                              -
                                              1487  // integer variable
                                              -
                                              1488  auto i =
                                              -
                                              1489  std::find_if(codegen_int_variables.begin(), codegen_int_variables.end(), index_comparator);
                                              -
                                              1490  if (i != codegen_int_variables.end()) {
                                              -
                                              1491  return int_variable_name(*i, varname, use_instance);
                                              -
                                              1492  }
                                              -
                                              1493 
                                              -
                                              1494  // global variable
                                              -
                                              1495  auto g = std::find_if(codegen_global_variables.begin(),
                                              -
                                              1496  codegen_global_variables.end(),
                                              -
                                              1497  symbol_comparator);
                                              -
                                              1498  if (g != codegen_global_variables.end()) {
                                              -
                                              1499  return global_variable_name(*g, use_instance);
                                              -
                                              1500  }
                                              -
                                              1501 
                                              -
                                              1502  if (varname == naming::NTHREAD_DT_VARIABLE) {
                                              -
                                              1503  return std::string("nt->_") + naming::NTHREAD_DT_VARIABLE;
                                              + +
                                              1412  if (info.primes_size == 0) {
                                              +
                                              1413  return;
                                              +
                                              1414  }
                                              +
                                              1415  const auto count_prime_variables = [](auto size, const SymbolType& symbol) {
                                              +
                                              1416  return size += symbol->get_length();
                                              +
                                              1417  };
                                              +
                                              1418  const auto prime_variables_by_order_size =
                                              +
                                              1419  std::accumulate(info.prime_variables_by_order.begin(),
                                              +
                                              1420  info.prime_variables_by_order.end(),
                                              +
                                              1421  0,
                                              +
                                              1422  count_prime_variables);
                                              +
                                              1423  if (info.primes_size != prime_variables_by_order_size) {
                                              +
                                              1424  throw std::runtime_error{
                                              +
                                              1425  fmt::format("primes_size = {} differs from prime_variables_by_order.size() = {}, "
                                              +
                                              1426  "this should not happen.",
                                              +
                                              1427  info.primes_size,
                                              +
                                              1428  info.prime_variables_by_order.size())};
                                              +
                                              1429  }
                                              +
                                              1430  auto const initializer_list = [&](auto const& primes, const char* prefix) -> std::string {
                                              +
                                              1431  if (!print_initializers) {
                                              +
                                              1432  return {};
                                              +
                                              1433  }
                                              +
                                              1434  std::string list{"{"};
                                              +
                                              1435  for (auto iter = primes.begin(); iter != primes.end(); ++iter) {
                                              +
                                              1436  auto const& prime = *iter;
                                              +
                                              1437  list.append(std::to_string(position_of_float_var(prefix + prime->get_name())));
                                              +
                                              1438  if (std::next(iter) != primes.end()) {
                                              +
                                              1439  list.append(", ");
                                              +
                                              1440  }
                                              +
                                              1441  }
                                              +
                                              1442  list.append("}");
                                              +
                                              1443  return list;
                                              +
                                              1444  };
                                              +
                                              1445  printer->fmt_line("int slist1[{}]{};",
                                              +
                                              1446  info.primes_size,
                                              +
                                              1447  initializer_list(info.prime_variables_by_order, ""));
                                              +
                                              1448  printer->fmt_line("int dlist1[{}]{};",
                                              +
                                              1449  info.primes_size,
                                              +
                                              1450  initializer_list(info.prime_variables_by_order, "D"));
                                              +
                                              1451  codegen_global_variables.push_back(make_symbol("slist1"));
                                              +
                                              1452  codegen_global_variables.push_back(make_symbol("dlist1"));
                                              +
                                              1453  // additional list for derivimplicit method
                                              +
                                              1454  if (info.derivimplicit_used()) {
                                              +
                                              1455  auto primes = program_symtab->get_variables_with_properties(NmodlType::prime_name);
                                              +
                                              1456  printer->fmt_line("int slist2[{}]{};", info.primes_size, initializer_list(primes, ""));
                                              +
                                              1457  codegen_global_variables.push_back(make_symbol("slist2"));
                                              +
                                              1458  }
                                              +
                                              1459 }
                                              +
                                              1460 
                                              +
                                              1461 
                                              +
                                              1462 /**
                                              +
                                              1463  * \details Variables required for type of ion, type of point process etc. are
                                              +
                                              1464  * of static int type. For the C++ backend type, it's ok to have
                                              +
                                              1465  * these variables as file scoped static variables.
                                              +
                                              1466  *
                                              +
                                              1467  * Initial values of state variables (h0) are also defined as static
                                              +
                                              1468  * variables. Note that the state could be ion variable and it could
                                              +
                                              1469  * be also range variable. Hence lookup into symbol table before.
                                              +
                                              1470  *
                                              +
                                              1471  * When model is not vectorized (shouldn't be the case in coreneuron)
                                              +
                                              1472  * the top local variables become static variables.
                                              +
                                              1473  *
                                              +
                                              1474  * Note that static variables are already initialized to 0. We do the
                                              +
                                              1475  * same for some variables to keep same code as neuron.
                                              +
                                              1476  */
                                              +
                                              1477 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
                                              + +
                                              1479  const auto value_initialize = print_initializers ? "{}" : "";
                                              +
                                              1480 
                                              +
                                              1481  auto float_type = default_float_data_type();
                                              +
                                              1482  printer->add_newline(2);
                                              +
                                              1483  printer->add_line("/** all global variables */");
                                              +
                                              1484  printer->fmt_push_block("struct {}", global_struct());
                                              +
                                              1485 
                                              +
                                              1486  for (const auto& ion: info.ions) {
                                              +
                                              1487  auto name = fmt::format("{}_type", ion.name);
                                              +
                                              1488  printer->fmt_line("int {}{};", name, value_initialize);
                                              +
                                              1489  codegen_global_variables.push_back(make_symbol(name));
                                              +
                                              1490  }
                                              +
                                              1491 
                                              +
                                              1492  if (info.point_process) {
                                              +
                                              1493  printer->fmt_line("int point_type{};", value_initialize);
                                              +
                                              1494  codegen_global_variables.push_back(make_symbol("point_type"));
                                              +
                                              1495  }
                                              +
                                              1496 
                                              +
                                              1497  for (const auto& var: info.state_vars) {
                                              +
                                              1498  auto name = var->get_name() + "0";
                                              +
                                              1499  auto symbol = program_symtab->lookup(name);
                                              +
                                              1500  if (symbol == nullptr) {
                                              +
                                              1501  printer->fmt_line("{} {}{};", float_type, name, value_initialize);
                                              +
                                              1502  codegen_global_variables.push_back(make_symbol(name));
                                              +
                                              1503  }
                                              1504  }
                                              1505 
                                              -
                                              1506  // t in net_receive method is an argument to function and hence it should
                                              -
                                              1507  // ne used instead of nt->_t which is current time of thread
                                              -
                                              1508  if (varname == naming::NTHREAD_T_VARIABLE && !printing_net_receive) {
                                              -
                                              1509  return std::string("nt->_") + naming::NTHREAD_T_VARIABLE;
                                              -
                                              1510  }
                                              -
                                              1511 
                                              -
                                              1512  auto const iter =
                                              -
                                              1513  std::find_if(info.neuron_global_variables.begin(),
                                              -
                                              1514  info.neuron_global_variables.end(),
                                              -
                                              1515  [&varname](auto const& entry) { return entry.first->get_name() == varname; });
                                              -
                                              1516  if (iter != info.neuron_global_variables.end()) {
                                              -
                                              1517  std::string ret;
                                              -
                                              1518  if (use_instance) {
                                              -
                                              1519  ret = "*(inst->";
                                              -
                                              1520  }
                                              -
                                              1521  ret.append(varname);
                                              -
                                              1522  if (use_instance) {
                                              -
                                              1523  ret.append(")");
                                              +
                                              1506  // Neuron and Coreneuron adds "v" to global variables when vectorize
                                              +
                                              1507  // is false. But as v is always local variable and passed as argument,
                                              +
                                              1508  // we don't need to use global variable v
                                              +
                                              1509 
                                              +
                                              1510  auto& top_locals = info.top_local_variables;
                                              +
                                              1511  if (!info.vectorize && !top_locals.empty()) {
                                              +
                                              1512  for (const auto& var: top_locals) {
                                              +
                                              1513  auto name = var->get_name();
                                              +
                                              1514  auto length = var->get_length();
                                              +
                                              1515  if (var->is_array()) {
                                              +
                                              1516  printer->fmt_line("{} {}[{}] /* TODO init top-local-array */;",
                                              +
                                              1517  float_type,
                                              +
                                              1518  name,
                                              +
                                              1519  length);
                                              +
                                              1520  } else {
                                              +
                                              1521  printer->fmt_line("{} {} /* TODO init top-local */;", float_type, name);
                                              +
                                              1522  }
                                              +
                                              1523  codegen_global_variables.push_back(var);
                                              1524  }
                                              -
                                              1525  return ret;
                                              -
                                              1526  }
                                              -
                                              1527 
                                              -
                                              1528  // otherwise return original name
                                              -
                                              1529  return varname;
                                              -
                                              1530 }
                                              -
                                              1531 
                                              -
                                              1532 
                                              -
                                              1533 /****************************************************************************************/
                                              -
                                              1534 /* Main printing routines for code generation */
                                              -
                                              1535 /****************************************************************************************/
                                              -
                                              1536 
                                              +
                                              1525  }
                                              +
                                              1526 
                                              +
                                              1527  if (!info.thread_variables.empty()) {
                                              +
                                              1528  printer->fmt_line("int thread_data_in_use{};", value_initialize);
                                              +
                                              1529  printer->fmt_line("{} thread_data[{}] /* TODO init thread_data */;",
                                              +
                                              1530  float_type,
                                              +
                                              1531  info.thread_var_data_size);
                                              +
                                              1532  codegen_global_variables.push_back(make_symbol("thread_data_in_use"));
                                              +
                                              1533  auto symbol = make_symbol("thread_data");
                                              +
                                              1534  symbol->set_as_array(info.thread_var_data_size);
                                              +
                                              1535  codegen_global_variables.push_back(symbol);
                                              +
                                              1536  }
                                              1537 
                                              - -
                                              1539  time_t current_time{};
                                              -
                                              1540  time(&current_time);
                                              -
                                              1541  std::string data_time_str{std::ctime(&current_time)};
                                              -
                                              1542  auto version = nmodl::Version::NMODL_VERSION + " [" + nmodl::Version::GIT_REVISION + "]";
                                              -
                                              1543 
                                              -
                                              1544  printer->add_line("/*********************************************************");
                                              -
                                              1545  printer->add_line("Model Name : ", info.mod_suffix);
                                              -
                                              1546  printer->add_line("Filename : ", info.mod_file, ".mod");
                                              -
                                              1547  printer->add_line("NMODL Version : ", nmodl_version());
                                              -
                                              1548  printer->fmt_line("Vectorized : {}", info.vectorize);
                                              -
                                              1549  printer->fmt_line("Threadsafe : {}", info.thread_safe);
                                              -
                                              1550  printer->add_line("Created : ", stringutils::trim(data_time_str));
                                              -
                                              1551  printer->add_line("Simulator : ", simulator_name());
                                              -
                                              1552  printer->add_line("Backend : ", backend_name());
                                              -
                                              1553  printer->add_line("NMODL Compiler : ", version);
                                              -
                                              1554  printer->add_line("*********************************************************/");
                                              -
                                              1555 }
                                              -
                                              1556 
                                              -
                                              1557 
                                              - -
                                              1559  printer->add_newline();
                                              -
                                              1560  printer->add_multi_line(R"CODE(
                                              -
                                              1561  #include <math.h>
                                              -
                                              1562  #include <stdio.h>
                                              -
                                              1563  #include <stdlib.h>
                                              -
                                              1564  #include <string.h>
                                              -
                                              1565  )CODE");
                                              -
                                              1566 }
                                              -
                                              1567 
                                              -
                                              1568 
                                              - -
                                              1570  printer->add_newline();
                                              -
                                              1571  printer->add_multi_line(R"CODE(
                                              -
                                              1572  #include <coreneuron/gpu/nrn_acc_manager.hpp>
                                              -
                                              1573  #include <coreneuron/mechanism/mech/mod2c_core_thread.hpp>
                                              -
                                              1574  #include <coreneuron/mechanism/register_mech.hpp>
                                              -
                                              1575  #include <coreneuron/nrnconf.h>
                                              -
                                              1576  #include <coreneuron/nrniv/nrniv_decl.h>
                                              -
                                              1577  #include <coreneuron/sim/multicore.hpp>
                                              -
                                              1578  #include <coreneuron/sim/scopmath/newton_thread.hpp>
                                              -
                                              1579  #include <coreneuron/utils/ivocvect.hpp>
                                              -
                                              1580  #include <coreneuron/utils/nrnoc_aux.hpp>
                                              -
                                              1581  #include <coreneuron/utils/randoms/nrnran123.h>
                                              -
                                              1582  )CODE");
                                              -
                                              1583  if (info.eigen_newton_solver_exist) {
                                              -
                                              1584  printer->add_line("#include <newton/newton.hpp>");
                                              -
                                              1585  }
                                              -
                                              1586  if (info.eigen_linear_solver_exist) {
                                              -
                                              1587  if (std::accumulate(info.state_vars.begin(),
                                              -
                                              1588  info.state_vars.end(),
                                              -
                                              1589  0,
                                              -
                                              1590  [](int l, const SymbolType& variable) {
                                              -
                                              1591  return l += variable->get_length();
                                              -
                                              1592  }) > 4) {
                                              -
                                              1593  printer->add_line("#include <crout/crout.hpp>");
                                              -
                                              1594  } else {
                                              -
                                              1595  printer->add_line("#include <Eigen/Dense>");
                                              -
                                              1596  printer->add_line("#include <Eigen/LU>");
                                              -
                                              1597  }
                                              -
                                              1598  }
                                              -
                                              1599 }
                                              -
                                              1600 
                                              +
                                              1538  // TODO: remove this entirely?
                                              +
                                              1539  printer->fmt_line("int reset{};", value_initialize);
                                              +
                                              1540  codegen_global_variables.push_back(make_symbol("reset"));
                                              +
                                              1541 
                                              +
                                              1542  printer->fmt_line("int mech_type{};", value_initialize);
                                              +
                                              1543  codegen_global_variables.push_back(make_symbol("mech_type"));
                                              +
                                              1544 
                                              +
                                              1545  for (const auto& var: info.global_variables) {
                                              +
                                              1546  auto name = var->get_name();
                                              +
                                              1547  auto length = var->get_length();
                                              +
                                              1548  if (var->is_array()) {
                                              +
                                              1549  printer->fmt_line("{} {}[{}] /* TODO init const-array */;", float_type, name, length);
                                              +
                                              1550  } else {
                                              +
                                              1551  double value{};
                                              +
                                              1552  if (auto const& value_ptr = var->get_value()) {
                                              +
                                              1553  value = *value_ptr;
                                              +
                                              1554  }
                                              +
                                              1555  printer->fmt_line("{} {}{};",
                                              +
                                              1556  float_type,
                                              +
                                              1557  name,
                                              +
                                              1558  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                                              +
                                              1559  }
                                              +
                                              1560  codegen_global_variables.push_back(var);
                                              +
                                              1561  }
                                              +
                                              1562 
                                              +
                                              1563  for (const auto& var: info.constant_variables) {
                                              +
                                              1564  auto const name = var->get_name();
                                              +
                                              1565  auto* const value_ptr = var->get_value().get();
                                              +
                                              1566  double const value{value_ptr ? *value_ptr : 0};
                                              +
                                              1567  printer->fmt_line("{} {}{};",
                                              +
                                              1568  float_type,
                                              +
                                              1569  name,
                                              +
                                              1570  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                                              +
                                              1571  codegen_global_variables.push_back(var);
                                              +
                                              1572  }
                                              +
                                              1573 
                                              +
                                              1574  print_sdlists_init(print_initializers);
                                              +
                                              1575 
                                              +
                                              1576  if (info.table_count > 0) {
                                              +
                                              1577  printer->fmt_line("double usetable{};", print_initializers ? "{1}" : "");
                                              +
                                              1578  codegen_global_variables.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                                              +
                                              1579 
                                              +
                                              1580  for (const auto& block: info.functions_with_table) {
                                              +
                                              1581  const auto& name = block->get_node_name();
                                              +
                                              1582  printer->fmt_line("{} tmin_{}{};", float_type, name, value_initialize);
                                              +
                                              1583  printer->fmt_line("{} mfac_{}{};", float_type, name, value_initialize);
                                              +
                                              1584  codegen_global_variables.push_back(make_symbol("tmin_" + name));
                                              +
                                              1585  codegen_global_variables.push_back(make_symbol("mfac_" + name));
                                              +
                                              1586  }
                                              +
                                              1587 
                                              +
                                              1588  for (const auto& variable: info.table_statement_variables) {
                                              +
                                              1589  auto const name = "t_" + variable->get_name();
                                              +
                                              1590  auto const num_values = variable->get_num_values();
                                              +
                                              1591  if (variable->is_array()) {
                                              +
                                              1592  int array_len = variable->get_length();
                                              +
                                              1593  printer->fmt_line(
                                              +
                                              1594  "{} {}[{}][{}]{};", float_type, name, array_len, num_values, value_initialize);
                                              +
                                              1595  } else {
                                              +
                                              1596  printer->fmt_line("{} {}[{}]{};", float_type, name, num_values, value_initialize);
                                              +
                                              1597  }
                                              +
                                              1598  codegen_global_variables.push_back(make_symbol(name));
                                              +
                                              1599  }
                                              +
                                              1600  }
                                              1601 
                                              - -
                                              1603  if (info.primes_size == 0) {
                                              -
                                              1604  return;
                                              +
                                              1602  for (const auto& f: info.function_tables) {
                                              +
                                              1603  printer->fmt_line("void* _ptable_{}{{}};", f->get_node_name());
                                              +
                                              1604  codegen_global_variables.push_back(make_symbol("_ptable_" + f->get_node_name()));
                                              1605  }
                                              -
                                              1606  const auto count_prime_variables = [](auto size, const SymbolType& symbol) {
                                              -
                                              1607  return size += symbol->get_length();
                                              -
                                              1608  };
                                              -
                                              1609  const auto prime_variables_by_order_size =
                                              -
                                              1610  std::accumulate(info.prime_variables_by_order.begin(),
                                              -
                                              1611  info.prime_variables_by_order.end(),
                                              -
                                              1612  0,
                                              -
                                              1613  count_prime_variables);
                                              -
                                              1614  if (info.primes_size != prime_variables_by_order_size) {
                                              -
                                              1615  throw std::runtime_error{
                                              -
                                              1616  fmt::format("primes_size = {} differs from prime_variables_by_order.size() = {}, "
                                              -
                                              1617  "this should not happen.",
                                              -
                                              1618  info.primes_size,
                                              -
                                              1619  info.prime_variables_by_order.size())};
                                              -
                                              1620  }
                                              -
                                              1621  auto const initializer_list = [&](auto const& primes, const char* prefix) -> std::string {
                                              -
                                              1622  if (!print_initializers) {
                                              -
                                              1623  return {};
                                              -
                                              1624  }
                                              -
                                              1625  std::string list{"{"};
                                              -
                                              1626  for (auto iter = primes.begin(); iter != primes.end(); ++iter) {
                                              -
                                              1627  auto const& prime = *iter;
                                              -
                                              1628  list.append(std::to_string(position_of_float_var(prefix + prime->get_name())));
                                              -
                                              1629  if (std::next(iter) != primes.end()) {
                                              -
                                              1630  list.append(", ");
                                              -
                                              1631  }
                                              -
                                              1632  }
                                              -
                                              1633  list.append("}");
                                              -
                                              1634  return list;
                                              -
                                              1635  };
                                              -
                                              1636  printer->fmt_line("int slist1[{}]{};",
                                              -
                                              1637  info.primes_size,
                                              -
                                              1638  initializer_list(info.prime_variables_by_order, ""));
                                              -
                                              1639  printer->fmt_line("int dlist1[{}]{};",
                                              -
                                              1640  info.primes_size,
                                              -
                                              1641  initializer_list(info.prime_variables_by_order, "D"));
                                              -
                                              1642  codegen_global_variables.push_back(make_symbol("slist1"));
                                              -
                                              1643  codegen_global_variables.push_back(make_symbol("dlist1"));
                                              -
                                              1644  // additional list for derivimplicit method
                                              -
                                              1645  if (info.derivimplicit_used()) {
                                              -
                                              1646  auto primes = program_symtab->get_variables_with_properties(NmodlType::prime_name);
                                              -
                                              1647  printer->fmt_line("int slist2[{}]{};", info.primes_size, initializer_list(primes, ""));
                                              -
                                              1648  codegen_global_variables.push_back(make_symbol("slist2"));
                                              +
                                              1606 
                                              +
                                              1607  if (info.vectorize && info.thread_data_index) {
                                              +
                                              1608  printer->fmt_line("ThreadDatum ext_call_thread[{}]{};",
                                              +
                                              1609  info.thread_data_index,
                                              +
                                              1610  value_initialize);
                                              +
                                              1611  codegen_global_variables.push_back(make_symbol("ext_call_thread"));
                                              +
                                              1612  }
                                              +
                                              1613 
                                              +
                                              1614  printer->pop_block(";");
                                              +
                                              1615 
                                              +
                                              1616  print_global_var_struct_assertions();
                                              +
                                              1617  print_global_var_struct_decl();
                                              +
                                              1618 }
                                              +
                                              1619 
                                              +
                                              1620 
                                              +
                                              1621 /**
                                              +
                                              1622  * Print structs that encapsulate information about scalar and
                                              +
                                              1623  * vector elements of type global and thread variables.
                                              +
                                              1624  */
                                              + +
                                              1626  auto variable_printer =
                                              +
                                              1627  [&](const std::vector<SymbolType>& variables, bool if_array, bool if_vector) {
                                              +
                                              1628  for (const auto& variable: variables) {
                                              +
                                              1629  if (variable->is_array() == if_array) {
                                              +
                                              1630  // false => do not use the instance struct, which is not
                                              +
                                              1631  // defined in the global declaration that we are printing
                                              +
                                              1632  auto name = get_variable_name(variable->get_name(), false);
                                              +
                                              1633  auto ename = add_escape_quote(variable->get_name() + "_" + info.mod_suffix);
                                              +
                                              1634  auto length = variable->get_length();
                                              +
                                              1635  if (if_vector) {
                                              +
                                              1636  printer->fmt_line("{{{}, {}, {}}},", ename, name, length);
                                              +
                                              1637  } else {
                                              +
                                              1638  printer->fmt_line("{{{}, &{}}},", ename, name);
                                              +
                                              1639  }
                                              +
                                              1640  }
                                              +
                                              1641  }
                                              +
                                              1642  };
                                              +
                                              1643 
                                              +
                                              1644  auto globals = info.global_variables;
                                              +
                                              1645  auto thread_vars = info.thread_variables;
                                              +
                                              1646 
                                              +
                                              1647  if (info.table_count > 0) {
                                              +
                                              1648  globals.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                                              1649  }
                                              -
                                              1650 }
                                              -
                                              1651 
                                              -
                                              1652 
                                              -
                                              1653 /**
                                              -
                                              1654  * \details Variables required for type of ion, type of point process etc. are
                                              -
                                              1655  * of static int type. For the C++ backend type, it's ok to have
                                              -
                                              1656  * these variables as file scoped static variables.
                                              -
                                              1657  *
                                              -
                                              1658  * Initial values of state variables (h0) are also defined as static
                                              -
                                              1659  * variables. Note that the state could be ion variable and it could
                                              -
                                              1660  * be also range variable. Hence lookup into symbol table before.
                                              -
                                              1661  *
                                              -
                                              1662  * When model is not vectorized (shouldn't be the case in coreneuron)
                                              -
                                              1663  * the top local variables become static variables.
                                              -
                                              1664  *
                                              -
                                              1665  * Note that static variables are already initialized to 0. We do the
                                              -
                                              1666  * same for some variables to keep same code as neuron.
                                              -
                                              1667  */
                                              -
                                              1668 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
                                              - -
                                              1670  const auto value_initialize = print_initializers ? "{}" : "";
                                              +
                                              1650 
                                              +
                                              1651  printer->add_newline(2);
                                              +
                                              1652  printer->add_line("/** connect global (scalar) variables to hoc -- */");
                                              +
                                              1653  printer->add_line("static DoubScal hoc_scalar_double[] = {");
                                              +
                                              1654  printer->increase_indent();
                                              +
                                              1655  variable_printer(globals, false, false);
                                              +
                                              1656  variable_printer(thread_vars, false, false);
                                              +
                                              1657  printer->add_line("{nullptr, nullptr}");
                                              +
                                              1658  printer->decrease_indent();
                                              +
                                              1659  printer->add_line("};");
                                              +
                                              1660 
                                              +
                                              1661  printer->add_newline(2);
                                              +
                                              1662  printer->add_line("/** connect global (array) variables to hoc -- */");
                                              +
                                              1663  printer->add_line("static DoubVec hoc_vector_double[] = {");
                                              +
                                              1664  printer->increase_indent();
                                              +
                                              1665  variable_printer(globals, true, true);
                                              +
                                              1666  variable_printer(thread_vars, true, true);
                                              +
                                              1667  printer->add_line("{nullptr, nullptr, 0}");
                                              +
                                              1668  printer->decrease_indent();
                                              +
                                              1669  printer->add_line("};");
                                              +
                                              1670 }
                                              1671 
                                              -
                                              1672  auto float_type = default_float_data_type();
                                              -
                                              1673  printer->add_newline(2);
                                              -
                                              1674  printer->add_line("/** all global variables */");
                                              -
                                              1675  printer->fmt_push_block("struct {}", global_struct());
                                              -
                                              1676 
                                              -
                                              1677  for (const auto& ion: info.ions) {
                                              -
                                              1678  auto name = fmt::format("{}_type", ion.name);
                                              -
                                              1679  printer->fmt_line("int {}{};", name, value_initialize);
                                              -
                                              1680  codegen_global_variables.push_back(make_symbol(name));
                                              -
                                              1681  }
                                              -
                                              1682 
                                              -
                                              1683  if (info.point_process) {
                                              -
                                              1684  printer->fmt_line("int point_type{};", value_initialize);
                                              -
                                              1685  codegen_global_variables.push_back(make_symbol("point_type"));
                                              -
                                              1686  }
                                              -
                                              1687 
                                              -
                                              1688  for (const auto& var: info.state_vars) {
                                              -
                                              1689  auto name = var->get_name() + "0";
                                              -
                                              1690  auto symbol = program_symtab->lookup(name);
                                              -
                                              1691  if (symbol == nullptr) {
                                              -
                                              1692  printer->fmt_line("{} {}{};", float_type, name, value_initialize);
                                              -
                                              1693  codegen_global_variables.push_back(make_symbol(name));
                                              -
                                              1694  }
                                              -
                                              1695  }
                                              -
                                              1696 
                                              -
                                              1697  // Neuron and Coreneuron adds "v" to global variables when vectorize
                                              -
                                              1698  // is false. But as v is always local variable and passed as argument,
                                              -
                                              1699  // we don't need to use global variable v
                                              -
                                              1700 
                                              -
                                              1701  auto& top_locals = info.top_local_variables;
                                              -
                                              1702  if (!info.vectorize && !top_locals.empty()) {
                                              -
                                              1703  for (const auto& var: top_locals) {
                                              -
                                              1704  auto name = var->get_name();
                                              -
                                              1705  auto length = var->get_length();
                                              -
                                              1706  if (var->is_array()) {
                                              -
                                              1707  printer->fmt_line("{} {}[{}] /* TODO init top-local-array */;",
                                              -
                                              1708  float_type,
                                              -
                                              1709  name,
                                              -
                                              1710  length);
                                              -
                                              1711  } else {
                                              -
                                              1712  printer->fmt_line("{} {} /* TODO init top-local */;", float_type, name);
                                              -
                                              1713  }
                                              -
                                              1714  codegen_global_variables.push_back(var);
                                              -
                                              1715  }
                                              -
                                              1716  }
                                              -
                                              1717 
                                              -
                                              1718  if (!info.thread_variables.empty()) {
                                              -
                                              1719  printer->fmt_line("int thread_data_in_use{};", value_initialize);
                                              -
                                              1720  printer->fmt_line("{} thread_data[{}] /* TODO init thread_data */;",
                                              -
                                              1721  float_type,
                                              -
                                              1722  info.thread_var_data_size);
                                              -
                                              1723  codegen_global_variables.push_back(make_symbol("thread_data_in_use"));
                                              -
                                              1724  auto symbol = make_symbol("thread_data");
                                              -
                                              1725  symbol->set_as_array(info.thread_var_data_size);
                                              -
                                              1726  codegen_global_variables.push_back(symbol);
                                              -
                                              1727  }
                                              -
                                              1728 
                                              -
                                              1729  // TODO: remove this entirely?
                                              -
                                              1730  printer->fmt_line("int reset{};", value_initialize);
                                              -
                                              1731  codegen_global_variables.push_back(make_symbol("reset"));
                                              -
                                              1732 
                                              -
                                              1733  printer->fmt_line("int mech_type{};", value_initialize);
                                              -
                                              1734  codegen_global_variables.push_back(make_symbol("mech_type"));
                                              -
                                              1735 
                                              -
                                              1736  for (const auto& var: info.global_variables) {
                                              -
                                              1737  auto name = var->get_name();
                                              -
                                              1738  auto length = var->get_length();
                                              -
                                              1739  if (var->is_array()) {
                                              -
                                              1740  printer->fmt_line("{} {}[{}] /* TODO init const-array */;", float_type, name, length);
                                              -
                                              1741  } else {
                                              -
                                              1742  double value{};
                                              -
                                              1743  if (auto const& value_ptr = var->get_value()) {
                                              -
                                              1744  value = *value_ptr;
                                              -
                                              1745  }
                                              -
                                              1746  printer->fmt_line("{} {}{};",
                                              -
                                              1747  float_type,
                                              -
                                              1748  name,
                                              -
                                              1749  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                                              -
                                              1750  }
                                              -
                                              1751  codegen_global_variables.push_back(var);
                                              -
                                              1752  }
                                              -
                                              1753 
                                              -
                                              1754  for (const auto& var: info.constant_variables) {
                                              -
                                              1755  auto const name = var->get_name();
                                              -
                                              1756  auto* const value_ptr = var->get_value().get();
                                              -
                                              1757  double const value{value_ptr ? *value_ptr : 0};
                                              -
                                              1758  printer->fmt_line("{} {}{};",
                                              -
                                              1759  float_type,
                                              -
                                              1760  name,
                                              -
                                              1761  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                                              -
                                              1762  codegen_global_variables.push_back(var);
                                              -
                                              1763  }
                                              -
                                              1764 
                                              -
                                              1765  print_sdlists_init(print_initializers);
                                              -
                                              1766 
                                              -
                                              1767  if (info.table_count > 0) {
                                              -
                                              1768  printer->fmt_line("double usetable{};", print_initializers ? "{1}" : "");
                                              -
                                              1769  codegen_global_variables.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                                              -
                                              1770 
                                              -
                                              1771  for (const auto& block: info.functions_with_table) {
                                              -
                                              1772  const auto& name = block->get_node_name();
                                              -
                                              1773  printer->fmt_line("{} tmin_{}{};", float_type, name, value_initialize);
                                              -
                                              1774  printer->fmt_line("{} mfac_{}{};", float_type, name, value_initialize);
                                              -
                                              1775  codegen_global_variables.push_back(make_symbol("tmin_" + name));
                                              -
                                              1776  codegen_global_variables.push_back(make_symbol("mfac_" + name));
                                              -
                                              1777  }
                                              -
                                              1778 
                                              -
                                              1779  for (const auto& variable: info.table_statement_variables) {
                                              -
                                              1780  auto const name = "t_" + variable->get_name();
                                              -
                                              1781  auto const num_values = variable->get_num_values();
                                              -
                                              1782  if (variable->is_array()) {
                                              -
                                              1783  int array_len = variable->get_length();
                                              -
                                              1784  printer->fmt_line(
                                              -
                                              1785  "{} {}[{}][{}]{};", float_type, name, array_len, num_values, value_initialize);
                                              -
                                              1786  } else {
                                              -
                                              1787  printer->fmt_line("{} {}[{}]{};", float_type, name, num_values, value_initialize);
                                              -
                                              1788  }
                                              -
                                              1789  codegen_global_variables.push_back(make_symbol(name));
                                              -
                                              1790  }
                                              -
                                              1791  }
                                              -
                                              1792 
                                              -
                                              1793  for (const auto& f: info.function_tables) {
                                              -
                                              1794  printer->fmt_line("void* _ptable_{}{{}};", f->get_node_name());
                                              -
                                              1795  codegen_global_variables.push_back(make_symbol("_ptable_" + f->get_node_name()));
                                              -
                                              1796  }
                                              -
                                              1797 
                                              -
                                              1798  if (info.vectorize && info.thread_data_index) {
                                              -
                                              1799  printer->fmt_line("ThreadDatum ext_call_thread[{}]{};",
                                              -
                                              1800  info.thread_data_index,
                                              -
                                              1801  value_initialize);
                                              -
                                              1802  codegen_global_variables.push_back(make_symbol("ext_call_thread"));
                                              +
                                              1672 
                                              +
                                              1673 /**
                                              +
                                              1674  * Return registration type for a given BEFORE/AFTER block
                                              +
                                              1675  * /param block A BEFORE/AFTER block being registered
                                              +
                                              1676  *
                                              +
                                              1677  * Depending on a block type i.e. BEFORE or AFTER and also type
                                              +
                                              1678  * of it's associated block i.e. BREAKPOINT, INITIAL, SOLVE and
                                              +
                                              1679  * STEP, the registration type (as an integer) is calculated.
                                              +
                                              1680  * These values are then interpreted by CoreNEURON internally.
                                              +
                                              1681  */
                                              +
                                              1682 static std::string get_register_type_for_ba_block(const ast::Block* block) {
                                              +
                                              1683  std::string register_type{};
                                              +
                                              1684  BAType ba_type{};
                                              +
                                              1685  /// before block have value 10 and after block 20
                                              +
                                              1686  if (block->is_before_block()) {
                                              +
                                              1687  // NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
                                              +
                                              1688  register_type = "BAType::Before";
                                              +
                                              1689  ba_type =
                                              +
                                              1690  dynamic_cast<const ast::BeforeBlock*>(block)->get_bablock()->get_type()->get_value();
                                              +
                                              1691  } else {
                                              +
                                              1692  // NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
                                              +
                                              1693  register_type = "BAType::After";
                                              +
                                              1694  ba_type =
                                              +
                                              1695  dynamic_cast<const ast::AfterBlock*>(block)->get_bablock()->get_type()->get_value();
                                              +
                                              1696  }
                                              +
                                              1697 
                                              +
                                              1698  /// associated blocks have different values (1 to 4) based on type.
                                              +
                                              1699  /// These values are based on neuron/coreneuron implementation details.
                                              +
                                              1700  if (ba_type == BATYPE_BREAKPOINT) {
                                              +
                                              1701  register_type += " + BAType::Breakpoint";
                                              +
                                              1702  } else if (ba_type == BATYPE_SOLVE) {
                                              +
                                              1703  register_type += " + BAType::Solve";
                                              +
                                              1704  } else if (ba_type == BATYPE_INITIAL) {
                                              +
                                              1705  register_type += " + BAType::Initial";
                                              +
                                              1706  } else if (ba_type == BATYPE_STEP) {
                                              +
                                              1707  register_type += " + BAType::Step";
                                              +
                                              1708  } else {
                                              +
                                              1709  throw std::runtime_error("Unhandled Before/After type encountered during code generation");
                                              +
                                              1710  }
                                              +
                                              1711  return register_type;
                                              +
                                              1712 }
                                              +
                                              1713 
                                              +
                                              1714 
                                              +
                                              1715 /**
                                              +
                                              1716  * \details Every mod file has register function to connect with the simulator.
                                              +
                                              1717  * Various information about mechanism and callbacks get registered with
                                              +
                                              1718  * the simulator using suffix_reg() function.
                                              +
                                              1719  *
                                              +
                                              1720  * Here are details:
                                              +
                                              1721  * - We should exclude that callback based on the solver, watch statements.
                                              +
                                              1722  * - If nrn_get_mechtype is < -1 means that mechanism is not used in the
                                              +
                                              1723  * context of neuron execution and hence could be ignored in coreneuron
                                              +
                                              1724  * execution.
                                              +
                                              1725  * - Ions are internally defined and their types can be queried similar to
                                              +
                                              1726  * other mechanisms.
                                              +
                                              1727  * - hoc_register_var may not be needed in the context of coreneuron
                                              +
                                              1728  * - We assume net receive buffer is on. This is because generated code is
                                              +
                                              1729  * compatible for cpu as well as gpu target.
                                              +
                                              1730  */
                                              +
                                              1731 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
                                              + +
                                              1733  printer->add_newline(2);
                                              +
                                              1734  printer->add_line("/** register channel with the simulator */");
                                              +
                                              1735  printer->fmt_push_block("void _{}_reg()", info.mod_file);
                                              +
                                              1736 
                                              +
                                              1737  // type related information
                                              +
                                              1738  auto suffix = add_escape_quote(info.mod_suffix);
                                              +
                                              1739  printer->add_newline();
                                              +
                                              1740  printer->fmt_line("int mech_type = nrn_get_mechtype({});", suffix);
                                              +
                                              1741  printer->fmt_line("{} = mech_type;", get_variable_name("mech_type", false));
                                              +
                                              1742  printer->push_block("if (mech_type == -1)");
                                              +
                                              1743  printer->add_line("return;");
                                              +
                                              1744  printer->pop_block();
                                              +
                                              1745 
                                              +
                                              1746  printer->add_newline();
                                              +
                                              1747  printer->add_line("_nrn_layout_reg(mech_type, 0);"); // 0 for SoA
                                              +
                                              1748 
                                              +
                                              1749  // register mechanism
                                              +
                                              1750  const auto mech_arguments = register_mechanism_arguments();
                                              +
                                              1751  const auto number_of_thread_objects = num_thread_objects();
                                              +
                                              1752  if (info.point_process) {
                                              +
                                              1753  printer->fmt_line("point_register_mech({}, {}, {}, {});",
                                              +
                                              1754  mech_arguments,
                                              +
                                              1755  info.constructor_node ? method_name(naming::NRN_CONSTRUCTOR_METHOD)
                                              +
                                              1756  : "nullptr",
                                              +
                                              1757  info.destructor_node ? method_name(naming::NRN_DESTRUCTOR_METHOD)
                                              +
                                              1758  : "nullptr",
                                              +
                                              1759  number_of_thread_objects);
                                              +
                                              1760  } else {
                                              +
                                              1761  printer->fmt_line("register_mech({}, {});", mech_arguments, number_of_thread_objects);
                                              +
                                              1762  if (info.constructor_node) {
                                              +
                                              1763  printer->fmt_line("register_constructor({});",
                                              +
                                              1764  method_name(naming::NRN_CONSTRUCTOR_METHOD));
                                              +
                                              1765  }
                                              +
                                              1766  }
                                              +
                                              1767 
                                              +
                                              1768  // types for ion
                                              +
                                              1769  for (const auto& ion: info.ions) {
                                              +
                                              1770  printer->fmt_line("{} = nrn_get_mechtype({});",
                                              +
                                              1771  get_variable_name(ion.name + "_type", false),
                                              +
                                              1772  add_escape_quote(ion.name + "_ion"));
                                              +
                                              1773  }
                                              +
                                              1774  printer->add_newline();
                                              +
                                              1775 
                                              +
                                              1776  /*
                                              +
                                              1777  * Register callbacks for thread allocation and cleanup. Note that thread_data_index
                                              +
                                              1778  * represent total number of thread used minus 1 (i.e. index of last thread).
                                              +
                                              1779  */
                                              +
                                              1780  if (info.vectorize && (info.thread_data_index != 0)) {
                                              +
                                              1781  // false to avoid getting the copy from the instance structure
                                              +
                                              1782  printer->fmt_line("thread_mem_init({});", get_variable_name("ext_call_thread", false));
                                              +
                                              1783  }
                                              +
                                              1784 
                                              +
                                              1785  if (!info.thread_variables.empty()) {
                                              +
                                              1786  printer->fmt_line("{} = 0;", get_variable_name("thread_data_in_use"));
                                              +
                                              1787  }
                                              +
                                              1788 
                                              +
                                              1789  if (info.thread_callback_register) {
                                              +
                                              1790  printer->add_line("_nrn_thread_reg0(mech_type, thread_mem_cleanup);");
                                              +
                                              1791  printer->add_line("_nrn_thread_reg1(mech_type, thread_mem_init);");
                                              +
                                              1792  }
                                              +
                                              1793 
                                              +
                                              1794  if (info.emit_table_thread()) {
                                              +
                                              1795  auto name = method_name("check_table_thread");
                                              +
                                              1796  printer->fmt_line("_nrn_thread_table_reg(mech_type, {});", name);
                                              +
                                              1797  }
                                              +
                                              1798 
                                              +
                                              1799  // register read/write callbacks for pointers
                                              +
                                              1800  if (info.bbcore_pointer_used) {
                                              +
                                              1801  printer->add_line("hoc_reg_bbcore_read(mech_type, bbcore_read);");
                                              +
                                              1802  printer->add_line("hoc_reg_bbcore_write(mech_type, bbcore_write);");
                                              1803  }
                                              1804 
                                              -
                                              1805  printer->pop_block(";");
                                              -
                                              1806 
                                              -
                                              1807  print_global_var_struct_assertions();
                                              -
                                              1808  print_global_var_struct_decl();
                                              -
                                              1809 }
                                              -
                                              1810 
                                              -
                                              1811 
                                              -
                                              1812 /**
                                              -
                                              1813  * Print structs that encapsulate information about scalar and
                                              -
                                              1814  * vector elements of type global and thread variables.
                                              -
                                              1815  */
                                              - -
                                              1817  auto variable_printer =
                                              -
                                              1818  [&](const std::vector<SymbolType>& variables, bool if_array, bool if_vector) {
                                              -
                                              1819  for (const auto& variable: variables) {
                                              -
                                              1820  if (variable->is_array() == if_array) {
                                              -
                                              1821  // false => do not use the instance struct, which is not
                                              -
                                              1822  // defined in the global declaration that we are printing
                                              -
                                              1823  auto name = get_variable_name(variable->get_name(), false);
                                              -
                                              1824  auto ename = add_escape_quote(variable->get_name() + "_" + info.mod_suffix);
                                              -
                                              1825  auto length = variable->get_length();
                                              -
                                              1826  if (if_vector) {
                                              -
                                              1827  printer->fmt_line("{{{}, {}, {}}},", ename, name, length);
                                              -
                                              1828  } else {
                                              -
                                              1829  printer->fmt_line("{{{}, &{}}},", ename, name);
                                              -
                                              1830  }
                                              -
                                              1831  }
                                              -
                                              1832  }
                                              -
                                              1833  };
                                              -
                                              1834 
                                              -
                                              1835  auto globals = info.global_variables;
                                              -
                                              1836  auto thread_vars = info.thread_variables;
                                              -
                                              1837 
                                              -
                                              1838  if (info.table_count > 0) {
                                              -
                                              1839  globals.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                                              -
                                              1840  }
                                              -
                                              1841 
                                              -
                                              1842  printer->add_newline(2);
                                              -
                                              1843  printer->add_line("/** connect global (scalar) variables to hoc -- */");
                                              -
                                              1844  printer->add_line("static DoubScal hoc_scalar_double[] = {");
                                              -
                                              1845  printer->increase_indent();
                                              -
                                              1846  variable_printer(globals, false, false);
                                              -
                                              1847  variable_printer(thread_vars, false, false);
                                              -
                                              1848  printer->add_line("{nullptr, nullptr}");
                                              -
                                              1849  printer->decrease_indent();
                                              -
                                              1850  printer->add_line("};");
                                              -
                                              1851 
                                              -
                                              1852  printer->add_newline(2);
                                              -
                                              1853  printer->add_line("/** connect global (array) variables to hoc -- */");
                                              -
                                              1854  printer->add_line("static DoubVec hoc_vector_double[] = {");
                                              -
                                              1855  printer->increase_indent();
                                              -
                                              1856  variable_printer(globals, true, true);
                                              -
                                              1857  variable_printer(thread_vars, true, true);
                                              -
                                              1858  printer->add_line("{nullptr, nullptr, 0}");
                                              -
                                              1859  printer->decrease_indent();
                                              -
                                              1860  printer->add_line("};");
                                              -
                                              1861 }
                                              -
                                              1862 
                                              -
                                              1863 
                                              -
                                              1864 /**
                                              -
                                              1865  * Return registration type for a given BEFORE/AFTER block
                                              -
                                              1866  * /param block A BEFORE/AFTER block being registered
                                              -
                                              1867  *
                                              -
                                              1868  * Depending on a block type i.e. BEFORE or AFTER and also type
                                              -
                                              1869  * of it's associated block i.e. BREAKPOINT, INITIAL, SOLVE and
                                              -
                                              1870  * STEP, the registration type (as an integer) is calculated.
                                              -
                                              1871  * These values are then interpreted by CoreNEURON internally.
                                              -
                                              1872  */
                                              -
                                              1873 static std::string get_register_type_for_ba_block(const ast::Block* block) {
                                              -
                                              1874  std::string register_type{};
                                              -
                                              1875  BAType ba_type{};
                                              -
                                              1876  /// before block have value 10 and after block 20
                                              -
                                              1877  if (block->is_before_block()) {
                                              -
                                              1878  // NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
                                              -
                                              1879  register_type = "BAType::Before";
                                              -
                                              1880  ba_type =
                                              -
                                              1881  dynamic_cast<const ast::BeforeBlock*>(block)->get_bablock()->get_type()->get_value();
                                              -
                                              1882  } else {
                                              -
                                              1883  // NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
                                              -
                                              1884  register_type = "BAType::After";
                                              -
                                              1885  ba_type =
                                              -
                                              1886  dynamic_cast<const ast::AfterBlock*>(block)->get_bablock()->get_type()->get_value();
                                              -
                                              1887  }
                                              -
                                              1888 
                                              -
                                              1889  /// associated blocks have different values (1 to 4) based on type.
                                              -
                                              1890  /// These values are based on neuron/coreneuron implementation details.
                                              -
                                              1891  if (ba_type == BATYPE_BREAKPOINT) {
                                              -
                                              1892  register_type += " + BAType::Breakpoint";
                                              -
                                              1893  } else if (ba_type == BATYPE_SOLVE) {
                                              -
                                              1894  register_type += " + BAType::Solve";
                                              -
                                              1895  } else if (ba_type == BATYPE_INITIAL) {
                                              -
                                              1896  register_type += " + BAType::Initial";
                                              -
                                              1897  } else if (ba_type == BATYPE_STEP) {
                                              -
                                              1898  register_type += " + BAType::Step";
                                              -
                                              1899  } else {
                                              -
                                              1900  throw std::runtime_error("Unhandled Before/After type encountered during code generation");
                                              -
                                              1901  }
                                              -
                                              1902  return register_type;
                                              -
                                              1903 }
                                              -
                                              1904 
                                              -
                                              1905 
                                              -
                                              1906 /**
                                              -
                                              1907  * \details Every mod file has register function to connect with the simulator.
                                              -
                                              1908  * Various information about mechanism and callbacks get registered with
                                              -
                                              1909  * the simulator using suffix_reg() function.
                                              -
                                              1910  *
                                              -
                                              1911  * Here are details:
                                              -
                                              1912  * - We should exclude that callback based on the solver, watch statements.
                                              -
                                              1913  * - If nrn_get_mechtype is < -1 means that mechanism is not used in the
                                              -
                                              1914  * context of neuron execution and hence could be ignored in coreneuron
                                              -
                                              1915  * execution.
                                              -
                                              1916  * - Ions are internally defined and their types can be queried similar to
                                              -
                                              1917  * other mechanisms.
                                              -
                                              1918  * - hoc_register_var may not be needed in the context of coreneuron
                                              -
                                              1919  * - We assume net receive buffer is on. This is because generated code is
                                              -
                                              1920  * compatible for cpu as well as gpu target.
                                              -
                                              1921  */
                                              -
                                              1922 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
                                              - -
                                              1924  printer->add_newline(2);
                                              -
                                              1925  printer->add_line("/** register channel with the simulator */");
                                              -
                                              1926  printer->fmt_push_block("void _{}_reg()", info.mod_file);
                                              -
                                              1927 
                                              -
                                              1928  // type related information
                                              -
                                              1929  auto suffix = add_escape_quote(info.mod_suffix);
                                              -
                                              1930  printer->add_newline();
                                              -
                                              1931  printer->fmt_line("int mech_type = nrn_get_mechtype({});", suffix);
                                              -
                                              1932  printer->fmt_line("{} = mech_type;", get_variable_name("mech_type", false));
                                              -
                                              1933  printer->push_block("if (mech_type == -1)");
                                              -
                                              1934  printer->add_line("return;");
                                              -
                                              1935  printer->pop_block();
                                              +
                                              1805  // register size of double and int elements
                                              +
                                              1806  // clang-format off
                                              +
                                              1807  printer->add_line("hoc_register_prop_size(mech_type, float_variables_size(), int_variables_size());");
                                              +
                                              1808  // clang-format on
                                              +
                                              1809 
                                              +
                                              1810  // register semantics for index variables
                                              +
                                              1811  for (auto& semantic: info.semantics) {
                                              +
                                              1812  auto args =
                                              +
                                              1813  fmt::format("mech_type, {}, {}", semantic.index, add_escape_quote(semantic.name));
                                              +
                                              1814  printer->fmt_line("hoc_register_dparam_semantics({});", args);
                                              +
                                              1815  }
                                              +
                                              1816 
                                              +
                                              1817  if (info.is_watch_used()) {
                                              +
                                              1818  auto watch_fun = compute_method_name(BlockType::Watch);
                                              +
                                              1819  printer->fmt_line("hoc_register_watch_check({}, mech_type);", watch_fun);
                                              +
                                              1820  }
                                              +
                                              1821 
                                              +
                                              1822  if (info.write_concentration) {
                                              +
                                              1823  printer->add_line("nrn_writes_conc(mech_type, 0);");
                                              +
                                              1824  }
                                              +
                                              1825 
                                              +
                                              1826  // register various information for point process type
                                              +
                                              1827  if (info.net_event_used) {
                                              +
                                              1828  printer->add_line("add_nrn_has_net_event(mech_type);");
                                              +
                                              1829  }
                                              +
                                              1830  if (info.artificial_cell) {
                                              +
                                              1831  printer->fmt_line("add_nrn_artcell(mech_type, {});", info.tqitem_index);
                                              +
                                              1832  }
                                              +
                                              1833  if (net_receive_buffering_required()) {
                                              +
                                              1834  printer->fmt_line("hoc_register_net_receive_buffering({}, mech_type);",
                                              +
                                              1835  method_name("net_buf_receive"));
                                              +
                                              1836  }
                                              +
                                              1837  if (info.num_net_receive_parameters != 0) {
                                              +
                                              1838  auto net_recv_init_arg = "nullptr";
                                              +
                                              1839  if (info.net_receive_initial_node != nullptr) {
                                              +
                                              1840  net_recv_init_arg = "net_init";
                                              +
                                              1841  }
                                              +
                                              1842  printer->fmt_line("set_pnt_receive(mech_type, {}, {}, num_net_receive_args());",
                                              +
                                              1843  method_name("net_receive"),
                                              +
                                              1844  net_recv_init_arg);
                                              +
                                              1845  }
                                              +
                                              1846  if (info.for_netcon_used) {
                                              +
                                              1847  // index where information about FOR_NETCON is stored in the integer array
                                              +
                                              1848  const auto index =
                                              +
                                              1849  std::find_if(info.semantics.begin(), info.semantics.end(), [](const IndexSemantics& a) {
                                              +
                                              1850  return a.name == naming::FOR_NETCON_SEMANTIC;
                                              +
                                              1851  })->index;
                                              +
                                              1852  printer->fmt_line("add_nrn_fornetcons(mech_type, {});", index);
                                              +
                                              1853  }
                                              +
                                              1854 
                                              +
                                              1855  if (info.net_event_used || info.net_send_used) {
                                              +
                                              1856  printer->add_line("hoc_register_net_send_buffering(mech_type);");
                                              +
                                              1857  }
                                              +
                                              1858 
                                              +
                                              1859  /// register all before/after blocks
                                              +
                                              1860  for (size_t i = 0; i < info.before_after_blocks.size(); i++) {
                                              +
                                              1861  // register type and associated function name for the block
                                              +
                                              1862  const auto& block = info.before_after_blocks[i];
                                              +
                                              1863  std::string register_type = get_register_type_for_ba_block(block);
                                              +
                                              1864  std::string function_name = method_name(fmt::format("nrn_before_after_{}", i));
                                              +
                                              1865  printer->fmt_line("hoc_reg_ba(mech_type, {}, {});", function_name, register_type);
                                              +
                                              1866  }
                                              +
                                              1867 
                                              +
                                              1868  // register variables for hoc
                                              +
                                              1869  printer->add_line("hoc_register_var(hoc_scalar_double, hoc_vector_double, NULL);");
                                              +
                                              1870  printer->pop_block();
                                              +
                                              1871 }
                                              +
                                              1872 
                                              +
                                              1873 
                                              + +
                                              1875  if (!info.thread_callback_register) {
                                              +
                                              1876  return;
                                              +
                                              1877  }
                                              +
                                              1878 
                                              +
                                              1879  // thread_mem_init callback
                                              +
                                              1880  printer->add_newline(2);
                                              +
                                              1881  printer->add_line("/** thread memory allocation callback */");
                                              +
                                              1882  printer->push_block("static void thread_mem_init(ThreadDatum* thread) ");
                                              +
                                              1883 
                                              +
                                              1884  if (info.vectorize && info.derivimplicit_used()) {
                                              +
                                              1885  printer->fmt_line("thread[dith{}()].pval = nullptr;", info.derivimplicit_list_num);
                                              +
                                              1886  }
                                              +
                                              1887  if (info.vectorize && (info.top_local_thread_size != 0)) {
                                              +
                                              1888  auto length = info.top_local_thread_size;
                                              +
                                              1889  auto allocation = fmt::format("(double*)mem_alloc({}, sizeof(double))", length);
                                              +
                                              1890  printer->fmt_line("thread[top_local_var_tid()].pval = {};", allocation);
                                              +
                                              1891  }
                                              +
                                              1892  if (info.thread_var_data_size != 0) {
                                              +
                                              1893  auto length = info.thread_var_data_size;
                                              +
                                              1894  auto thread_data = get_variable_name("thread_data");
                                              +
                                              1895  auto thread_data_in_use = get_variable_name("thread_data_in_use");
                                              +
                                              1896  auto allocation = fmt::format("(double*)mem_alloc({}, sizeof(double))", length);
                                              +
                                              1897  printer->fmt_push_block("if ({})", thread_data_in_use);
                                              +
                                              1898  printer->fmt_line("thread[thread_var_tid()].pval = {};", allocation);
                                              +
                                              1899  printer->chain_block("else");
                                              +
                                              1900  printer->fmt_line("thread[thread_var_tid()].pval = {};", thread_data);
                                              +
                                              1901  printer->fmt_line("{} = 1;", thread_data_in_use);
                                              +
                                              1902  printer->pop_block();
                                              +
                                              1903  }
                                              +
                                              1904  printer->pop_block();
                                              +
                                              1905  printer->add_newline(2);
                                              +
                                              1906 
                                              +
                                              1907 
                                              +
                                              1908  // thread_mem_cleanup callback
                                              +
                                              1909  printer->add_line("/** thread memory cleanup callback */");
                                              +
                                              1910  printer->push_block("static void thread_mem_cleanup(ThreadDatum* thread) ");
                                              +
                                              1911 
                                              +
                                              1912  // clang-format off
                                              +
                                              1913  if (info.vectorize && info.derivimplicit_used()) {
                                              +
                                              1914  int n = info.derivimplicit_list_num;
                                              +
                                              1915  printer->fmt_line("free(thread[dith{}()].pval);", n);
                                              +
                                              1916  printer->fmt_line("nrn_destroy_newtonspace(static_cast<NewtonSpace*>(*newtonspace{}(thread)));", n);
                                              +
                                              1917  }
                                              +
                                              1918  // clang-format on
                                              +
                                              1919 
                                              +
                                              1920  if (info.top_local_thread_size != 0) {
                                              +
                                              1921  auto line = "free(thread[top_local_var_tid()].pval);";
                                              +
                                              1922  printer->add_line(line);
                                              +
                                              1923  }
                                              +
                                              1924  if (info.thread_var_data_size != 0) {
                                              +
                                              1925  auto thread_data = get_variable_name("thread_data");
                                              +
                                              1926  auto thread_data_in_use = get_variable_name("thread_data_in_use");
                                              +
                                              1927  printer->fmt_push_block("if (thread[thread_var_tid()].pval == {})", thread_data);
                                              +
                                              1928  printer->fmt_line("{} = 0;", thread_data_in_use);
                                              +
                                              1929  printer->chain_block("else");
                                              +
                                              1930  printer->add_line("free(thread[thread_var_tid()].pval);");
                                              +
                                              1931  printer->pop_block();
                                              +
                                              1932  }
                                              +
                                              1933  printer->pop_block();
                                              +
                                              1934 }
                                              +
                                              1935 
                                              1936 
                                              -
                                              1937  printer->add_newline();
                                              -
                                              1938  printer->add_line("_nrn_layout_reg(mech_type, 0);"); // 0 for SoA
                                              -
                                              1939 
                                              -
                                              1940  // register mechanism
                                              -
                                              1941  const auto mech_arguments = register_mechanism_arguments();
                                              -
                                              1942  const auto number_of_thread_objects = num_thread_objects();
                                              -
                                              1943  if (info.point_process) {
                                              -
                                              1944  printer->fmt_line("point_register_mech({}, {}, {}, {});",
                                              -
                                              1945  mech_arguments,
                                              -
                                              1946  info.constructor_node ? method_name(naming::NRN_CONSTRUCTOR_METHOD)
                                              -
                                              1947  : "nullptr",
                                              -
                                              1948  info.destructor_node ? method_name(naming::NRN_DESTRUCTOR_METHOD)
                                              -
                                              1949  : "nullptr",
                                              -
                                              1950  number_of_thread_objects);
                                              -
                                              1951  } else {
                                              -
                                              1952  printer->fmt_line("register_mech({}, {});", mech_arguments, number_of_thread_objects);
                                              -
                                              1953  if (info.constructor_node) {
                                              -
                                              1954  printer->fmt_line("register_constructor({});",
                                              -
                                              1955  method_name(naming::NRN_CONSTRUCTOR_METHOD));
                                              -
                                              1956  }
                                              + +
                                              1938  auto const value_initialize = print_initializers ? "{}" : "";
                                              +
                                              1939  auto int_type = default_int_data_type();
                                              +
                                              1940  printer->add_newline(2);
                                              +
                                              1941  printer->add_line("/** all mechanism instance variables and global variables */");
                                              +
                                              1942  printer->fmt_push_block("struct {} ", instance_struct());
                                              +
                                              1943 
                                              +
                                              1944  for (auto const& [var, type]: info.neuron_global_variables) {
                                              +
                                              1945  auto const name = var->get_name();
                                              +
                                              1946  printer->fmt_line("{}* {}{};",
                                              +
                                              1947  type,
                                              +
                                              1948  name,
                                              +
                                              1949  print_initializers ? fmt::format("{{&coreneuron::{}}}", name)
                                              +
                                              1950  : std::string{});
                                              +
                                              1951  }
                                              +
                                              1952  for (auto& var: codegen_float_variables) {
                                              +
                                              1953  const auto& name = var->get_name();
                                              +
                                              1954  auto type = get_range_var_float_type(var);
                                              +
                                              1955  auto qualifier = is_constant_variable(name) ? "const " : "";
                                              +
                                              1956  printer->fmt_line("{}{}* {}{};", qualifier, type, name, value_initialize);
                                              1957  }
                                              -
                                              1958 
                                              -
                                              1959  // types for ion
                                              -
                                              1960  for (const auto& ion: info.ions) {
                                              -
                                              1961  printer->fmt_line("{} = nrn_get_mechtype({});",
                                              -
                                              1962  get_variable_name(ion.name + "_type", false),
                                              -
                                              1963  add_escape_quote(ion.name + "_ion"));
                                              -
                                              1964  }
                                              -
                                              1965  printer->add_newline();
                                              -
                                              1966 
                                              -
                                              1967  /*
                                              -
                                              1968  * Register callbacks for thread allocation and cleanup. Note that thread_data_index
                                              -
                                              1969  * represent total number of thread used minus 1 (i.e. index of last thread).
                                              -
                                              1970  */
                                              -
                                              1971  if (info.vectorize && (info.thread_data_index != 0)) {
                                              -
                                              1972  // false to avoid getting the copy from the instance structure
                                              -
                                              1973  printer->fmt_line("thread_mem_init({});", get_variable_name("ext_call_thread", false));
                                              -
                                              1974  }
                                              -
                                              1975 
                                              -
                                              1976  if (!info.thread_variables.empty()) {
                                              -
                                              1977  printer->fmt_line("{} = 0;", get_variable_name("thread_data_in_use"));
                                              -
                                              1978  }
                                              -
                                              1979 
                                              -
                                              1980  if (info.thread_callback_register) {
                                              -
                                              1981  printer->add_line("_nrn_thread_reg0(mech_type, thread_mem_cleanup);");
                                              -
                                              1982  printer->add_line("_nrn_thread_reg1(mech_type, thread_mem_init);");
                                              -
                                              1983  }
                                              -
                                              1984 
                                              -
                                              1985  if (info.emit_table_thread()) {
                                              -
                                              1986  auto name = method_name("check_table_thread");
                                              -
                                              1987  printer->fmt_line("_nrn_thread_table_reg(mech_type, {});", name);
                                              -
                                              1988  }
                                              +
                                              1958  for (auto& var: codegen_int_variables) {
                                              +
                                              1959  const auto& name = var.symbol->get_name();
                                              +
                                              1960  if (var.is_index || var.is_integer) {
                                              +
                                              1961  auto qualifier = var.is_constant ? "const " : "";
                                              +
                                              1962  printer->fmt_line("{}{}* {}{};", qualifier, int_type, name, value_initialize);
                                              +
                                              1963  } else {
                                              +
                                              1964  auto qualifier = var.is_constant ? "const " : "";
                                              +
                                              1965  auto type = var.is_vdata ? "void*" : default_float_data_type();
                                              +
                                              1966  printer->fmt_line("{}{}* {}{};", qualifier, type, name, value_initialize);
                                              +
                                              1967  }
                                              +
                                              1968  }
                                              +
                                              1969 
                                              +
                                              1970  printer->fmt_line("{}* {}{};",
                                              +
                                              1971  global_struct(),
                                              + +
                                              1973  print_initializers ? fmt::format("{{&{}}}", global_struct_instance())
                                              +
                                              1974  : std::string{});
                                              +
                                              1975  printer->pop_block(";");
                                              +
                                              1976 }
                                              +
                                              1977 
                                              +
                                              1978 
                                              + +
                                              1980  if (!ion_variable_struct_required()) {
                                              +
                                              1981  return;
                                              +
                                              1982  }
                                              +
                                              1983  printer->add_newline(2);
                                              +
                                              1984  printer->add_line("/** ion write variables */");
                                              +
                                              1985  printer->push_block("struct IonCurVar");
                                              +
                                              1986 
                                              +
                                              1987  std::string float_type = default_float_data_type();
                                              +
                                              1988  std::vector<std::string> members;
                                              1989 
                                              -
                                              1990  // register read/write callbacks for pointers
                                              -
                                              1991  if (info.bbcore_pointer_used) {
                                              -
                                              1992  printer->add_line("hoc_reg_bbcore_read(mech_type, bbcore_read);");
                                              -
                                              1993  printer->add_line("hoc_reg_bbcore_write(mech_type, bbcore_write);");
                                              -
                                              1994  }
                                              -
                                              1995 
                                              -
                                              1996  // register size of double and int elements
                                              -
                                              1997  // clang-format off
                                              -
                                              1998  printer->add_line("hoc_register_prop_size(mech_type, float_variables_size(), int_variables_size());");
                                              -
                                              1999  // clang-format on
                                              -
                                              2000 
                                              -
                                              2001  // register semantics for index variables
                                              -
                                              2002  for (auto& semantic: info.semantics) {
                                              -
                                              2003  auto args =
                                              -
                                              2004  fmt::format("mech_type, {}, {}", semantic.index, add_escape_quote(semantic.name));
                                              -
                                              2005  printer->fmt_line("hoc_register_dparam_semantics({});", args);
                                              -
                                              2006  }
                                              +
                                              1990  for (auto& ion: info.ions) {
                                              +
                                              1991  for (auto& var: ion.writes) {
                                              +
                                              1992  printer->fmt_line("{} {};", float_type, var);
                                              +
                                              1993  members.push_back(var);
                                              +
                                              1994  }
                                              +
                                              1995  }
                                              +
                                              1996  for (auto& var: info.currents) {
                                              +
                                              1997  if (!info.is_ion_variable(var)) {
                                              +
                                              1998  printer->fmt_line("{} {};", float_type, var);
                                              +
                                              1999  members.push_back(var);
                                              +
                                              2000  }
                                              +
                                              2001  }
                                              +
                                              2002 
                                              +
                                              2003  print_ion_var_constructor(members);
                                              +
                                              2004 
                                              +
                                              2005  printer->pop_block(";");
                                              +
                                              2006 }
                                              2007 
                                              -
                                              2008  if (info.is_watch_used()) {
                                              -
                                              2009  auto watch_fun = compute_method_name(BlockType::Watch);
                                              -
                                              2010  printer->fmt_line("hoc_register_watch_check({}, mech_type);", watch_fun);
                                              -
                                              2011  }
                                              -
                                              2012 
                                              -
                                              2013  if (info.write_concentration) {
                                              -
                                              2014  printer->add_line("nrn_writes_conc(mech_type, 0);");
                                              -
                                              2015  }
                                              -
                                              2016 
                                              -
                                              2017  // register various information for point process type
                                              -
                                              2018  if (info.net_event_used) {
                                              -
                                              2019  printer->add_line("add_nrn_has_net_event(mech_type);");
                                              +
                                              2008 
                                              + +
                                              2010  const std::vector<std::string>& members) {
                                              +
                                              2011  // constructor
                                              +
                                              2012  printer->add_newline();
                                              +
                                              2013  printer->add_indent();
                                              +
                                              2014  printer->add_text("IonCurVar() : ");
                                              +
                                              2015  for (int i = 0; i < members.size(); i++) {
                                              +
                                              2016  printer->fmt_text("{}(0)", members[i]);
                                              +
                                              2017  if (i + 1 < members.size()) {
                                              +
                                              2018  printer->add_text(", ");
                                              +
                                              2019  }
                                              2020  }
                                              -
                                              2021  if (info.artificial_cell) {
                                              -
                                              2022  printer->fmt_line("add_nrn_artcell(mech_type, {});", info.tqitem_index);
                                              -
                                              2023  }
                                              -
                                              2024  if (net_receive_buffering_required()) {
                                              -
                                              2025  printer->fmt_line("hoc_register_net_receive_buffering({}, mech_type);",
                                              -
                                              2026  method_name("net_buf_receive"));
                                              -
                                              2027  }
                                              -
                                              2028  if (info.num_net_receive_parameters != 0) {
                                              -
                                              2029  auto net_recv_init_arg = "nullptr";
                                              -
                                              2030  if (info.net_receive_initial_node != nullptr) {
                                              -
                                              2031  net_recv_init_arg = "net_init";
                                              -
                                              2032  }
                                              -
                                              2033  printer->fmt_line("set_pnt_receive(mech_type, {}, {}, num_net_receive_args());",
                                              -
                                              2034  method_name("net_receive"),
                                              -
                                              2035  net_recv_init_arg);
                                              -
                                              2036  }
                                              -
                                              2037  if (info.for_netcon_used) {
                                              -
                                              2038  // index where information about FOR_NETCON is stored in the integer array
                                              -
                                              2039  const auto index =
                                              -
                                              2040  std::find_if(info.semantics.begin(), info.semantics.end(), [](const IndexSemantics& a) {
                                              -
                                              2041  return a.name == naming::FOR_NETCON_SEMANTIC;
                                              -
                                              2042  })->index;
                                              -
                                              2043  printer->fmt_line("add_nrn_fornetcons(mech_type, {});", index);
                                              -
                                              2044  }
                                              -
                                              2045 
                                              -
                                              2046  if (info.net_event_used || info.net_send_used) {
                                              -
                                              2047  printer->add_line("hoc_register_net_send_buffering(mech_type);");
                                              -
                                              2048  }
                                              -
                                              2049 
                                              -
                                              2050  /// register all before/after blocks
                                              -
                                              2051  for (size_t i = 0; i < info.before_after_blocks.size(); i++) {
                                              -
                                              2052  // register type and associated function name for the block
                                              -
                                              2053  const auto& block = info.before_after_blocks[i];
                                              -
                                              2054  std::string register_type = get_register_type_for_ba_block(block);
                                              -
                                              2055  std::string function_name = method_name(fmt::format("nrn_before_after_{}", i));
                                              -
                                              2056  printer->fmt_line("hoc_reg_ba(mech_type, {}, {});", function_name, register_type);
                                              -
                                              2057  }
                                              -
                                              2058 
                                              -
                                              2059  // register variables for hoc
                                              -
                                              2060  printer->add_line("hoc_register_var(hoc_scalar_double, hoc_vector_double, NULL);");
                                              -
                                              2061  printer->pop_block();
                                              -
                                              2062 }
                                              -
                                              2063 
                                              -
                                              2064 
                                              - -
                                              2066  if (!info.thread_callback_register) {
                                              -
                                              2067  return;
                                              +
                                              2021  printer->add_text(" {}");
                                              +
                                              2022  printer->add_newline();
                                              +
                                              2023 }
                                              +
                                              2024 
                                              +
                                              2025 
                                              + +
                                              2027  printer->add_line("IonCurVar ionvar;");
                                              +
                                              2028 }
                                              +
                                              2029 
                                              +
                                              2030 
                                              + +
                                              2032  // nothing for cpu
                                              +
                                              2033 }
                                              +
                                              2034 
                                              +
                                              2035 
                                              + +
                                              2037  auto type = float_data_type();
                                              +
                                              2038  printer->add_newline(2);
                                              +
                                              2039  printer->add_line("/** allocate and setup array for range variable */");
                                              +
                                              2040  printer->fmt_push_block("static inline {}* setup_range_variable(double* variable, int n)",
                                              +
                                              2041  type);
                                              +
                                              2042  printer->fmt_line("{0}* data = ({0}*) mem_alloc(n, sizeof({0}));", type);
                                              +
                                              2043  printer->push_block("for(size_t i = 0; i < n; i++)");
                                              +
                                              2044  printer->add_line("data[i] = variable[i];");
                                              +
                                              2045  printer->pop_block();
                                              +
                                              2046  printer->add_line("return data;");
                                              +
                                              2047  printer->pop_block();
                                              +
                                              2048 }
                                              +
                                              2049 
                                              +
                                              2050 
                                              +
                                              2051 /**
                                              +
                                              2052  * \details If floating point type like "float" is specified on command line then
                                              +
                                              2053  * we can't turn all variables to new type. This is because certain variables
                                              +
                                              2054  * are pointers to internal variables (e.g. ions). Hence, we check if given
                                              +
                                              2055  * variable can be safely converted to new type. If so, return new type.
                                              +
                                              2056  */
                                              + +
                                              2058  // clang-format off
                                              +
                                              2059  auto with = NmodlType::read_ion_var
                                              +
                                              2060  | NmodlType::write_ion_var
                                              +
                                              2061  | NmodlType::pointer_var
                                              +
                                              2062  | NmodlType::bbcore_pointer_var
                                              +
                                              2063  | NmodlType::extern_neuron_variable;
                                              +
                                              2064  // clang-format on
                                              +
                                              2065  bool need_default_type = symbol->has_any_property(with);
                                              +
                                              2066  if (need_default_type) {
                                              +
                                              2067  return default_float_data_type();
                                              2068  }
                                              -
                                              2069 
                                              -
                                              2070  // thread_mem_init callback
                                              -
                                              2071  printer->add_newline(2);
                                              -
                                              2072  printer->add_line("/** thread memory allocation callback */");
                                              -
                                              2073  printer->push_block("static void thread_mem_init(ThreadDatum* thread) ");
                                              -
                                              2074 
                                              -
                                              2075  if (info.vectorize && info.derivimplicit_used()) {
                                              -
                                              2076  printer->fmt_line("thread[dith{}()].pval = nullptr;", info.derivimplicit_list_num);
                                              -
                                              2077  }
                                              -
                                              2078  if (info.vectorize && (info.top_local_thread_size != 0)) {
                                              -
                                              2079  auto length = info.top_local_thread_size;
                                              -
                                              2080  auto allocation = fmt::format("(double*)mem_alloc({}, sizeof(double))", length);
                                              -
                                              2081  printer->fmt_line("thread[top_local_var_tid()].pval = {};", allocation);
                                              -
                                              2082  }
                                              -
                                              2083  if (info.thread_var_data_size != 0) {
                                              -
                                              2084  auto length = info.thread_var_data_size;
                                              -
                                              2085  auto thread_data = get_variable_name("thread_data");
                                              -
                                              2086  auto thread_data_in_use = get_variable_name("thread_data_in_use");
                                              -
                                              2087  auto allocation = fmt::format("(double*)mem_alloc({}, sizeof(double))", length);
                                              -
                                              2088  printer->fmt_push_block("if ({})", thread_data_in_use);
                                              -
                                              2089  printer->fmt_line("thread[thread_var_tid()].pval = {};", allocation);
                                              -
                                              2090  printer->chain_block("else");
                                              -
                                              2091  printer->fmt_line("thread[thread_var_tid()].pval = {};", thread_data);
                                              -
                                              2092  printer->fmt_line("{} = 1;", thread_data_in_use);
                                              -
                                              2093  printer->pop_block();
                                              -
                                              2094  }
                                              -
                                              2095  printer->pop_block();
                                              -
                                              2096  printer->add_newline(2);
                                              -
                                              2097 
                                              -
                                              2098 
                                              -
                                              2099  // thread_mem_cleanup callback
                                              -
                                              2100  printer->add_line("/** thread memory cleanup callback */");
                                              -
                                              2101  printer->push_block("static void thread_mem_cleanup(ThreadDatum* thread) ");
                                              -
                                              2102 
                                              -
                                              2103  // clang-format off
                                              -
                                              2104  if (info.vectorize && info.derivimplicit_used()) {
                                              -
                                              2105  int n = info.derivimplicit_list_num;
                                              -
                                              2106  printer->fmt_line("free(thread[dith{}()].pval);", n);
                                              -
                                              2107  printer->fmt_line("nrn_destroy_newtonspace(static_cast<NewtonSpace*>(*newtonspace{}(thread)));", n);
                                              -
                                              2108  }
                                              -
                                              2109  // clang-format on
                                              -
                                              2110 
                                              -
                                              2111  if (info.top_local_thread_size != 0) {
                                              -
                                              2112  auto line = "free(thread[top_local_var_tid()].pval);";
                                              -
                                              2113  printer->add_line(line);
                                              -
                                              2114  }
                                              -
                                              2115  if (info.thread_var_data_size != 0) {
                                              -
                                              2116  auto thread_data = get_variable_name("thread_data");
                                              -
                                              2117  auto thread_data_in_use = get_variable_name("thread_data_in_use");
                                              -
                                              2118  printer->fmt_push_block("if (thread[thread_var_tid()].pval == {})", thread_data);
                                              -
                                              2119  printer->fmt_line("{} = 0;", thread_data_in_use);
                                              -
                                              2120  printer->chain_block("else");
                                              -
                                              2121  printer->add_line("free(thread[thread_var_tid()].pval);");
                                              -
                                              2122  printer->pop_block();
                                              -
                                              2123  }
                                              -
                                              2124  printer->pop_block();
                                              -
                                              2125 }
                                              -
                                              2126 
                                              -
                                              2127 
                                              - -
                                              2129  auto const value_initialize = print_initializers ? "{}" : "";
                                              -
                                              2130  auto int_type = default_int_data_type();
                                              -
                                              2131  printer->add_newline(2);
                                              -
                                              2132  printer->add_line("/** all mechanism instance variables and global variables */");
                                              -
                                              2133  printer->fmt_push_block("struct {} ", instance_struct());
                                              -
                                              2134 
                                              -
                                              2135  for (auto const& [var, type]: info.neuron_global_variables) {
                                              -
                                              2136  auto const name = var->get_name();
                                              -
                                              2137  printer->fmt_line("{}* {}{};",
                                              -
                                              2138  type,
                                              -
                                              2139  name,
                                              -
                                              2140  print_initializers ? fmt::format("{{&coreneuron::{}}}", name)
                                              -
                                              2141  : std::string{});
                                              -
                                              2142  }
                                              -
                                              2143  for (auto& var: codegen_float_variables) {
                                              -
                                              2144  const auto& name = var->get_name();
                                              -
                                              2145  auto type = get_range_var_float_type(var);
                                              -
                                              2146  auto qualifier = is_constant_variable(name) ? "const " : "";
                                              -
                                              2147  printer->fmt_line("{}{}* {}{};", qualifier, type, name, value_initialize);
                                              -
                                              2148  }
                                              -
                                              2149  for (auto& var: codegen_int_variables) {
                                              -
                                              2150  const auto& name = var.symbol->get_name();
                                              -
                                              2151  if (var.is_index || var.is_integer) {
                                              -
                                              2152  auto qualifier = var.is_constant ? "const " : "";
                                              -
                                              2153  printer->fmt_line("{}{}* {}{};", qualifier, int_type, name, value_initialize);
                                              -
                                              2154  } else {
                                              -
                                              2155  auto qualifier = var.is_constant ? "const " : "";
                                              -
                                              2156  auto type = var.is_vdata ? "void*" : default_float_data_type();
                                              -
                                              2157  printer->fmt_line("{}{}* {}{};", qualifier, type, name, value_initialize);
                                              -
                                              2158  }
                                              -
                                              2159  }
                                              -
                                              2160 
                                              -
                                              2161  printer->fmt_line("{}* {}{};",
                                              -
                                              2162  global_struct(),
                                              - -
                                              2164  print_initializers ? fmt::format("{{&{}}}", global_struct_instance())
                                              -
                                              2165  : std::string{});
                                              -
                                              2166  printer->pop_block(";");
                                              -
                                              2167 }
                                              -
                                              2168 
                                              -
                                              2169 
                                              - -
                                              2171  if (!ion_variable_struct_required()) {
                                              -
                                              2172  return;
                                              -
                                              2173  }
                                              -
                                              2174  printer->add_newline(2);
                                              -
                                              2175  printer->add_line("/** ion write variables */");
                                              -
                                              2176  printer->push_block("struct IonCurVar");
                                              -
                                              2177 
                                              -
                                              2178  std::string float_type = default_float_data_type();
                                              -
                                              2179  std::vector<std::string> members;
                                              -
                                              2180 
                                              -
                                              2181  for (auto& ion: info.ions) {
                                              -
                                              2182  for (auto& var: ion.writes) {
                                              -
                                              2183  printer->fmt_line("{} {};", float_type, var);
                                              -
                                              2184  members.push_back(var);
                                              -
                                              2185  }
                                              -
                                              2186  }
                                              -
                                              2187  for (auto& var: info.currents) {
                                              -
                                              2188  if (!info.is_ion_variable(var)) {
                                              -
                                              2189  printer->fmt_line("{} {};", float_type, var);
                                              -
                                              2190  members.push_back(var);
                                              -
                                              2191  }
                                              -
                                              2192  }
                                              -
                                              2193 
                                              -
                                              2194  print_ion_var_constructor(members);
                                              +
                                              2069  return float_data_type();
                                              +
                                              2070 }
                                              +
                                              2071 
                                              +
                                              2072 
                                              + +
                                              2074  if (range_variable_setup_required()) {
                                              +
                                              2075  print_setup_range_variable();
                                              +
                                              2076  }
                                              +
                                              2077 
                                              +
                                              2078  printer->add_newline();
                                              +
                                              2079  printer->add_line("// Allocate instance structure");
                                              +
                                              2080  printer->fmt_push_block("static void {}(NrnThread* nt, Memb_list* ml, int type)",
                                              + +
                                              2082  printer->add_line("assert(!ml->instance);");
                                              +
                                              2083  printer->add_line("assert(!ml->global_variables);");
                                              +
                                              2084  printer->add_line("assert(ml->global_variables_size == 0);");
                                              +
                                              2085  printer->fmt_line("auto* const inst = new {}{{}};", instance_struct());
                                              +
                                              2086  printer->fmt_line("assert(inst->{} == &{});",
                                              + +
                                              2088  global_struct_instance());
                                              +
                                              2089  printer->add_line("ml->instance = inst;");
                                              +
                                              2090  printer->fmt_line("ml->global_variables = inst->{};", naming::INST_GLOBAL_MEMBER);
                                              +
                                              2091  printer->fmt_line("ml->global_variables_size = sizeof({});", global_struct());
                                              +
                                              2092  printer->pop_block();
                                              +
                                              2093  printer->add_newline();
                                              +
                                              2094 
                                              +
                                              2095  auto const cast_inst_and_assert_validity = [&]() {
                                              +
                                              2096  printer->fmt_line("auto* const inst = static_cast<{}*>(ml->instance);", instance_struct());
                                              +
                                              2097  printer->add_line("assert(inst);");
                                              +
                                              2098  printer->fmt_line("assert(inst->{});", naming::INST_GLOBAL_MEMBER);
                                              +
                                              2099  printer->fmt_line("assert(inst->{} == &{});",
                                              + +
                                              2101  global_struct_instance());
                                              +
                                              2102  printer->fmt_line("assert(inst->{} == ml->global_variables);", naming::INST_GLOBAL_MEMBER);
                                              +
                                              2103  printer->fmt_line("assert(ml->global_variables_size == sizeof({}));", global_struct());
                                              +
                                              2104  };
                                              +
                                              2105 
                                              +
                                              2106  // Must come before print_instance_struct_copy_to_device and
                                              +
                                              2107  // print_instance_struct_delete_from_device
                                              +
                                              2108  print_instance_struct_transfer_routine_declarations();
                                              +
                                              2109 
                                              +
                                              2110  printer->add_line("// Deallocate the instance structure");
                                              +
                                              2111  printer->fmt_push_block("static void {}(NrnThread* nt, Memb_list* ml, int type)",
                                              + +
                                              2113  cast_inst_and_assert_validity();
                                              +
                                              2114 
                                              +
                                              2115  // delete random streams
                                              +
                                              2116  if (info.random_variables.size()) {
                                              +
                                              2117  printer->add_line("int pnodecount = ml->_nodecount_padded;");
                                              +
                                              2118  printer->add_line("int nodecount = ml->nodecount;");
                                              +
                                              2119  printer->add_line("Datum* indexes = ml->pdata;");
                                              +
                                              2120  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              +
                                              2121  for (const auto& var: info.random_variables) {
                                              +
                                              2122  const auto& name = get_variable_name(var->get_name());
                                              +
                                              2123  printer->fmt_line("nrnran123_deletestream((nrnran123_State*){});", name);
                                              +
                                              2124  }
                                              +
                                              2125  printer->pop_block();
                                              +
                                              2126  }
                                              +
                                              2127  print_instance_struct_delete_from_device();
                                              +
                                              2128  printer->add_multi_line(R"CODE(
                                              +
                                              2129  delete inst;
                                              +
                                              2130  ml->instance = nullptr;
                                              +
                                              2131  ml->global_variables = nullptr;
                                              +
                                              2132  ml->global_variables_size = 0;
                                              +
                                              2133  )CODE");
                                              +
                                              2134  printer->pop_block();
                                              +
                                              2135  printer->add_newline();
                                              +
                                              2136 
                                              +
                                              2137 
                                              +
                                              2138  printer->add_line("/** initialize mechanism instance variables */");
                                              +
                                              2139  printer->push_block("static inline void setup_instance(NrnThread* nt, Memb_list* ml)");
                                              +
                                              2140  cast_inst_and_assert_validity();
                                              +
                                              2141 
                                              +
                                              2142  std::string stride;
                                              +
                                              2143  printer->add_line("int pnodecount = ml->_nodecount_padded;");
                                              +
                                              2144  stride = "*pnodecount";
                                              +
                                              2145 
                                              +
                                              2146  printer->add_line("Datum* indexes = ml->pdata;");
                                              +
                                              2147 
                                              +
                                              2148  auto const float_type = default_float_data_type();
                                              +
                                              2149 
                                              +
                                              2150  int id = 0;
                                              +
                                              2151  std::vector<std::string> ptr_members{naming::INST_GLOBAL_MEMBER};
                                              +
                                              2152  for (auto const& [var, type]: info.neuron_global_variables) {
                                              +
                                              2153  ptr_members.push_back(var->get_name());
                                              +
                                              2154  }
                                              +
                                              2155  ptr_members.reserve(ptr_members.size() + codegen_float_variables.size() +
                                              +
                                              2156  codegen_int_variables.size());
                                              +
                                              2157  for (auto& var: codegen_float_variables) {
                                              +
                                              2158  auto name = var->get_name();
                                              +
                                              2159  auto range_var_type = get_range_var_float_type(var);
                                              +
                                              2160  if (float_type == range_var_type) {
                                              +
                                              2161  auto const variable = fmt::format("ml->data+{}{}", id, stride);
                                              +
                                              2162  printer->fmt_line("inst->{} = {};", name, variable);
                                              +
                                              2163  } else {
                                              +
                                              2164  // TODO what MOD file exercises this?
                                              +
                                              2165  printer->fmt_line("inst->{} = setup_range_variable(ml->data+{}{}, pnodecount);",
                                              +
                                              2166  name,
                                              +
                                              2167  id,
                                              +
                                              2168  stride);
                                              +
                                              2169  }
                                              +
                                              2170  ptr_members.push_back(std::move(name));
                                              +
                                              2171  id += var->get_length();
                                              +
                                              2172  }
                                              +
                                              2173 
                                              +
                                              2174  for (auto& var: codegen_int_variables) {
                                              +
                                              2175  auto name = var.symbol->get_name();
                                              +
                                              2176  auto const variable = [&var]() {
                                              +
                                              2177  if (var.is_index || var.is_integer) {
                                              +
                                              2178  return "ml->pdata";
                                              +
                                              2179  } else if (var.is_vdata) {
                                              +
                                              2180  return "nt->_vdata";
                                              +
                                              2181  } else {
                                              +
                                              2182  return "nt->_data";
                                              +
                                              2183  }
                                              +
                                              2184  }();
                                              +
                                              2185  printer->fmt_line("inst->{} = {};", name, variable);
                                              +
                                              2186  ptr_members.push_back(std::move(name));
                                              +
                                              2187  }
                                              +
                                              2188  print_instance_struct_copy_to_device();
                                              +
                                              2189  printer->pop_block(); // setup_instance
                                              +
                                              2190  printer->add_newline();
                                              +
                                              2191 
                                              +
                                              2192  print_instance_struct_transfer_routines(ptr_members);
                                              +
                                              2193 }
                                              +
                                              2194 
                                              2195 
                                              -
                                              2196  printer->pop_block(";");
                                              -
                                              2197 }
                                              -
                                              2198 
                                              -
                                              2199 
                                              - -
                                              2201  const std::vector<std::string>& members) {
                                              -
                                              2202  // constructor
                                              -
                                              2203  printer->add_newline();
                                              -
                                              2204  printer->add_indent();
                                              -
                                              2205  printer->add_text("IonCurVar() : ");
                                              -
                                              2206  for (int i = 0; i < members.size(); i++) {
                                              -
                                              2207  printer->fmt_text("{}(0)", members[i]);
                                              -
                                              2208  if (i + 1 < members.size()) {
                                              -
                                              2209  printer->add_text(", ");
                                              -
                                              2210  }
                                              -
                                              2211  }
                                              -
                                              2212  printer->add_text(" {}");
                                              -
                                              2213  printer->add_newline();
                                              -
                                              2214 }
                                              -
                                              2215 
                                              -
                                              2216 
                                              - -
                                              2218  printer->add_line("IonCurVar ionvar;");
                                              -
                                              2219 }
                                              -
                                              2220 
                                              -
                                              2221 
                                              - -
                                              2223  // nothing for cpu
                                              -
                                              2224 }
                                              -
                                              2225 
                                              -
                                              2226 
                                              - -
                                              2228  auto type = float_data_type();
                                              -
                                              2229  printer->add_newline(2);
                                              -
                                              2230  printer->add_line("/** allocate and setup array for range variable */");
                                              -
                                              2231  printer->fmt_push_block("static inline {}* setup_range_variable(double* variable, int n)",
                                              -
                                              2232  type);
                                              -
                                              2233  printer->fmt_line("{0}* data = ({0}*) mem_alloc(n, sizeof({0}));", type);
                                              -
                                              2234  printer->push_block("for(size_t i = 0; i < n; i++)");
                                              -
                                              2235  printer->add_line("data[i] = variable[i];");
                                              -
                                              2236  printer->pop_block();
                                              -
                                              2237  printer->add_line("return data;");
                                              -
                                              2238  printer->pop_block();
                                              -
                                              2239 }
                                              -
                                              2240 
                                              -
                                              2241 
                                              -
                                              2242 /**
                                              -
                                              2243  * \details If floating point type like "float" is specified on command line then
                                              -
                                              2244  * we can't turn all variables to new type. This is because certain variables
                                              -
                                              2245  * are pointers to internal variables (e.g. ions). Hence, we check if given
                                              -
                                              2246  * variable can be safely converted to new type. If so, return new type.
                                              -
                                              2247  */
                                              - -
                                              2249  // clang-format off
                                              -
                                              2250  auto with = NmodlType::read_ion_var
                                              -
                                              2251  | NmodlType::write_ion_var
                                              -
                                              2252  | NmodlType::pointer_var
                                              -
                                              2253  | NmodlType::bbcore_pointer_var
                                              -
                                              2254  | NmodlType::extern_neuron_variable;
                                              -
                                              2255  // clang-format on
                                              -
                                              2256  bool need_default_type = symbol->has_any_property(with);
                                              -
                                              2257  if (need_default_type) {
                                              -
                                              2258  return default_float_data_type();
                                              -
                                              2259  }
                                              -
                                              2260  return float_data_type();
                                              -
                                              2261 }
                                              -
                                              2262 
                                              -
                                              2263 
                                              - -
                                              2265  if (range_variable_setup_required()) {
                                              -
                                              2266  print_setup_range_variable();
                                              -
                                              2267  }
                                              -
                                              2268 
                                              -
                                              2269  printer->add_newline();
                                              -
                                              2270  printer->add_line("// Allocate instance structure");
                                              -
                                              2271  printer->fmt_push_block("static void {}(NrnThread* nt, Memb_list* ml, int type)",
                                              - -
                                              2273  printer->add_line("assert(!ml->instance);");
                                              -
                                              2274  printer->add_line("assert(!ml->global_variables);");
                                              -
                                              2275  printer->add_line("assert(ml->global_variables_size == 0);");
                                              -
                                              2276  printer->fmt_line("auto* const inst = new {}{{}};", instance_struct());
                                              -
                                              2277  printer->fmt_line("assert(inst->{} == &{});",
                                              - -
                                              2279  global_struct_instance());
                                              -
                                              2280  printer->add_line("ml->instance = inst;");
                                              -
                                              2281  printer->fmt_line("ml->global_variables = inst->{};", naming::INST_GLOBAL_MEMBER);
                                              -
                                              2282  printer->fmt_line("ml->global_variables_size = sizeof({});", global_struct());
                                              -
                                              2283  printer->pop_block();
                                              -
                                              2284  printer->add_newline();
                                              -
                                              2285 
                                              -
                                              2286  auto const cast_inst_and_assert_validity = [&]() {
                                              -
                                              2287  printer->fmt_line("auto* const inst = static_cast<{}*>(ml->instance);", instance_struct());
                                              -
                                              2288  printer->add_line("assert(inst);");
                                              -
                                              2289  printer->fmt_line("assert(inst->{});", naming::INST_GLOBAL_MEMBER);
                                              -
                                              2290  printer->fmt_line("assert(inst->{} == &{});",
                                              - -
                                              2292  global_struct_instance());
                                              -
                                              2293  printer->fmt_line("assert(inst->{} == ml->global_variables);", naming::INST_GLOBAL_MEMBER);
                                              -
                                              2294  printer->fmt_line("assert(ml->global_variables_size == sizeof({}));", global_struct());
                                              -
                                              2295  };
                                              + +
                                              2197  if (info.artificial_cell) {
                                              +
                                              2198  printer->add_line("double v = 0.0;");
                                              +
                                              2199  } else {
                                              +
                                              2200  printer->add_line("int node_id = node_index[id];");
                                              +
                                              2201  printer->add_line("double v = voltage[node_id];");
                                              +
                                              2202  print_v_unused();
                                              +
                                              2203  }
                                              +
                                              2204 
                                              +
                                              2205  if (ion_variable_struct_required()) {
                                              +
                                              2206  printer->add_line("IonCurVar ionvar;");
                                              +
                                              2207  }
                                              +
                                              2208 
                                              +
                                              2209  // read ion statements
                                              +
                                              2210  auto read_statements = ion_read_statements(BlockType::Initial);
                                              +
                                              2211  for (auto& statement: read_statements) {
                                              +
                                              2212  printer->add_line(statement);
                                              +
                                              2213  }
                                              +
                                              2214 
                                              +
                                              2215  // initialize state variables (excluding ion state)
                                              +
                                              2216  for (auto& var: info.state_vars) {
                                              +
                                              2217  auto name = var->get_name();
                                              +
                                              2218  if (!info.is_ionic_conc(name)) {
                                              +
                                              2219  auto lhs = get_variable_name(name);
                                              +
                                              2220  auto rhs = get_variable_name(name + "0");
                                              +
                                              2221  if (var->is_array()) {
                                              +
                                              2222  for (int i = 0; i < var->get_length(); ++i) {
                                              +
                                              2223  printer->fmt_line("{}[{}] = {};", lhs, i, rhs);
                                              +
                                              2224  }
                                              +
                                              2225  } else {
                                              +
                                              2226  printer->fmt_line("{} = {};", lhs, rhs);
                                              +
                                              2227  }
                                              +
                                              2228  }
                                              +
                                              2229  }
                                              +
                                              2230 
                                              +
                                              2231  // initial block
                                              +
                                              2232  if (node != nullptr) {
                                              +
                                              2233  const auto& block = node->get_statement_block();
                                              +
                                              2234  print_statement_block(*block, false, false);
                                              +
                                              2235  }
                                              +
                                              2236 
                                              +
                                              2237  // write ion statements
                                              +
                                              2238  auto write_statements = ion_write_statements(BlockType::Initial);
                                              +
                                              2239  for (auto& statement: write_statements) {
                                              +
                                              2240  auto text = process_shadow_update_statement(statement, BlockType::Initial);
                                              +
                                              2241  printer->add_line(text);
                                              +
                                              2242  }
                                              +
                                              2243 }
                                              +
                                              2244 
                                              +
                                              2245 
                                              + +
                                              2247  BlockType type,
                                              +
                                              2248  const std::string& function_name) {
                                              +
                                              2249  std::string method;
                                              +
                                              2250  if (function_name.empty()) {
                                              +
                                              2251  method = compute_method_name(type);
                                              +
                                              2252  } else {
                                              +
                                              2253  method = function_name;
                                              +
                                              2254  }
                                              +
                                              2255  auto args = "NrnThread* nt, Memb_list* ml, int type";
                                              +
                                              2256 
                                              +
                                              2257  // watch statement function doesn't have type argument
                                              +
                                              2258  if (type == BlockType::Watch) {
                                              +
                                              2259  args = "NrnThread* nt, Memb_list* ml";
                                              +
                                              2260  }
                                              +
                                              2261 
                                              +
                                              2262  print_global_method_annotation();
                                              +
                                              2263  printer->fmt_push_block("void {}({})", method, args);
                                              +
                                              2264  if (type != BlockType::Destructor && type != BlockType::Constructor) {
                                              +
                                              2265  // We do not (currently) support DESTRUCTOR and CONSTRUCTOR blocks
                                              +
                                              2266  // running anything on the GPU.
                                              +
                                              2267  print_kernel_data_present_annotation_block_begin();
                                              +
                                              2268  } else {
                                              +
                                              2269  /// TODO: Remove this when the code generation is propery done
                                              +
                                              2270  /// Related to https://github.com/BlueBrain/nmodl/issues/692
                                              +
                                              2271  printer->add_line("#ifndef CORENEURON_BUILD");
                                              +
                                              2272  }
                                              +
                                              2273  printer->add_multi_line(R"CODE(
                                              +
                                              2274  int nodecount = ml->nodecount;
                                              +
                                              2275  int pnodecount = ml->_nodecount_padded;
                                              +
                                              2276  const int* node_index = ml->nodeindices;
                                              +
                                              2277  double* data = ml->data;
                                              +
                                              2278  const double* voltage = nt->_actual_v;
                                              +
                                              2279  )CODE");
                                              +
                                              2280 
                                              +
                                              2281  if (type == BlockType::Equation) {
                                              +
                                              2282  printer->add_line("double* vec_rhs = nt->_actual_rhs;");
                                              +
                                              2283  printer->add_line("double* vec_d = nt->_actual_d;");
                                              +
                                              2284  print_rhs_d_shadow_variables();
                                              +
                                              2285  }
                                              +
                                              2286  printer->add_line("Datum* indexes = ml->pdata;");
                                              +
                                              2287  printer->add_line("ThreadDatum* thread = ml->_thread;");
                                              +
                                              2288 
                                              +
                                              2289  if (type == BlockType::Initial) {
                                              +
                                              2290  printer->add_newline();
                                              +
                                              2291  printer->add_line("setup_instance(nt, ml);");
                                              +
                                              2292  }
                                              +
                                              2293  printer->fmt_line("auto* const inst = static_cast<{}*>(ml->instance);", instance_struct());
                                              +
                                              2294  printer->add_newline(1);
                                              +
                                              2295 }
                                              2296 
                                              -
                                              2297  // Must come before print_instance_struct_copy_to_device and
                                              -
                                              2298  // print_instance_struct_delete_from_device
                                              -
                                              2299  print_instance_struct_transfer_routine_declarations();
                                              + +
                                              2298  printer->add_newline(2);
                                              +
                                              2299  printer->add_line("/** initialize channel */");
                                              2300 
                                              -
                                              2301  printer->add_line("// Deallocate the instance structure");
                                              -
                                              2302  printer->fmt_push_block("static void {}(NrnThread* nt, Memb_list* ml, int type)",
                                              - -
                                              2304  cast_inst_and_assert_validity();
                                              -
                                              2305 
                                              -
                                              2306  // delete random streams
                                              -
                                              2307  if (info.random_variables.size()) {
                                              -
                                              2308  printer->add_line("int pnodecount = ml->_nodecount_padded;");
                                              -
                                              2309  printer->add_line("int nodecount = ml->nodecount;");
                                              -
                                              2310  printer->add_line("Datum* indexes = ml->pdata;");
                                              -
                                              2311  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              -
                                              2312  for (const auto& var: info.random_variables) {
                                              -
                                              2313  const auto& name = get_variable_name(var->get_name());
                                              -
                                              2314  printer->fmt_line("nrnran123_deletestream((nrnran123_State*){});", name);
                                              -
                                              2315  }
                                              -
                                              2316  printer->pop_block();
                                              -
                                              2317  }
                                              -
                                              2318  print_instance_struct_delete_from_device();
                                              -
                                              2319  printer->add_multi_line(R"CODE(
                                              -
                                              2320  delete inst;
                                              -
                                              2321  ml->instance = nullptr;
                                              -
                                              2322  ml->global_variables = nullptr;
                                              -
                                              2323  ml->global_variables_size = 0;
                                              -
                                              2324  )CODE");
                                              -
                                              2325  printer->pop_block();
                                              -
                                              2326  printer->add_newline();
                                              -
                                              2327 
                                              -
                                              2328 
                                              -
                                              2329  printer->add_line("/** initialize mechanism instance variables */");
                                              -
                                              2330  printer->push_block("static inline void setup_instance(NrnThread* nt, Memb_list* ml)");
                                              -
                                              2331  cast_inst_and_assert_validity();
                                              -
                                              2332 
                                              -
                                              2333  std::string stride;
                                              -
                                              2334  printer->add_line("int pnodecount = ml->_nodecount_padded;");
                                              -
                                              2335  stride = "*pnodecount";
                                              -
                                              2336 
                                              -
                                              2337  printer->add_line("Datum* indexes = ml->pdata;");
                                              -
                                              2338 
                                              -
                                              2339  auto const float_type = default_float_data_type();
                                              -
                                              2340 
                                              -
                                              2341  int id = 0;
                                              -
                                              2342  std::vector<std::string> ptr_members{naming::INST_GLOBAL_MEMBER};
                                              -
                                              2343  for (auto const& [var, type]: info.neuron_global_variables) {
                                              -
                                              2344  ptr_members.push_back(var->get_name());
                                              +
                                              2301  print_global_function_common_code(BlockType::Initial);
                                              +
                                              2302  if (info.derivimplicit_used()) {
                                              +
                                              2303  printer->add_newline();
                                              +
                                              2304  int nequation = info.num_equations;
                                              +
                                              2305  int list_num = info.derivimplicit_list_num;
                                              +
                                              2306  // clang-format off
                                              +
                                              2307  printer->fmt_line("int& deriv_advance_flag = *deriv{}_advance(thread);", list_num);
                                              +
                                              2308  printer->add_line("deriv_advance_flag = 0;");
                                              +
                                              2309  print_deriv_advance_flag_transfer_to_device();
                                              +
                                              2310  printer->fmt_line("auto ns = newtonspace{}(thread);", list_num);
                                              +
                                              2311  printer->fmt_line("auto& th = thread[dith{}()];", list_num);
                                              +
                                              2312  printer->push_block("if (*ns == nullptr)");
                                              +
                                              2313  printer->fmt_line("int vec_size = 2*{}*pnodecount*sizeof(double);", nequation);
                                              +
                                              2314  printer->fmt_line("double* vec = makevector(vec_size);", nequation);
                                              +
                                              2315  printer->fmt_line("th.pval = vec;", list_num);
                                              +
                                              2316  printer->fmt_line("*ns = nrn_cons_newtonspace({}, pnodecount);", nequation);
                                              +
                                              2317  print_newtonspace_transfer_to_device();
                                              +
                                              2318  printer->pop_block();
                                              +
                                              2319  // clang-format on
                                              +
                                              2320  }
                                              +
                                              2321 
                                              +
                                              2322  // update global variable as those might be updated via python/hoc API
                                              +
                                              2323  // NOTE: CoreNEURON has enough information to do this on its own, which
                                              +
                                              2324  // would be neater.
                                              +
                                              2325  print_global_variable_device_update_annotation();
                                              +
                                              2326 
                                              +
                                              2327  if (skip_init_check) {
                                              +
                                              2328  printer->push_block("if (_nrn_skip_initmodel == 0)");
                                              +
                                              2329  }
                                              +
                                              2330 
                                              +
                                              2331  if (!info.changed_dt.empty()) {
                                              +
                                              2332  printer->fmt_line("double _save_prev_dt = {};",
                                              +
                                              2333  get_variable_name(naming::NTHREAD_DT_VARIABLE));
                                              +
                                              2334  printer->fmt_line("{} = {};",
                                              +
                                              2335  get_variable_name(naming::NTHREAD_DT_VARIABLE),
                                              +
                                              2336  info.changed_dt);
                                              +
                                              2337  print_dt_update_to_device();
                                              +
                                              2338  }
                                              +
                                              2339 
                                              +
                                              2340  print_channel_iteration_block_parallel_hint(BlockType::Initial, info.initial_node);
                                              +
                                              2341  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              +
                                              2342 
                                              +
                                              2343  if (info.net_receive_node != nullptr) {
                                              +
                                              2344  printer->fmt_line("{} = -1e20;", get_variable_name("tsave"));
                                              2345  }
                                              -
                                              2346  ptr_members.reserve(ptr_members.size() + codegen_float_variables.size() +
                                              -
                                              2347  codegen_int_variables.size());
                                              -
                                              2348  for (auto& var: codegen_float_variables) {
                                              -
                                              2349  auto name = var->get_name();
                                              -
                                              2350  auto range_var_type = get_range_var_float_type(var);
                                              -
                                              2351  if (float_type == range_var_type) {
                                              -
                                              2352  auto const variable = fmt::format("ml->data+{}{}", id, stride);
                                              -
                                              2353  printer->fmt_line("inst->{} = {};", name, variable);
                                              -
                                              2354  } else {
                                              -
                                              2355  // TODO what MOD file exercises this?
                                              -
                                              2356  printer->fmt_line("inst->{} = setup_range_variable(ml->data+{}{}, pnodecount);",
                                              -
                                              2357  name,
                                              -
                                              2358  id,
                                              -
                                              2359  stride);
                                              -
                                              2360  }
                                              -
                                              2361  ptr_members.push_back(std::move(name));
                                              -
                                              2362  id += var->get_length();
                                              -
                                              2363  }
                                              -
                                              2364 
                                              -
                                              2365  for (auto& var: codegen_int_variables) {
                                              -
                                              2366  auto name = var.symbol->get_name();
                                              -
                                              2367  auto const variable = [&var]() {
                                              -
                                              2368  if (var.is_index || var.is_integer) {
                                              -
                                              2369  return "ml->pdata";
                                              -
                                              2370  } else if (var.is_vdata) {
                                              -
                                              2371  return "nt->_vdata";
                                              -
                                              2372  } else {
                                              -
                                              2373  return "nt->_data";
                                              -
                                              2374  }
                                              -
                                              2375  }();
                                              -
                                              2376  printer->fmt_line("inst->{} = {};", name, variable);
                                              -
                                              2377  ptr_members.push_back(std::move(name));
                                              -
                                              2378  }
                                              -
                                              2379  print_instance_struct_copy_to_device();
                                              -
                                              2380  printer->pop_block(); // setup_instance
                                              -
                                              2381  printer->add_newline();
                                              -
                                              2382 
                                              -
                                              2383  print_instance_struct_transfer_routines(ptr_members);
                                              -
                                              2384 }
                                              -
                                              2385 
                                              -
                                              2386 
                                              - -
                                              2388  if (info.artificial_cell) {
                                              -
                                              2389  printer->add_line("double v = 0.0;");
                                              -
                                              2390  } else {
                                              -
                                              2391  printer->add_line("int node_id = node_index[id];");
                                              -
                                              2392  printer->add_line("double v = voltage[node_id];");
                                              -
                                              2393  print_v_unused();
                                              -
                                              2394  }
                                              -
                                              2395 
                                              -
                                              2396  if (ion_variable_struct_required()) {
                                              -
                                              2397  printer->add_line("IonCurVar ionvar;");
                                              -
                                              2398  }
                                              -
                                              2399 
                                              -
                                              2400  // read ion statements
                                              -
                                              2401  auto read_statements = ion_read_statements(BlockType::Initial);
                                              -
                                              2402  for (auto& statement: read_statements) {
                                              -
                                              2403  printer->add_line(statement);
                                              -
                                              2404  }
                                              -
                                              2405 
                                              -
                                              2406  // initialize state variables (excluding ion state)
                                              -
                                              2407  for (auto& var: info.state_vars) {
                                              -
                                              2408  auto name = var->get_name();
                                              -
                                              2409  if (!info.is_ionic_conc(name)) {
                                              -
                                              2410  auto lhs = get_variable_name(name);
                                              -
                                              2411  auto rhs = get_variable_name(name + "0");
                                              -
                                              2412  if (var->is_array()) {
                                              -
                                              2413  for (int i = 0; i < var->get_length(); ++i) {
                                              -
                                              2414  printer->fmt_line("{}[{}] = {};", lhs, i, rhs);
                                              -
                                              2415  }
                                              -
                                              2416  } else {
                                              -
                                              2417  printer->fmt_line("{} = {};", lhs, rhs);
                                              -
                                              2418  }
                                              -
                                              2419  }
                                              -
                                              2420  }
                                              -
                                              2421 
                                              -
                                              2422  // initial block
                                              -
                                              2423  if (node != nullptr) {
                                              -
                                              2424  const auto& block = node->get_statement_block();
                                              -
                                              2425  print_statement_block(*block, false, false);
                                              -
                                              2426  }
                                              -
                                              2427 
                                              -
                                              2428  // write ion statements
                                              -
                                              2429  auto write_statements = ion_write_statements(BlockType::Initial);
                                              -
                                              2430  for (auto& statement: write_statements) {
                                              -
                                              2431  auto text = process_shadow_update_statement(statement, BlockType::Initial);
                                              -
                                              2432  printer->add_line(text);
                                              -
                                              2433  }
                                              -
                                              2434 }
                                              -
                                              2435 
                                              +
                                              2346 
                                              +
                                              2347  print_initial_block(info.initial_node);
                                              +
                                              2348  printer->pop_block();
                                              +
                                              2349 
                                              +
                                              2350  if (!info.changed_dt.empty()) {
                                              +
                                              2351  printer->fmt_line("{} = _save_prev_dt;", get_variable_name(naming::NTHREAD_DT_VARIABLE));
                                              +
                                              2352  print_dt_update_to_device();
                                              +
                                              2353  }
                                              +
                                              2354 
                                              +
                                              2355  printer->pop_block();
                                              +
                                              2356 
                                              +
                                              2357  if (info.derivimplicit_used()) {
                                              +
                                              2358  printer->add_line("deriv_advance_flag = 1;");
                                              +
                                              2359  print_deriv_advance_flag_transfer_to_device();
                                              +
                                              2360  }
                                              +
                                              2361 
                                              +
                                              2362  if (info.net_send_used && !info.artificial_cell) {
                                              +
                                              2363  print_send_event_move();
                                              +
                                              2364  }
                                              +
                                              2365 
                                              +
                                              2366  print_kernel_data_present_annotation_block_end();
                                              +
                                              2367  if (skip_init_check) {
                                              +
                                              2368  printer->pop_block();
                                              +
                                              2369  }
                                              +
                                              2370 }
                                              +
                                              2371 
                                              + +
                                              2373  size_t block_id) {
                                              +
                                              2374  std::string ba_type;
                                              +
                                              2375  std::shared_ptr<ast::BABlock> ba_block;
                                              +
                                              2376 
                                              +
                                              2377  if (node->is_before_block()) {
                                              +
                                              2378  ba_block = dynamic_cast<const ast::BeforeBlock*>(node)->get_bablock();
                                              +
                                              2379  ba_type = "BEFORE";
                                              +
                                              2380  } else {
                                              +
                                              2381  ba_block = dynamic_cast<const ast::AfterBlock*>(node)->get_bablock();
                                              +
                                              2382  ba_type = "AFTER";
                                              +
                                              2383  }
                                              +
                                              2384 
                                              +
                                              2385  std::string ba_block_type = ba_block->get_type()->eval();
                                              +
                                              2386 
                                              +
                                              2387  /// name of the before/after function
                                              +
                                              2388  std::string function_name = method_name(fmt::format("nrn_before_after_{}", block_id));
                                              +
                                              2389 
                                              +
                                              2390  /// print common function code like init/state/current
                                              +
                                              2391  printer->add_newline(2);
                                              +
                                              2392  printer->fmt_line("/** {} of block type {} # {} */", ba_type, ba_block_type, block_id);
                                              +
                                              2393  print_global_function_common_code(BlockType::BeforeAfter, function_name);
                                              +
                                              2394 
                                              +
                                              2395  print_channel_iteration_block_parallel_hint(BlockType::BeforeAfter, node);
                                              +
                                              2396  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              +
                                              2397 
                                              +
                                              2398  printer->add_line("int node_id = node_index[id];");
                                              +
                                              2399  printer->add_line("double v = voltage[node_id];");
                                              +
                                              2400  print_v_unused();
                                              +
                                              2401 
                                              +
                                              2402  // read ion statements
                                              +
                                              2403  const auto& read_statements = ion_read_statements(BlockType::Equation);
                                              +
                                              2404  for (auto& statement: read_statements) {
                                              +
                                              2405  printer->add_line(statement);
                                              +
                                              2406  }
                                              +
                                              2407 
                                              +
                                              2408  /// print main body
                                              +
                                              2409  printer->add_indent();
                                              +
                                              2410  print_statement_block(*ba_block->get_statement_block());
                                              +
                                              2411  printer->add_newline();
                                              +
                                              2412 
                                              +
                                              2413  // write ion statements
                                              +
                                              2414  const auto& write_statements = ion_write_statements(BlockType::Equation);
                                              +
                                              2415  for (auto& statement: write_statements) {
                                              +
                                              2416  auto text = process_shadow_update_statement(statement, BlockType::Equation);
                                              +
                                              2417  printer->add_line(text);
                                              +
                                              2418  }
                                              +
                                              2419 
                                              +
                                              2420  /// loop end including data annotation block
                                              +
                                              2421  printer->pop_block();
                                              +
                                              2422  printer->pop_block();
                                              +
                                              2423  print_kernel_data_present_annotation_block_end();
                                              +
                                              2424 }
                                              +
                                              2425 
                                              + +
                                              2427  printer->add_newline(2);
                                              +
                                              2428  print_global_function_common_code(BlockType::Constructor);
                                              +
                                              2429  if (info.constructor_node != nullptr) {
                                              +
                                              2430  const auto& block = info.constructor_node->get_statement_block();
                                              +
                                              2431  print_statement_block(*block, false, false);
                                              +
                                              2432  }
                                              +
                                              2433  printer->add_line("#endif");
                                              +
                                              2434  printer->pop_block();
                                              +
                                              2435 }
                                              2436 
                                              - -
                                              2438  BlockType type,
                                              -
                                              2439  const std::string& function_name) {
                                              -
                                              2440  std::string method;
                                              -
                                              2441  if (function_name.empty()) {
                                              -
                                              2442  method = compute_method_name(type);
                                              -
                                              2443  } else {
                                              -
                                              2444  method = function_name;
                                              -
                                              2445  }
                                              -
                                              2446  auto args = "NrnThread* nt, Memb_list* ml, int type";
                                              -
                                              2447 
                                              -
                                              2448  // watch statement function doesn't have type argument
                                              -
                                              2449  if (type == BlockType::Watch) {
                                              -
                                              2450  args = "NrnThread* nt, Memb_list* ml";
                                              -
                                              2451  }
                                              -
                                              2452 
                                              -
                                              2453  print_global_method_annotation();
                                              -
                                              2454  printer->fmt_push_block("void {}({})", method, args);
                                              -
                                              2455  if (type != BlockType::Destructor && type != BlockType::Constructor) {
                                              -
                                              2456  // We do not (currently) support DESTRUCTOR and CONSTRUCTOR blocks
                                              -
                                              2457  // running anything on the GPU.
                                              -
                                              2458  print_kernel_data_present_annotation_block_begin();
                                              -
                                              2459  } else {
                                              -
                                              2460  /// TODO: Remove this when the code generation is propery done
                                              -
                                              2461  /// Related to https://github.com/BlueBrain/nmodl/issues/692
                                              -
                                              2462  printer->add_line("#ifndef CORENEURON_BUILD");
                                              -
                                              2463  }
                                              -
                                              2464  printer->add_multi_line(R"CODE(
                                              -
                                              2465  int nodecount = ml->nodecount;
                                              -
                                              2466  int pnodecount = ml->_nodecount_padded;
                                              -
                                              2467  const int* node_index = ml->nodeindices;
                                              -
                                              2468  double* data = ml->data;
                                              -
                                              2469  const double* voltage = nt->_actual_v;
                                              -
                                              2470  )CODE");
                                              -
                                              2471 
                                              -
                                              2472  if (type == BlockType::Equation) {
                                              -
                                              2473  printer->add_line("double* vec_rhs = nt->_actual_rhs;");
                                              -
                                              2474  printer->add_line("double* vec_d = nt->_actual_d;");
                                              -
                                              2475  print_rhs_d_shadow_variables();
                                              -
                                              2476  }
                                              -
                                              2477  printer->add_line("Datum* indexes = ml->pdata;");
                                              -
                                              2478  printer->add_line("ThreadDatum* thread = ml->_thread;");
                                              -
                                              2479 
                                              -
                                              2480  if (type == BlockType::Initial) {
                                              -
                                              2481  printer->add_newline();
                                              -
                                              2482  printer->add_line("setup_instance(nt, ml);");
                                              -
                                              2483  }
                                              -
                                              2484  printer->fmt_line("auto* const inst = static_cast<{}*>(ml->instance);", instance_struct());
                                              -
                                              2485  printer->add_newline(1);
                                              -
                                              2486 }
                                              -
                                              2487 
                                              - -
                                              2489  printer->add_newline(2);
                                              -
                                              2490  printer->add_line("/** initialize channel */");
                                              -
                                              2491 
                                              -
                                              2492  print_global_function_common_code(BlockType::Initial);
                                              -
                                              2493  if (info.derivimplicit_used()) {
                                              -
                                              2494  printer->add_newline();
                                              -
                                              2495  int nequation = info.num_equations;
                                              -
                                              2496  int list_num = info.derivimplicit_list_num;
                                              -
                                              2497  // clang-format off
                                              -
                                              2498  printer->fmt_line("int& deriv_advance_flag = *deriv{}_advance(thread);", list_num);
                                              -
                                              2499  printer->add_line("deriv_advance_flag = 0;");
                                              -
                                              2500  print_deriv_advance_flag_transfer_to_device();
                                              -
                                              2501  printer->fmt_line("auto ns = newtonspace{}(thread);", list_num);
                                              -
                                              2502  printer->fmt_line("auto& th = thread[dith{}()];", list_num);
                                              -
                                              2503  printer->push_block("if (*ns == nullptr)");
                                              -
                                              2504  printer->fmt_line("int vec_size = 2*{}*pnodecount*sizeof(double);", nequation);
                                              -
                                              2505  printer->fmt_line("double* vec = makevector(vec_size);", nequation);
                                              -
                                              2506  printer->fmt_line("th.pval = vec;", list_num);
                                              -
                                              2507  printer->fmt_line("*ns = nrn_cons_newtonspace({}, pnodecount);", nequation);
                                              -
                                              2508  print_newtonspace_transfer_to_device();
                                              +
                                              2437 
                                              + +
                                              2439  printer->add_newline(2);
                                              +
                                              2440  print_global_function_common_code(BlockType::Destructor);
                                              +
                                              2441  if (info.destructor_node != nullptr) {
                                              +
                                              2442  const auto& block = info.destructor_node->get_statement_block();
                                              +
                                              2443  print_statement_block(*block, false, false);
                                              +
                                              2444  }
                                              +
                                              2445  printer->add_line("#endif");
                                              +
                                              2446  printer->pop_block();
                                              +
                                              2447 }
                                              +
                                              2448 
                                              +
                                              2449 
                                              + +
                                              2451  for (const auto& functor_name: info.functor_names) {
                                              +
                                              2452  printer->add_newline(2);
                                              +
                                              2453  print_functor_definition(*functor_name.first);
                                              +
                                              2454  }
                                              +
                                              2455 }
                                              +
                                              2456 
                                              +
                                              2457 
                                              + +
                                              2459  printer->add_newline(2);
                                              +
                                              2460  auto method = method_name(naming::NRN_ALLOC_METHOD);
                                              +
                                              2461  printer->fmt_push_block("static void {}(double* data, Datum* indexes, int type)", method);
                                              +
                                              2462  printer->add_line("// do nothing");
                                              +
                                              2463  printer->pop_block();
                                              +
                                              2464 }
                                              +
                                              2465 
                                              +
                                              2466 /**
                                              +
                                              2467  * \todo Number of watch could be more than number of statements
                                              +
                                              2468  * according to grammar. Check if this is correctly handled in neuron
                                              +
                                              2469  * and coreneuron.
                                              +
                                              2470  */
                                              + +
                                              2472  if (info.watch_statements.empty()) {
                                              +
                                              2473  return;
                                              +
                                              2474  }
                                              +
                                              2475 
                                              +
                                              2476  printer->add_newline(2);
                                              +
                                              2477  auto inst = fmt::format("{}* inst", instance_struct());
                                              +
                                              2478 
                                              +
                                              2479  printer->fmt_push_block(
                                              +
                                              2480  "static void nrn_watch_activate({}, int id, int pnodecount, int watch_id, "
                                              +
                                              2481  "double v, bool &watch_remove)",
                                              +
                                              2482  inst);
                                              +
                                              2483 
                                              +
                                              2484  // initialize all variables only during first watch statement
                                              +
                                              2485  printer->push_block("if (watch_remove == false)");
                                              +
                                              2486  for (int i = 0; i < info.watch_count; i++) {
                                              +
                                              2487  auto name = get_variable_name(fmt::format("watch{}", i + 1));
                                              +
                                              2488  printer->fmt_line("{} = 0;", name);
                                              +
                                              2489  }
                                              +
                                              2490  printer->add_line("watch_remove = true;");
                                              +
                                              2491  printer->pop_block();
                                              +
                                              2492 
                                              +
                                              2493  /**
                                              +
                                              2494  * \todo Similar to neuron/coreneuron we are using
                                              +
                                              2495  * first watch and ignoring rest.
                                              +
                                              2496  */
                                              +
                                              2497  for (int i = 0; i < info.watch_statements.size(); i++) {
                                              +
                                              2498  auto statement = info.watch_statements[i];
                                              +
                                              2499  printer->fmt_push_block("if (watch_id == {})", i);
                                              +
                                              2500 
                                              +
                                              2501  auto varname = get_variable_name(fmt::format("watch{}", i + 1));
                                              +
                                              2502  printer->add_indent();
                                              +
                                              2503  printer->fmt_text("{} = 2 + (", varname);
                                              +
                                              2504  auto watch = statement->get_statements().front();
                                              +
                                              2505  watch->get_expression()->visit_children(*this);
                                              +
                                              2506  printer->add_text(");");
                                              +
                                              2507  printer->add_newline();
                                              +
                                              2508 
                                              2509  printer->pop_block();
                                              -
                                              2510  // clang-format on
                                              -
                                              2511  }
                                              -
                                              2512 
                                              -
                                              2513  // update global variable as those might be updated via python/hoc API
                                              -
                                              2514  // NOTE: CoreNEURON has enough information to do this on its own, which
                                              -
                                              2515  // would be neater.
                                              -
                                              2516  print_global_variable_device_update_annotation();
                                              -
                                              2517 
                                              -
                                              2518  if (skip_init_check) {
                                              -
                                              2519  printer->push_block("if (_nrn_skip_initmodel == 0)");
                                              -
                                              2520  }
                                              -
                                              2521 
                                              -
                                              2522  if (!info.changed_dt.empty()) {
                                              -
                                              2523  printer->fmt_line("double _save_prev_dt = {};",
                                              -
                                              2524  get_variable_name(naming::NTHREAD_DT_VARIABLE));
                                              -
                                              2525  printer->fmt_line("{} = {};",
                                              -
                                              2526  get_variable_name(naming::NTHREAD_DT_VARIABLE),
                                              -
                                              2527  info.changed_dt);
                                              -
                                              2528  print_dt_update_to_device();
                                              -
                                              2529  }
                                              -
                                              2530 
                                              -
                                              2531  print_channel_iteration_block_parallel_hint(BlockType::Initial, info.initial_node);
                                              -
                                              2532  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              +
                                              2510  }
                                              +
                                              2511  printer->pop_block();
                                              +
                                              2512 }
                                              +
                                              2513 
                                              +
                                              2514 
                                              +
                                              2515 /**
                                              +
                                              2516  * \todo Similar to print_watch_activate, we are using only
                                              +
                                              2517  * first watch. need to verify with neuron/coreneuron about rest.
                                              +
                                              2518  */
                                              + +
                                              2520  if (info.watch_statements.empty()) {
                                              +
                                              2521  return;
                                              +
                                              2522  }
                                              +
                                              2523 
                                              +
                                              2524  printer->add_newline(2);
                                              +
                                              2525  printer->add_line("/** routine to check watch activation */");
                                              +
                                              2526  print_global_function_common_code(BlockType::Watch);
                                              +
                                              2527 
                                              +
                                              2528  // WATCH statements appears in NET_RECEIVE block and while printing
                                              +
                                              2529  // net_receive function we already check if it contains any MUTEX/PROTECT
                                              +
                                              2530  // constructs. As WATCH is not a top level block but list of statements,
                                              +
                                              2531  // we don't need to have ivdep pragma related check
                                              +
                                              2532  print_channel_iteration_block_parallel_hint(BlockType::Watch, nullptr);
                                              2533 
                                              -
                                              2534  if (info.net_receive_node != nullptr) {
                                              -
                                              2535  printer->fmt_line("{} = -1e20;", get_variable_name("tsave"));
                                              -
                                              2536  }
                                              -
                                              2537 
                                              -
                                              2538  print_initial_block(info.initial_node);
                                              -
                                              2539  printer->pop_block();
                                              -
                                              2540 
                                              -
                                              2541  if (!info.changed_dt.empty()) {
                                              -
                                              2542  printer->fmt_line("{} = _save_prev_dt;", get_variable_name(naming::NTHREAD_DT_VARIABLE));
                                              -
                                              2543  print_dt_update_to_device();
                                              -
                                              2544  }
                                              -
                                              2545 
                                              -
                                              2546  printer->pop_block();
                                              -
                                              2547 
                                              -
                                              2548  if (info.derivimplicit_used()) {
                                              -
                                              2549  printer->add_line("deriv_advance_flag = 1;");
                                              -
                                              2550  print_deriv_advance_flag_transfer_to_device();
                                              -
                                              2551  }
                                              +
                                              2534  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              +
                                              2535 
                                              +
                                              2536  if (info.is_voltage_used_by_watch_statements()) {
                                              +
                                              2537  printer->add_line("int node_id = node_index[id];");
                                              +
                                              2538  printer->add_line("double v = voltage[node_id];");
                                              +
                                              2539  print_v_unused();
                                              +
                                              2540  }
                                              +
                                              2541 
                                              +
                                              2542  // flat to make sure only one WATCH statement can be triggered at a time
                                              +
                                              2543  printer->add_line("bool watch_untriggered = true;");
                                              +
                                              2544 
                                              +
                                              2545  for (int i = 0; i < info.watch_statements.size(); i++) {
                                              +
                                              2546  auto statement = info.watch_statements[i];
                                              +
                                              2547  const auto& watch = statement->get_statements().front();
                                              +
                                              2548  const auto& varname = get_variable_name(fmt::format("watch{}", i + 1));
                                              +
                                              2549 
                                              +
                                              2550  // start block 1
                                              +
                                              2551  printer->fmt_push_block("if ({}&2 && watch_untriggered)", varname);
                                              2552 
                                              -
                                              2553  if (info.net_send_used && !info.artificial_cell) {
                                              -
                                              2554  print_send_event_move();
                                              -
                                              2555  }
                                              -
                                              2556 
                                              -
                                              2557  print_kernel_data_present_annotation_block_end();
                                              -
                                              2558  if (skip_init_check) {
                                              -
                                              2559  printer->pop_block();
                                              -
                                              2560  }
                                              -
                                              2561 }
                                              -
                                              2562 
                                              - -
                                              2564  size_t block_id) {
                                              -
                                              2565  std::string ba_type;
                                              -
                                              2566  std::shared_ptr<ast::BABlock> ba_block;
                                              -
                                              2567 
                                              -
                                              2568  if (node->is_before_block()) {
                                              -
                                              2569  ba_block = dynamic_cast<const ast::BeforeBlock*>(node)->get_bablock();
                                              -
                                              2570  ba_type = "BEFORE";
                                              -
                                              2571  } else {
                                              -
                                              2572  ba_block = dynamic_cast<const ast::AfterBlock*>(node)->get_bablock();
                                              -
                                              2573  ba_type = "AFTER";
                                              -
                                              2574  }
                                              -
                                              2575 
                                              -
                                              2576  std::string ba_block_type = ba_block->get_type()->eval();
                                              -
                                              2577 
                                              -
                                              2578  /// name of the before/after function
                                              -
                                              2579  std::string function_name = method_name(fmt::format("nrn_before_after_{}", block_id));
                                              -
                                              2580 
                                              -
                                              2581  /// print common function code like init/state/current
                                              -
                                              2582  printer->add_newline(2);
                                              -
                                              2583  printer->fmt_line("/** {} of block type {} # {} */", ba_type, ba_block_type, block_id);
                                              -
                                              2584  print_global_function_common_code(BlockType::BeforeAfter, function_name);
                                              -
                                              2585 
                                              -
                                              2586  print_channel_iteration_block_parallel_hint(BlockType::BeforeAfter, node);
                                              -
                                              2587  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              -
                                              2588 
                                              -
                                              2589  printer->add_line("int node_id = node_index[id];");
                                              -
                                              2590  printer->add_line("double v = voltage[node_id];");
                                              -
                                              2591  print_v_unused();
                                              -
                                              2592 
                                              -
                                              2593  // read ion statements
                                              -
                                              2594  const auto& read_statements = ion_read_statements(BlockType::Equation);
                                              -
                                              2595  for (auto& statement: read_statements) {
                                              -
                                              2596  printer->add_line(statement);
                                              -
                                              2597  }
                                              -
                                              2598 
                                              -
                                              2599  /// print main body
                                              -
                                              2600  printer->add_indent();
                                              -
                                              2601  print_statement_block(*ba_block->get_statement_block());
                                              -
                                              2602  printer->add_newline();
                                              -
                                              2603 
                                              -
                                              2604  // write ion statements
                                              -
                                              2605  const auto& write_statements = ion_write_statements(BlockType::Equation);
                                              -
                                              2606  for (auto& statement: write_statements) {
                                              -
                                              2607  auto text = process_shadow_update_statement(statement, BlockType::Equation);
                                              -
                                              2608  printer->add_line(text);
                                              -
                                              2609  }
                                              -
                                              2610 
                                              -
                                              2611  /// loop end including data annotation block
                                              -
                                              2612  printer->pop_block();
                                              -
                                              2613  printer->pop_block();
                                              -
                                              2614  print_kernel_data_present_annotation_block_end();
                                              -
                                              2615 }
                                              +
                                              2553  // start block 2
                                              +
                                              2554  printer->add_indent();
                                              +
                                              2555  printer->add_text("if (");
                                              +
                                              2556  watch->get_expression()->accept(*this);
                                              +
                                              2557  printer->add_text(") {");
                                              +
                                              2558  printer->add_newline();
                                              +
                                              2559  printer->increase_indent();
                                              +
                                              2560 
                                              +
                                              2561  // start block 3
                                              +
                                              2562  printer->fmt_push_block("if (({}&1) == 0)", varname);
                                              +
                                              2563 
                                              +
                                              2564  printer->add_line("watch_untriggered = false;");
                                              +
                                              2565 
                                              +
                                              2566  const auto& tqitem = get_variable_name("tqitem");
                                              +
                                              2567  const auto& point_process = get_variable_name("point_process");
                                              +
                                              2568  printer->add_indent();
                                              +
                                              2569  printer->add_text("net_send_buffering(");
                                              +
                                              2570  const auto& t = get_variable_name("t");
                                              +
                                              2571  printer->fmt_text("nt, ml->_net_send_buffer, 0, {}, -1, {}, {}+0.0, ",
                                              +
                                              2572  tqitem,
                                              +
                                              2573  point_process,
                                              +
                                              2574  t);
                                              +
                                              2575  watch->get_value()->accept(*this);
                                              +
                                              2576  printer->add_text(");");
                                              +
                                              2577  printer->add_newline();
                                              +
                                              2578  printer->pop_block();
                                              +
                                              2579 
                                              +
                                              2580  printer->add_line(varname, " = 3;");
                                              +
                                              2581  // end block 3
                                              +
                                              2582 
                                              +
                                              2583  // start block 3
                                              +
                                              2584  printer->decrease_indent();
                                              +
                                              2585  printer->push_block("} else");
                                              +
                                              2586  printer->add_line(varname, " = 2;");
                                              +
                                              2587  printer->pop_block();
                                              +
                                              2588  // end block 3
                                              +
                                              2589 
                                              +
                                              2590  printer->pop_block();
                                              +
                                              2591  // end block 1
                                              +
                                              2592  }
                                              +
                                              2593 
                                              +
                                              2594  printer->pop_block();
                                              +
                                              2595  print_send_event_move();
                                              +
                                              2596  print_kernel_data_present_annotation_block_end();
                                              +
                                              2597  printer->pop_block();
                                              +
                                              2598 }
                                              +
                                              2599 
                                              +
                                              2600 
                                              + +
                                              2602  bool need_mech_inst) {
                                              +
                                              2603  printer->add_multi_line(R"CODE(
                                              +
                                              2604  int tid = pnt->_tid;
                                              +
                                              2605  int id = pnt->_i_instance;
                                              +
                                              2606  double v = 0;
                                              +
                                              2607  )CODE");
                                              +
                                              2608 
                                              +
                                              2609  if (info.artificial_cell || node.is_initial_block()) {
                                              +
                                              2610  printer->add_line("NrnThread* nt = nrn_threads + tid;");
                                              +
                                              2611  printer->add_line("Memb_list* ml = nt->_ml_list[pnt->_type];");
                                              +
                                              2612  }
                                              +
                                              2613  if (node.is_initial_block()) {
                                              +
                                              2614  print_kernel_data_present_annotation_block_begin();
                                              +
                                              2615  }
                                              2616 
                                              - -
                                              2618  printer->add_newline(2);
                                              -
                                              2619  print_global_function_common_code(BlockType::Constructor);
                                              -
                                              2620  if (info.constructor_node != nullptr) {
                                              -
                                              2621  const auto& block = info.constructor_node->get_statement_block();
                                              -
                                              2622  print_statement_block(*block, false, false);
                                              -
                                              2623  }
                                              -
                                              2624  printer->add_line("#endif");
                                              -
                                              2625  printer->pop_block();
                                              -
                                              2626 }
                                              -
                                              2627 
                                              +
                                              2617  printer->add_multi_line(R"CODE(
                                              +
                                              2618  int nodecount = ml->nodecount;
                                              +
                                              2619  int pnodecount = ml->_nodecount_padded;
                                              +
                                              2620  double* data = ml->data;
                                              +
                                              2621  double* weights = nt->weights;
                                              +
                                              2622  Datum* indexes = ml->pdata;
                                              +
                                              2623  ThreadDatum* thread = ml->_thread;
                                              +
                                              2624  )CODE");
                                              +
                                              2625  if (need_mech_inst) {
                                              +
                                              2626  printer->fmt_line("auto* const inst = static_cast<{0}*>(ml->instance);", instance_struct());
                                              +
                                              2627  }
                                              2628 
                                              - -
                                              2630  printer->add_newline(2);
                                              -
                                              2631  print_global_function_common_code(BlockType::Destructor);
                                              -
                                              2632  if (info.destructor_node != nullptr) {
                                              -
                                              2633  const auto& block = info.destructor_node->get_statement_block();
                                              -
                                              2634  print_statement_block(*block, false, false);
                                              -
                                              2635  }
                                              -
                                              2636  printer->add_line("#endif");
                                              -
                                              2637  printer->pop_block();
                                              -
                                              2638 }
                                              -
                                              2639 
                                              -
                                              2640 
                                              - -
                                              2642  for (const auto& functor_name: info.functor_names) {
                                              -
                                              2643  printer->add_newline(2);
                                              -
                                              2644  print_functor_definition(*functor_name.first);
                                              -
                                              2645  }
                                              -
                                              2646 }
                                              -
                                              2647 
                                              -
                                              2648 
                                              - -
                                              2650  printer->add_newline(2);
                                              -
                                              2651  auto method = method_name(naming::NRN_ALLOC_METHOD);
                                              -
                                              2652  printer->fmt_push_block("static void {}(double* data, Datum* indexes, int type)", method);
                                              -
                                              2653  printer->add_line("// do nothing");
                                              -
                                              2654  printer->pop_block();
                                              -
                                              2655 }
                                              -
                                              2656 
                                              -
                                              2657 /**
                                              -
                                              2658  * \todo Number of watch could be more than number of statements
                                              -
                                              2659  * according to grammar. Check if this is correctly handled in neuron
                                              -
                                              2660  * and coreneuron.
                                              -
                                              2661  */
                                              - -
                                              2663  if (info.watch_statements.empty()) {
                                              -
                                              2664  return;
                                              -
                                              2665  }
                                              -
                                              2666 
                                              -
                                              2667  printer->add_newline(2);
                                              -
                                              2668  auto inst = fmt::format("{}* inst", instance_struct());
                                              -
                                              2669 
                                              -
                                              2670  printer->fmt_push_block(
                                              -
                                              2671  "static void nrn_watch_activate({}, int id, int pnodecount, int watch_id, "
                                              -
                                              2672  "double v, bool &watch_remove)",
                                              -
                                              2673  inst);
                                              -
                                              2674 
                                              -
                                              2675  // initialize all variables only during first watch statement
                                              -
                                              2676  printer->push_block("if (watch_remove == false)");
                                              -
                                              2677  for (int i = 0; i < info.watch_count; i++) {
                                              -
                                              2678  auto name = get_variable_name(fmt::format("watch{}", i + 1));
                                              -
                                              2679  printer->fmt_line("{} = 0;", name);
                                              -
                                              2680  }
                                              -
                                              2681  printer->add_line("watch_remove = true;");
                                              -
                                              2682  printer->pop_block();
                                              -
                                              2683 
                                              -
                                              2684  /**
                                              -
                                              2685  * \todo Similar to neuron/coreneuron we are using
                                              -
                                              2686  * first watch and ignoring rest.
                                              -
                                              2687  */
                                              -
                                              2688  for (int i = 0; i < info.watch_statements.size(); i++) {
                                              -
                                              2689  auto statement = info.watch_statements[i];
                                              -
                                              2690  printer->fmt_push_block("if (watch_id == {})", i);
                                              -
                                              2691 
                                              -
                                              2692  auto varname = get_variable_name(fmt::format("watch{}", i + 1));
                                              -
                                              2693  printer->add_indent();
                                              -
                                              2694  printer->fmt_text("{} = 2 + (", varname);
                                              -
                                              2695  auto watch = statement->get_statements().front();
                                              -
                                              2696  watch->get_expression()->visit_children(*this);
                                              -
                                              2697  printer->add_text(");");
                                              -
                                              2698  printer->add_newline();
                                              -
                                              2699 
                                              -
                                              2700  printer->pop_block();
                                              -
                                              2701  }
                                              -
                                              2702  printer->pop_block();
                                              -
                                              2703 }
                                              -
                                              2704 
                                              -
                                              2705 
                                              -
                                              2706 /**
                                              -
                                              2707  * \todo Similar to print_watch_activate, we are using only
                                              -
                                              2708  * first watch. need to verify with neuron/coreneuron about rest.
                                              -
                                              2709  */
                                              - -
                                              2711  if (info.watch_statements.empty()) {
                                              -
                                              2712  return;
                                              -
                                              2713  }
                                              -
                                              2714 
                                              -
                                              2715  printer->add_newline(2);
                                              -
                                              2716  printer->add_line("/** routine to check watch activation */");
                                              -
                                              2717  print_global_function_common_code(BlockType::Watch);
                                              -
                                              2718 
                                              -
                                              2719  // WATCH statements appears in NET_RECEIVE block and while printing
                                              -
                                              2720  // net_receive function we already check if it contains any MUTEX/PROTECT
                                              -
                                              2721  // constructs. As WATCH is not a top level block but list of statements,
                                              -
                                              2722  // we don't need to have ivdep pragma related check
                                              -
                                              2723  print_channel_iteration_block_parallel_hint(BlockType::Watch, nullptr);
                                              -
                                              2724 
                                              -
                                              2725  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              -
                                              2726 
                                              -
                                              2727  if (info.is_voltage_used_by_watch_statements()) {
                                              -
                                              2728  printer->add_line("int node_id = node_index[id];");
                                              -
                                              2729  printer->add_line("double v = voltage[node_id];");
                                              -
                                              2730  print_v_unused();
                                              -
                                              2731  }
                                              -
                                              2732 
                                              -
                                              2733  // flat to make sure only one WATCH statement can be triggered at a time
                                              -
                                              2734  printer->add_line("bool watch_untriggered = true;");
                                              -
                                              2735 
                                              -
                                              2736  for (int i = 0; i < info.watch_statements.size(); i++) {
                                              -
                                              2737  auto statement = info.watch_statements[i];
                                              -
                                              2738  const auto& watch = statement->get_statements().front();
                                              -
                                              2739  const auto& varname = get_variable_name(fmt::format("watch{}", i + 1));
                                              -
                                              2740 
                                              -
                                              2741  // start block 1
                                              -
                                              2742  printer->fmt_push_block("if ({}&2 && watch_untriggered)", varname);
                                              -
                                              2743 
                                              -
                                              2744  // start block 2
                                              -
                                              2745  printer->add_indent();
                                              -
                                              2746  printer->add_text("if (");
                                              -
                                              2747  watch->get_expression()->accept(*this);
                                              -
                                              2748  printer->add_text(") {");
                                              -
                                              2749  printer->add_newline();
                                              -
                                              2750  printer->increase_indent();
                                              -
                                              2751 
                                              -
                                              2752  // start block 3
                                              -
                                              2753  printer->fmt_push_block("if (({}&1) == 0)", varname);
                                              -
                                              2754 
                                              -
                                              2755  printer->add_line("watch_untriggered = false;");
                                              -
                                              2756 
                                              -
                                              2757  const auto& tqitem = get_variable_name("tqitem");
                                              -
                                              2758  const auto& point_process = get_variable_name("point_process");
                                              -
                                              2759  printer->add_indent();
                                              -
                                              2760  printer->add_text("net_send_buffering(");
                                              -
                                              2761  const auto& t = get_variable_name("t");
                                              -
                                              2762  printer->fmt_text("nt, ml->_net_send_buffer, 0, {}, -1, {}, {}+0.0, ",
                                              -
                                              2763  tqitem,
                                              -
                                              2764  point_process,
                                              -
                                              2765  t);
                                              -
                                              2766  watch->get_value()->accept(*this);
                                              -
                                              2767  printer->add_text(");");
                                              -
                                              2768  printer->add_newline();
                                              -
                                              2769  printer->pop_block();
                                              -
                                              2770 
                                              -
                                              2771  printer->add_line(varname, " = 3;");
                                              -
                                              2772  // end block 3
                                              -
                                              2773 
                                              -
                                              2774  // start block 3
                                              -
                                              2775  printer->decrease_indent();
                                              -
                                              2776  printer->push_block("} else");
                                              -
                                              2777  printer->add_line(varname, " = 2;");
                                              -
                                              2778  printer->pop_block();
                                              -
                                              2779  // end block 3
                                              -
                                              2780 
                                              -
                                              2781  printer->pop_block();
                                              -
                                              2782  // end block 1
                                              -
                                              2783  }
                                              -
                                              2784 
                                              -
                                              2785  printer->pop_block();
                                              -
                                              2786  print_send_event_move();
                                              -
                                              2787  print_kernel_data_present_annotation_block_end();
                                              -
                                              2788  printer->pop_block();
                                              -
                                              2789 }
                                              -
                                              2790 
                                              -
                                              2791 
                                              - -
                                              2793  bool need_mech_inst) {
                                              -
                                              2794  printer->add_multi_line(R"CODE(
                                              -
                                              2795  int tid = pnt->_tid;
                                              -
                                              2796  int id = pnt->_i_instance;
                                              -
                                              2797  double v = 0;
                                              -
                                              2798  )CODE");
                                              -
                                              2799 
                                              -
                                              2800  if (info.artificial_cell || node.is_initial_block()) {
                                              -
                                              2801  printer->add_line("NrnThread* nt = nrn_threads + tid;");
                                              -
                                              2802  printer->add_line("Memb_list* ml = nt->_ml_list[pnt->_type];");
                                              -
                                              2803  }
                                              -
                                              2804  if (node.is_initial_block()) {
                                              -
                                              2805  print_kernel_data_present_annotation_block_begin();
                                              -
                                              2806  }
                                              -
                                              2807 
                                              -
                                              2808  printer->add_multi_line(R"CODE(
                                              -
                                              2809  int nodecount = ml->nodecount;
                                              -
                                              2810  int pnodecount = ml->_nodecount_padded;
                                              -
                                              2811  double* data = ml->data;
                                              -
                                              2812  double* weights = nt->weights;
                                              -
                                              2813  Datum* indexes = ml->pdata;
                                              -
                                              2814  ThreadDatum* thread = ml->_thread;
                                              -
                                              2815  )CODE");
                                              -
                                              2816  if (need_mech_inst) {
                                              -
                                              2817  printer->fmt_line("auto* const inst = static_cast<{0}*>(ml->instance);", instance_struct());
                                              -
                                              2818  }
                                              +
                                              2629  if (node.is_initial_block()) {
                                              +
                                              2630  print_net_init_acc_serial_annotation_block_begin();
                                              +
                                              2631  }
                                              +
                                              2632 
                                              +
                                              2633  // rename variables but need to see if they are actually used
                                              +
                                              2634  auto parameters = info.net_receive_node->get_parameters();
                                              +
                                              2635  if (!parameters.empty()) {
                                              +
                                              2636  int i = 0;
                                              +
                                              2637  printer->add_newline();
                                              +
                                              2638  for (auto& parameter: parameters) {
                                              +
                                              2639  auto name = parameter->get_node_name();
                                              +
                                              2640  bool var_used = VarUsageVisitor().variable_used(node, "(*" + name + ")");
                                              +
                                              2641  if (var_used) {
                                              +
                                              2642  printer->fmt_line("double* {} = weights + weight_index + {};", name, i);
                                              +
                                              2643  RenameVisitor vr(name, "*" + name);
                                              +
                                              2644  node.visit_children(vr);
                                              +
                                              2645  }
                                              +
                                              2646  i++;
                                              +
                                              2647  }
                                              +
                                              2648  }
                                              +
                                              2649 }
                                              +
                                              2650 
                                              +
                                              2651 
                                              + +
                                              2653  auto const& arguments = node.get_arguments();
                                              +
                                              2654  const auto& tqitem = get_variable_name("tqitem");
                                              +
                                              2655  std::string weight_index = "weight_index";
                                              +
                                              2656  std::string pnt = "pnt";
                                              +
                                              2657 
                                              +
                                              2658  // for functions not generated from NET_RECEIVE blocks (i.e. top level INITIAL block)
                                              +
                                              2659  // the weight_index argument is 0.
                                              +
                                              2660  if (!printing_net_receive && !printing_net_init) {
                                              +
                                              2661  weight_index = "0";
                                              +
                                              2662  auto var = get_variable_name("point_process");
                                              +
                                              2663  if (info.artificial_cell) {
                                              +
                                              2664  pnt = "(Point_process*)" + var;
                                              +
                                              2665  }
                                              +
                                              2666  }
                                              +
                                              2667 
                                              +
                                              2668  // artificial cells don't use spike buffering
                                              +
                                              2669  // clang-format off
                                              +
                                              2670  if (info.artificial_cell) {
                                              +
                                              2671  printer->fmt_text("artcell_net_send(&{}, {}, {}, nt->_t+", tqitem, weight_index, pnt);
                                              +
                                              2672  } else {
                                              +
                                              2673  const auto& point_process = get_variable_name("point_process");
                                              +
                                              2674  const auto& t = get_variable_name("t");
                                              +
                                              2675  printer->add_text("net_send_buffering(");
                                              +
                                              2676  printer->fmt_text("nt, ml->_net_send_buffer, 0, {}, {}, {}, {}+", tqitem, weight_index, point_process, t);
                                              +
                                              2677  }
                                              +
                                              2678  // clang-format off
                                              +
                                              2679  print_vector_elements(arguments, ", ");
                                              +
                                              2680  printer->add_text(')');
                                              +
                                              2681 }
                                              +
                                              2682 
                                              +
                                              2683 
                                              + +
                                              2685  if (!printing_net_receive && !printing_net_init) {
                                              +
                                              2686  throw std::runtime_error("Error : net_move only allowed in NET_RECEIVE block");
                                              +
                                              2687  }
                                              +
                                              2688 
                                              +
                                              2689  auto const& arguments = node.get_arguments();
                                              +
                                              2690  const auto& tqitem = get_variable_name("tqitem");
                                              +
                                              2691  std::string weight_index = "-1";
                                              +
                                              2692  std::string pnt = "pnt";
                                              +
                                              2693 
                                              +
                                              2694  // artificial cells don't use spike buffering
                                              +
                                              2695  // clang-format off
                                              +
                                              2696  if (info.artificial_cell) {
                                              +
                                              2697  printer->fmt_text("artcell_net_move(&{}, {}, ", tqitem, pnt);
                                              +
                                              2698  print_vector_elements(arguments, ", ");
                                              +
                                              2699  printer->add_text(")");
                                              +
                                              2700  } else {
                                              +
                                              2701  const auto& point_process = get_variable_name("point_process");
                                              +
                                              2702  printer->add_text("net_send_buffering(");
                                              +
                                              2703  printer->fmt_text("nt, ml->_net_send_buffer, 2, {}, {}, {}, ", tqitem, weight_index, point_process);
                                              +
                                              2704  print_vector_elements(arguments, ", ");
                                              +
                                              2705  printer->add_text(", 0.0");
                                              +
                                              2706  printer->add_text(")");
                                              +
                                              2707  }
                                              +
                                              2708 }
                                              +
                                              2709 
                                              +
                                              2710 
                                              + +
                                              2712  const auto& arguments = node.get_arguments();
                                              +
                                              2713  if (info.artificial_cell) {
                                              +
                                              2714  printer->add_text("net_event(pnt, ");
                                              +
                                              2715  print_vector_elements(arguments, ", ");
                                              +
                                              2716  } else {
                                              +
                                              2717  const auto& point_process = get_variable_name("point_process");
                                              +
                                              2718  printer->add_text("net_send_buffering(");
                                              +
                                              2719  printer->fmt_text("nt, ml->_net_send_buffer, 1, -1, -1, {}, ", point_process);
                                              +
                                              2720  print_vector_elements(arguments, ", ");
                                              +
                                              2721  printer->add_text(", 0.0");
                                              +
                                              2722  }
                                              +
                                              2723  printer->add_text(")");
                                              +
                                              2724 }
                                              +
                                              2725 
                                              +
                                              2726 /**
                                              +
                                              2727  * Rename arguments to NET_RECEIVE block with corresponding pointer variable
                                              +
                                              2728  *
                                              +
                                              2729  * Arguments to NET_RECEIVE block are packed and passed via weight vector. These
                                              +
                                              2730  * variables need to be replaced with corresponding pointer variable. For example,
                                              +
                                              2731  * if mod file is like
                                              +
                                              2732  *
                                              +
                                              2733  * \code{.mod}
                                              +
                                              2734  * NET_RECEIVE (weight, R){
                                              +
                                              2735  * INITIAL {
                                              +
                                              2736  * R=1
                                              +
                                              2737  * }
                                              +
                                              2738  * }
                                              +
                                              2739  * \endcode
                                              +
                                              2740  *
                                              +
                                              2741  * then generated code for initial block should be:
                                              +
                                              2742  *
                                              +
                                              2743  * \code{.cpp}
                                              +
                                              2744  * double* R = weights + weight_index + 0;
                                              +
                                              2745  * (*R) = 1.0;
                                              +
                                              2746  * \endcode
                                              +
                                              2747  *
                                              +
                                              2748  * So, the `R` in AST needs to be renamed with `(*R)`.
                                              +
                                              2749  */
                                              +
                                              2750 static void rename_net_receive_arguments(const ast::NetReceiveBlock& net_receive_node, const ast::Node& node) {
                                              +
                                              2751  const auto& parameters = net_receive_node.get_parameters();
                                              +
                                              2752  for (auto& parameter: parameters) {
                                              +
                                              2753  const auto& name = parameter->get_node_name();
                                              +
                                              2754  auto var_used = VarUsageVisitor().variable_used(node, name);
                                              +
                                              2755  if (var_used) {
                                              +
                                              2756  RenameVisitor vr(name, "(*" + name + ")");
                                              +
                                              2757  node.get_statement_block()->visit_children(vr);
                                              +
                                              2758  }
                                              +
                                              2759  }
                                              +
                                              2760 }
                                              +
                                              2761 
                                              +
                                              2762 
                                              + +
                                              2764  const auto node = info.net_receive_initial_node;
                                              +
                                              2765  if (node == nullptr) {
                                              +
                                              2766  return;
                                              +
                                              2767  }
                                              +
                                              2768 
                                              +
                                              2769  // rename net_receive arguments used in the initial block of net_receive
                                              +
                                              2770  rename_net_receive_arguments(*info.net_receive_node, *node);
                                              +
                                              2771 
                                              +
                                              2772  printing_net_init = true;
                                              +
                                              2773  auto args = "Point_process* pnt, int weight_index, double flag";
                                              +
                                              2774  printer->add_newline(2);
                                              +
                                              2775  printer->add_line("/** initialize block for net receive */");
                                              +
                                              2776  printer->fmt_push_block("static void net_init({})", args);
                                              +
                                              2777  auto block = node->get_statement_block().get();
                                              +
                                              2778  if (block->get_statements().empty()) {
                                              +
                                              2779  printer->add_line("// do nothing");
                                              +
                                              2780  } else {
                                              +
                                              2781  print_net_receive_common_code(*node);
                                              +
                                              2782  print_statement_block(*block, false, false);
                                              +
                                              2783  if (node->is_initial_block()) {
                                              +
                                              2784  print_net_init_acc_serial_annotation_block_end();
                                              +
                                              2785  print_kernel_data_present_annotation_block_end();
                                              +
                                              2786  printer->add_line("auto& nsb = ml->_net_send_buffer;");
                                              +
                                              2787  print_net_send_buf_update_to_host();
                                              +
                                              2788  }
                                              +
                                              2789  }
                                              +
                                              2790  printer->pop_block();
                                              +
                                              2791  printing_net_init = false;
                                              +
                                              2792 }
                                              +
                                              2793 
                                              +
                                              2794 
                                              + +
                                              2796  printer->add_newline();
                                              +
                                              2797  printer->add_line("NetSendBuffer_t* nsb = ml->_net_send_buffer;");
                                              +
                                              2798  print_net_send_buf_update_to_host();
                                              +
                                              2799  printer->push_block("for (int i=0; i < nsb->_cnt; i++)");
                                              +
                                              2800  printer->add_multi_line(R"CODE(
                                              +
                                              2801  int type = nsb->_sendtype[i];
                                              +
                                              2802  int tid = nt->id;
                                              +
                                              2803  double t = nsb->_nsb_t[i];
                                              +
                                              2804  double flag = nsb->_nsb_flag[i];
                                              +
                                              2805  int vdata_index = nsb->_vdata_index[i];
                                              +
                                              2806  int weight_index = nsb->_weight_index[i];
                                              +
                                              2807  int point_index = nsb->_pnt_index[i];
                                              +
                                              2808  net_sem_from_gpu(type, vdata_index, weight_index, tid, point_index, t, flag);
                                              +
                                              2809  )CODE");
                                              +
                                              2810  printer->pop_block();
                                              +
                                              2811  printer->add_line("nsb->_cnt = 0;");
                                              +
                                              2812  print_net_send_buf_count_update_to_device();
                                              +
                                              2813 }
                                              +
                                              2814 
                                              +
                                              2815 
                                              + +
                                              2817  return fmt::format("void {}(NrnThread* nt)", method_name("net_buf_receive"));
                                              +
                                              2818 }
                                              2819 
                                              -
                                              2820  if (node.is_initial_block()) {
                                              -
                                              2821  print_net_init_acc_serial_annotation_block_begin();
                                              -
                                              2822  }
                                              -
                                              2823 
                                              -
                                              2824  // rename variables but need to see if they are actually used
                                              -
                                              2825  auto parameters = info.net_receive_node->get_parameters();
                                              -
                                              2826  if (!parameters.empty()) {
                                              -
                                              2827  int i = 0;
                                              -
                                              2828  printer->add_newline();
                                              -
                                              2829  for (auto& parameter: parameters) {
                                              -
                                              2830  auto name = parameter->get_node_name();
                                              -
                                              2831  bool var_used = VarUsageVisitor().variable_used(node, "(*" + name + ")");
                                              -
                                              2832  if (var_used) {
                                              -
                                              2833  printer->fmt_line("double* {} = weights + weight_index + {};", name, i);
                                              -
                                              2834  RenameVisitor vr(name, "*" + name);
                                              -
                                              2835  node.visit_children(vr);
                                              -
                                              2836  }
                                              -
                                              2837  i++;
                                              -
                                              2838  }
                                              -
                                              2839  }
                                              -
                                              2840 }
                                              +
                                              2820 
                                              + +
                                              2822  printer->add_line("Memb_list* ml = get_memb_list(nt);");
                                              +
                                              2823  printer->push_block("if (!ml)");
                                              +
                                              2824  printer->add_line("return;");
                                              +
                                              2825  printer->pop_block();
                                              +
                                              2826  printer->add_newline();
                                              +
                                              2827 }
                                              +
                                              2828 
                                              +
                                              2829 
                                              + +
                                              2831  printer->add_line("int count = nrb->_displ_cnt;");
                                              +
                                              2832  print_channel_iteration_block_parallel_hint(BlockType::NetReceive, info.net_receive_node);
                                              +
                                              2833  printer->push_block("for (int i = 0; i < count; i++)");
                                              +
                                              2834 }
                                              +
                                              2835 
                                              +
                                              2836 
                                              + +
                                              2838  printer->pop_block();
                                              +
                                              2839 }
                                              +
                                              2840 
                                              2841 
                                              -
                                              2842 
                                              - -
                                              2844  auto const& arguments = node.get_arguments();
                                              -
                                              2845  const auto& tqitem = get_variable_name("tqitem");
                                              -
                                              2846  std::string weight_index = "weight_index";
                                              -
                                              2847  std::string pnt = "pnt";
                                              + +
                                              2843  if (!net_receive_required() || info.artificial_cell) {
                                              +
                                              2844  return;
                                              +
                                              2845  }
                                              +
                                              2846  printer->add_newline(2);
                                              +
                                              2847  printer->push_block(net_receive_buffering_declaration());
                                              2848 
                                              -
                                              2849  // for functions not generated from NET_RECEIVE blocks (i.e. top level INITIAL block)
                                              -
                                              2850  // the weight_index argument is 0.
                                              -
                                              2851  if (!printing_net_receive && !printing_net_init) {
                                              -
                                              2852  weight_index = "0";
                                              -
                                              2853  auto var = get_variable_name("point_process");
                                              -
                                              2854  if (info.artificial_cell) {
                                              -
                                              2855  pnt = "(Point_process*)" + var;
                                              -
                                              2856  }
                                              -
                                              2857  }
                                              -
                                              2858 
                                              -
                                              2859  // artificial cells don't use spike buffering
                                              -
                                              2860  // clang-format off
                                              -
                                              2861  if (info.artificial_cell) {
                                              -
                                              2862  printer->fmt_text("artcell_net_send(&{}, {}, {}, nt->_t+", tqitem, weight_index, pnt);
                                              -
                                              2863  } else {
                                              -
                                              2864  const auto& point_process = get_variable_name("point_process");
                                              -
                                              2865  const auto& t = get_variable_name("t");
                                              -
                                              2866  printer->add_text("net_send_buffering(");
                                              -
                                              2867  printer->fmt_text("nt, ml->_net_send_buffer, 0, {}, {}, {}, {}+", tqitem, weight_index, point_process, t);
                                              -
                                              2868  }
                                              -
                                              2869  // clang-format off
                                              -
                                              2870  print_vector_elements(arguments, ", ");
                                              -
                                              2871  printer->add_text(')');
                                              -
                                              2872 }
                                              -
                                              2873 
                                              +
                                              2849  print_get_memb_list();
                                              +
                                              2850 
                                              +
                                              2851  const auto& net_receive = method_name("net_receive_kernel");
                                              +
                                              2852 
                                              +
                                              2853  print_kernel_data_present_annotation_block_begin();
                                              +
                                              2854 
                                              +
                                              2855  printer->add_line("NetReceiveBuffer_t* nrb = ml->_net_receive_buffer;");
                                              +
                                              2856  if (need_mech_inst) {
                                              +
                                              2857  printer->fmt_line("auto* const inst = static_cast<{0}*>(ml->instance);", instance_struct());
                                              +
                                              2858  }
                                              +
                                              2859  print_net_receive_loop_begin();
                                              +
                                              2860  printer->add_line("int start = nrb->_displ[i];");
                                              +
                                              2861  printer->add_line("int end = nrb->_displ[i+1];");
                                              +
                                              2862  printer->push_block("for (int j = start; j < end; j++)");
                                              +
                                              2863  printer->add_multi_line(R"CODE(
                                              +
                                              2864  int index = nrb->_nrb_index[j];
                                              +
                                              2865  int offset = nrb->_pnt_index[index];
                                              +
                                              2866  double t = nrb->_nrb_t[index];
                                              +
                                              2867  int weight_index = nrb->_weight_index[index];
                                              +
                                              2868  double flag = nrb->_nrb_flag[index];
                                              +
                                              2869  Point_process* point_process = nt->pntprocs + offset;
                                              +
                                              2870  )CODE");
                                              +
                                              2871  printer->add_line(net_receive, "(t, point_process, inst, nt, ml, weight_index, flag);");
                                              +
                                              2872  printer->pop_block();
                                              +
                                              2873  print_net_receive_loop_end();
                                              2874 
                                              - -
                                              2876  if (!printing_net_receive && !printing_net_init) {
                                              -
                                              2877  throw std::runtime_error("Error : net_move only allowed in NET_RECEIVE block");
                                              -
                                              2878  }
                                              -
                                              2879 
                                              -
                                              2880  auto const& arguments = node.get_arguments();
                                              -
                                              2881  const auto& tqitem = get_variable_name("tqitem");
                                              -
                                              2882  std::string weight_index = "-1";
                                              -
                                              2883  std::string pnt = "pnt";
                                              -
                                              2884 
                                              -
                                              2885  // artificial cells don't use spike buffering
                                              -
                                              2886  // clang-format off
                                              -
                                              2887  if (info.artificial_cell) {
                                              -
                                              2888  printer->fmt_text("artcell_net_move(&{}, {}, ", tqitem, pnt);
                                              -
                                              2889  print_vector_elements(arguments, ", ");
                                              -
                                              2890  printer->add_text(")");
                                              -
                                              2891  } else {
                                              -
                                              2892  const auto& point_process = get_variable_name("point_process");
                                              -
                                              2893  printer->add_text("net_send_buffering(");
                                              -
                                              2894  printer->fmt_text("nt, ml->_net_send_buffer, 2, {}, {}, {}, ", tqitem, weight_index, point_process);
                                              -
                                              2895  print_vector_elements(arguments, ", ");
                                              -
                                              2896  printer->add_text(", 0.0");
                                              -
                                              2897  printer->add_text(")");
                                              -
                                              2898  }
                                              -
                                              2899 }
                                              -
                                              2900 
                                              -
                                              2901 
                                              - -
                                              2903  const auto& arguments = node.get_arguments();
                                              -
                                              2904  if (info.artificial_cell) {
                                              -
                                              2905  printer->add_text("net_event(pnt, ");
                                              -
                                              2906  print_vector_elements(arguments, ", ");
                                              -
                                              2907  } else {
                                              -
                                              2908  const auto& point_process = get_variable_name("point_process");
                                              -
                                              2909  printer->add_text("net_send_buffering(");
                                              -
                                              2910  printer->fmt_text("nt, ml->_net_send_buffer, 1, -1, -1, {}, ", point_process);
                                              -
                                              2911  print_vector_elements(arguments, ", ");
                                              -
                                              2912  printer->add_text(", 0.0");
                                              -
                                              2913  }
                                              -
                                              2914  printer->add_text(")");
                                              -
                                              2915 }
                                              -
                                              2916 
                                              -
                                              2917 /**
                                              -
                                              2918  * Rename arguments to NET_RECEIVE block with corresponding pointer variable
                                              -
                                              2919  *
                                              -
                                              2920  * Arguments to NET_RECEIVE block are packed and passed via weight vector. These
                                              -
                                              2921  * variables need to be replaced with corresponding pointer variable. For example,
                                              -
                                              2922  * if mod file is like
                                              -
                                              2923  *
                                              -
                                              2924  * \code{.mod}
                                              -
                                              2925  * NET_RECEIVE (weight, R){
                                              -
                                              2926  * INITIAL {
                                              -
                                              2927  * R=1
                                              -
                                              2928  * }
                                              -
                                              2929  * }
                                              -
                                              2930  * \endcode
                                              -
                                              2931  *
                                              -
                                              2932  * then generated code for initial block should be:
                                              -
                                              2933  *
                                              -
                                              2934  * \code{.cpp}
                                              -
                                              2935  * double* R = weights + weight_index + 0;
                                              -
                                              2936  * (*R) = 1.0;
                                              -
                                              2937  * \endcode
                                              -
                                              2938  *
                                              -
                                              2939  * So, the `R` in AST needs to be renamed with `(*R)`.
                                              -
                                              2940  */
                                              -
                                              2941 static void rename_net_receive_arguments(const ast::NetReceiveBlock& net_receive_node, const ast::Node& node) {
                                              -
                                              2942  const auto& parameters = net_receive_node.get_parameters();
                                              -
                                              2943  for (auto& parameter: parameters) {
                                              -
                                              2944  const auto& name = parameter->get_node_name();
                                              -
                                              2945  auto var_used = VarUsageVisitor().variable_used(node, name);
                                              -
                                              2946  if (var_used) {
                                              -
                                              2947  RenameVisitor vr(name, "(*" + name + ")");
                                              -
                                              2948  node.get_statement_block()->visit_children(vr);
                                              -
                                              2949  }
                                              -
                                              2950  }
                                              -
                                              2951 }
                                              -
                                              2952 
                                              -
                                              2953 
                                              - -
                                              2955  const auto node = info.net_receive_initial_node;
                                              -
                                              2956  if (node == nullptr) {
                                              -
                                              2957  return;
                                              -
                                              2958  }
                                              -
                                              2959 
                                              -
                                              2960  // rename net_receive arguments used in the initial block of net_receive
                                              -
                                              2961  rename_net_receive_arguments(*info.net_receive_node, *node);
                                              -
                                              2962 
                                              -
                                              2963  printing_net_init = true;
                                              -
                                              2964  auto args = "Point_process* pnt, int weight_index, double flag";
                                              -
                                              2965  printer->add_newline(2);
                                              -
                                              2966  printer->add_line("/** initialize block for net receive */");
                                              -
                                              2967  printer->fmt_push_block("static void net_init({})", args);
                                              -
                                              2968  auto block = node->get_statement_block().get();
                                              -
                                              2969  if (block->get_statements().empty()) {
                                              -
                                              2970  printer->add_line("// do nothing");
                                              -
                                              2971  } else {
                                              -
                                              2972  print_net_receive_common_code(*node);
                                              -
                                              2973  print_statement_block(*block, false, false);
                                              -
                                              2974  if (node->is_initial_block()) {
                                              -
                                              2975  print_net_init_acc_serial_annotation_block_end();
                                              -
                                              2976  print_kernel_data_present_annotation_block_end();
                                              -
                                              2977  printer->add_line("auto& nsb = ml->_net_send_buffer;");
                                              -
                                              2978  print_net_send_buf_update_to_host();
                                              -
                                              2979  }
                                              -
                                              2980  }
                                              +
                                              2875  print_device_stream_wait();
                                              +
                                              2876  printer->add_line("nrb->_displ_cnt = 0;");
                                              +
                                              2877  printer->add_line("nrb->_cnt = 0;");
                                              +
                                              2878 
                                              +
                                              2879  if (info.net_send_used || info.net_event_used) {
                                              +
                                              2880  print_send_event_move();
                                              +
                                              2881  }
                                              +
                                              2882 
                                              +
                                              2883  print_kernel_data_present_annotation_block_end();
                                              +
                                              2884  printer->pop_block();
                                              +
                                              2885 }
                                              +
                                              2886 
                                              +
                                              2887 
                                              + +
                                              2889  printer->add_line("i = nsb->_cnt++;");
                                              +
                                              2890 }
                                              +
                                              2891 
                                              +
                                              2892 
                                              + +
                                              2894  printer->push_block("if (i >= nsb->_size)");
                                              +
                                              2895  printer->add_line("nsb->grow();");
                                              +
                                              2896  printer->pop_block();
                                              +
                                              2897 }
                                              +
                                              2898 
                                              +
                                              2899 
                                              + +
                                              2901  if (!net_send_buffer_required()) {
                                              +
                                              2902  return;
                                              +
                                              2903  }
                                              +
                                              2904 
                                              +
                                              2905  printer->add_newline(2);
                                              +
                                              2906  print_device_method_annotation();
                                              +
                                              2907  auto args =
                                              +
                                              2908  "const NrnThread* nt, NetSendBuffer_t* nsb, int type, int vdata_index, "
                                              +
                                              2909  "int weight_index, int point_index, double t, double flag";
                                              +
                                              2910  printer->fmt_push_block("static inline void net_send_buffering({})", args);
                                              +
                                              2911  printer->add_line("int i = 0;");
                                              +
                                              2912  print_net_send_buffering_cnt_update();
                                              +
                                              2913  print_net_send_buffering_grow();
                                              +
                                              2914  printer->push_block("if (i < nsb->_size)");
                                              +
                                              2915  printer->add_multi_line(R"CODE(
                                              +
                                              2916  nsb->_sendtype[i] = type;
                                              +
                                              2917  nsb->_vdata_index[i] = vdata_index;
                                              +
                                              2918  nsb->_weight_index[i] = weight_index;
                                              +
                                              2919  nsb->_pnt_index[i] = point_index;
                                              +
                                              2920  nsb->_nsb_t[i] = t;
                                              +
                                              2921  nsb->_nsb_flag[i] = flag;
                                              +
                                              2922  )CODE");
                                              +
                                              2923  printer->pop_block();
                                              +
                                              2924  printer->pop_block();
                                              +
                                              2925 }
                                              +
                                              2926 
                                              +
                                              2927 
                                              + +
                                              2929  if (!net_receive_required()) {
                                              +
                                              2930  return;
                                              +
                                              2931  }
                                              +
                                              2932 
                                              +
                                              2933  printing_net_receive = true;
                                              +
                                              2934  const auto node = info.net_receive_node;
                                              +
                                              2935 
                                              +
                                              2936  // rename net_receive arguments used in the block itself
                                              +
                                              2937  rename_net_receive_arguments(*info.net_receive_node, *node);
                                              +
                                              2938 
                                              +
                                              2939  std::string name;
                                              +
                                              2940  ParamVector params;
                                              +
                                              2941  if (!info.artificial_cell) {
                                              +
                                              2942  name = method_name("net_receive_kernel");
                                              +
                                              2943  params.emplace_back("", "double", "", "t");
                                              +
                                              2944  params.emplace_back("", "Point_process*", "", "pnt");
                                              +
                                              2945  params.emplace_back("", fmt::format("{}*", instance_struct()),
                                              +
                                              2946  "", "inst");
                                              +
                                              2947  params.emplace_back("", "NrnThread*", "", "nt");
                                              +
                                              2948  params.emplace_back("", "Memb_list*", "", "ml");
                                              +
                                              2949  params.emplace_back("", "int", "", "weight_index");
                                              +
                                              2950  params.emplace_back("", "double", "", "flag");
                                              +
                                              2951  } else {
                                              +
                                              2952  name = method_name("net_receive");
                                              +
                                              2953  params.emplace_back("", "Point_process*", "", "pnt");
                                              +
                                              2954  params.emplace_back("", "int", "", "weight_index");
                                              +
                                              2955  params.emplace_back("", "double", "", "flag");
                                              +
                                              2956  }
                                              +
                                              2957 
                                              +
                                              2958  printer->add_newline(2);
                                              +
                                              2959  printer->fmt_push_block("static inline void {}({})", name, get_parameter_str(params));
                                              +
                                              2960  print_net_receive_common_code(*node, info.artificial_cell);
                                              +
                                              2961  if (info.artificial_cell) {
                                              +
                                              2962  printer->add_line("double t = nt->_t;");
                                              +
                                              2963  }
                                              +
                                              2964 
                                              +
                                              2965  // set voltage variable if it is used in the block (e.g. for WATCH statement)
                                              +
                                              2966  auto v_used = VarUsageVisitor().variable_used(*node->get_statement_block(), "v");
                                              +
                                              2967  if (v_used) {
                                              +
                                              2968  printer->add_line("int node_id = ml->nodeindices[id];");
                                              +
                                              2969  printer->add_line("v = nt->_actual_v[node_id];");
                                              +
                                              2970  }
                                              +
                                              2971 
                                              +
                                              2972  printer->fmt_line("{} = t;", get_variable_name("tsave"));
                                              +
                                              2973 
                                              +
                                              2974  if (info.is_watch_used()) {
                                              +
                                              2975  printer->add_line("bool watch_remove = false;");
                                              +
                                              2976  }
                                              +
                                              2977 
                                              +
                                              2978  printer->add_indent();
                                              +
                                              2979  node->get_statement_block()->accept(*this);
                                              +
                                              2980  printer->add_newline();
                                              2981  printer->pop_block();
                                              -
                                              2982  printing_net_init = false;
                                              -
                                              2983 }
                                              -
                                              2984 
                                              +
                                              2982 
                                              +
                                              2983  printing_net_receive = false;
                                              +
                                              2984 }
                                              2985 
                                              - -
                                              2987  printer->add_newline();
                                              -
                                              2988  printer->add_line("NetSendBuffer_t* nsb = ml->_net_send_buffer;");
                                              -
                                              2989  print_net_send_buf_update_to_host();
                                              -
                                              2990  printer->push_block("for (int i=0; i < nsb->_cnt; i++)");
                                              -
                                              2991  printer->add_multi_line(R"CODE(
                                              -
                                              2992  int type = nsb->_sendtype[i];
                                              -
                                              2993  int tid = nt->id;
                                              -
                                              2994  double t = nsb->_nsb_t[i];
                                              -
                                              2995  double flag = nsb->_nsb_flag[i];
                                              -
                                              2996  int vdata_index = nsb->_vdata_index[i];
                                              -
                                              2997  int weight_index = nsb->_weight_index[i];
                                              -
                                              2998  int point_index = nsb->_pnt_index[i];
                                              -
                                              2999  net_sem_from_gpu(type, vdata_index, weight_index, tid, point_index, t, flag);
                                              -
                                              3000  )CODE");
                                              -
                                              3001  printer->pop_block();
                                              -
                                              3002  printer->add_line("nsb->_cnt = 0;");
                                              -
                                              3003  print_net_send_buf_count_update_to_device();
                                              -
                                              3004 }
                                              -
                                              3005 
                                              -
                                              3006 
                                              - -
                                              3008  return fmt::format("void {}(NrnThread* nt)", method_name("net_buf_receive"));
                                              -
                                              3009 }
                                              -
                                              3010 
                                              -
                                              3011 
                                              - -
                                              3013  printer->add_line("Memb_list* ml = get_memb_list(nt);");
                                              -
                                              3014  printer->push_block("if (!ml)");
                                              -
                                              3015  printer->add_line("return;");
                                              -
                                              3016  printer->pop_block();
                                              -
                                              3017  printer->add_newline();
                                              +
                                              2986 
                                              + +
                                              2988  if (!net_receive_required()) {
                                              +
                                              2989  return;
                                              +
                                              2990  }
                                              +
                                              2991 
                                              +
                                              2992  printing_net_receive = true;
                                              +
                                              2993  if (!info.artificial_cell) {
                                              +
                                              2994  const auto& name = method_name("net_receive");
                                              +
                                              2995  ParamVector params;
                                              +
                                              2996  params.emplace_back("", "Point_process*", "", "pnt");
                                              +
                                              2997  params.emplace_back("", "int", "", "weight_index");
                                              +
                                              2998  params.emplace_back("", "double", "", "flag");
                                              +
                                              2999  printer->add_newline(2);
                                              +
                                              3000  printer->fmt_push_block("static void {}({})", name, get_parameter_str(params));
                                              +
                                              3001  printer->add_line("NrnThread* nt = nrn_threads + pnt->_tid;");
                                              +
                                              3002  printer->add_line("Memb_list* ml = get_memb_list(nt);");
                                              +
                                              3003  printer->add_line("NetReceiveBuffer_t* nrb = ml->_net_receive_buffer;");
                                              +
                                              3004  printer->push_block("if (nrb->_cnt >= nrb->_size)");
                                              +
                                              3005  printer->add_line("realloc_net_receive_buffer(nt, ml);");
                                              +
                                              3006  printer->pop_block();
                                              +
                                              3007  printer->add_multi_line(R"CODE(
                                              +
                                              3008  int id = nrb->_cnt;
                                              +
                                              3009  nrb->_pnt_index[id] = pnt-nt->pntprocs;
                                              +
                                              3010  nrb->_weight_index[id] = weight_index;
                                              +
                                              3011  nrb->_nrb_t[id] = nt->_t;
                                              +
                                              3012  nrb->_nrb_flag[id] = flag;
                                              +
                                              3013  nrb->_cnt++;
                                              +
                                              3014  )CODE");
                                              +
                                              3015  printer->pop_block();
                                              +
                                              3016  }
                                              +
                                              3017  printing_net_receive = false;
                                              3018 }
                                              3019 
                                              -
                                              3020 
                                              - -
                                              3022  printer->add_line("int count = nrb->_displ_cnt;");
                                              -
                                              3023  print_channel_iteration_block_parallel_hint(BlockType::NetReceive, info.net_receive_node);
                                              -
                                              3024  printer->push_block("for (int i = 0; i < count; i++)");
                                              -
                                              3025 }
                                              -
                                              3026 
                                              -
                                              3027 
                                              - -
                                              3029  printer->pop_block();
                                              -
                                              3030 }
                                              -
                                              3031 
                                              -
                                              3032 
                                              - -
                                              3034  if (!net_receive_required() || info.artificial_cell) {
                                              -
                                              3035  return;
                                              -
                                              3036  }
                                              +
                                              3020 
                                              +
                                              3021 /**
                                              +
                                              3022  * \todo Data is not derived. Need to add instance into instance struct?
                                              +
                                              3023  * data used here is wrong in AoS because as in original implementation,
                                              +
                                              3024  * data is not incremented every iteration for AoS. May be better to derive
                                              +
                                              3025  * actual variable names? [resolved now?]
                                              +
                                              3026  * slist needs to added as local variable
                                              +
                                              3027  */
                                              + +
                                              3029  auto ext_args = external_method_arguments();
                                              +
                                              3030  auto ext_params = external_method_parameters();
                                              +
                                              3031  auto suffix = info.mod_suffix;
                                              +
                                              3032  auto list_num = info.derivimplicit_list_num;
                                              +
                                              3033  auto block_name = block.get_node_name();
                                              +
                                              3034  auto primes_size = info.primes_size;
                                              +
                                              3035  auto stride = "*pnodecount+id";
                                              +
                                              3036 
                                              3037  printer->add_newline(2);
                                              -
                                              3038  printer->push_block(net_receive_buffering_declaration());
                                              -
                                              3039 
                                              -
                                              3040  print_get_memb_list();
                                              -
                                              3041 
                                              -
                                              3042  const auto& net_receive = method_name("net_receive_kernel");
                                              -
                                              3043 
                                              -
                                              3044  print_kernel_data_present_annotation_block_begin();
                                              -
                                              3045 
                                              -
                                              3046  printer->add_line("NetReceiveBuffer_t* nrb = ml->_net_receive_buffer;");
                                              -
                                              3047  if (need_mech_inst) {
                                              -
                                              3048  printer->fmt_line("auto* const inst = static_cast<{0}*>(ml->instance);", instance_struct());
                                              -
                                              3049  }
                                              -
                                              3050  print_net_receive_loop_begin();
                                              -
                                              3051  printer->add_line("int start = nrb->_displ[i];");
                                              -
                                              3052  printer->add_line("int end = nrb->_displ[i+1];");
                                              -
                                              3053  printer->push_block("for (int j = start; j < end; j++)");
                                              -
                                              3054  printer->add_multi_line(R"CODE(
                                              -
                                              3055  int index = nrb->_nrb_index[j];
                                              -
                                              3056  int offset = nrb->_pnt_index[index];
                                              -
                                              3057  double t = nrb->_nrb_t[index];
                                              -
                                              3058  int weight_index = nrb->_weight_index[index];
                                              -
                                              3059  double flag = nrb->_nrb_flag[index];
                                              -
                                              3060  Point_process* point_process = nt->pntprocs + offset;
                                              -
                                              3061  )CODE");
                                              -
                                              3062  printer->add_line(net_receive, "(t, point_process, inst, nt, ml, weight_index, flag);");
                                              -
                                              3063  printer->pop_block();
                                              -
                                              3064  print_net_receive_loop_end();
                                              -
                                              3065 
                                              -
                                              3066  print_device_stream_wait();
                                              -
                                              3067  printer->add_line("nrb->_displ_cnt = 0;");
                                              -
                                              3068  printer->add_line("nrb->_cnt = 0;");
                                              -
                                              3069 
                                              -
                                              3070  if (info.net_send_used || info.net_event_used) {
                                              -
                                              3071  print_send_event_move();
                                              -
                                              3072  }
                                              -
                                              3073 
                                              -
                                              3074  print_kernel_data_present_annotation_block_end();
                                              -
                                              3075  printer->pop_block();
                                              -
                                              3076 }
                                              -
                                              3077 
                                              -
                                              3078 
                                              - -
                                              3080  printer->add_line("i = nsb->_cnt++;");
                                              -
                                              3081 }
                                              -
                                              3082 
                                              -
                                              3083 
                                              - -
                                              3085  printer->push_block("if (i >= nsb->_size)");
                                              -
                                              3086  printer->add_line("nsb->grow();");
                                              -
                                              3087  printer->pop_block();
                                              -
                                              3088 }
                                              -
                                              3089 
                                              -
                                              3090 
                                              - -
                                              3092  if (!net_send_buffer_required()) {
                                              -
                                              3093  return;
                                              -
                                              3094  }
                                              -
                                              3095 
                                              -
                                              3096  printer->add_newline(2);
                                              -
                                              3097  print_device_method_annotation();
                                              -
                                              3098  auto args =
                                              -
                                              3099  "const NrnThread* nt, NetSendBuffer_t* nsb, int type, int vdata_index, "
                                              -
                                              3100  "int weight_index, int point_index, double t, double flag";
                                              -
                                              3101  printer->fmt_push_block("static inline void net_send_buffering({})", args);
                                              -
                                              3102  printer->add_line("int i = 0;");
                                              -
                                              3103  print_net_send_buffering_cnt_update();
                                              -
                                              3104  print_net_send_buffering_grow();
                                              -
                                              3105  printer->push_block("if (i < nsb->_size)");
                                              -
                                              3106  printer->add_multi_line(R"CODE(
                                              -
                                              3107  nsb->_sendtype[i] = type;
                                              -
                                              3108  nsb->_vdata_index[i] = vdata_index;
                                              -
                                              3109  nsb->_weight_index[i] = weight_index;
                                              -
                                              3110  nsb->_pnt_index[i] = point_index;
                                              -
                                              3111  nsb->_nsb_t[i] = t;
                                              -
                                              3112  nsb->_nsb_flag[i] = flag;
                                              -
                                              3113  )CODE");
                                              -
                                              3114  printer->pop_block();
                                              -
                                              3115  printer->pop_block();
                                              -
                                              3116 }
                                              -
                                              3117 
                                              -
                                              3118 
                                              - -
                                              3120  if (!net_receive_required()) {
                                              -
                                              3121  return;
                                              -
                                              3122  }
                                              -
                                              3123 
                                              -
                                              3124  printing_net_receive = true;
                                              -
                                              3125  const auto node = info.net_receive_node;
                                              +
                                              3038 
                                              +
                                              3039  printer->push_block("namespace");
                                              +
                                              3040  printer->fmt_push_block("struct _newton_{}_{}", block_name, info.mod_suffix);
                                              +
                                              3041  printer->fmt_push_block("int operator()({}) const", external_method_parameters());
                                              +
                                              3042  auto const instance = fmt::format("auto* const inst = static_cast<{0}*>(ml->instance);",
                                              +
                                              3043  instance_struct());
                                              +
                                              3044  auto const slist1 = fmt::format("auto const& slist{} = {};",
                                              +
                                              3045  list_num,
                                              +
                                              3046  get_variable_name(fmt::format("slist{}", list_num)));
                                              +
                                              3047  auto const slist2 = fmt::format("auto& slist{} = {};",
                                              +
                                              3048  list_num + 1,
                                              +
                                              3049  get_variable_name(fmt::format("slist{}", list_num + 1)));
                                              +
                                              3050  auto const dlist1 = fmt::format("auto const& dlist{} = {};",
                                              +
                                              3051  list_num,
                                              +
                                              3052  get_variable_name(fmt::format("dlist{}", list_num)));
                                              +
                                              3053  auto const dlist2 = fmt::format(
                                              +
                                              3054  "double* dlist{} = static_cast<double*>(thread[dith{}()].pval) + ({}*pnodecount);",
                                              +
                                              3055  list_num + 1,
                                              +
                                              3056  list_num,
                                              +
                                              3057  info.primes_size);
                                              +
                                              3058  printer->add_line(instance);
                                              +
                                              3059  if (ion_variable_struct_required()) {
                                              +
                                              3060  print_ion_variable();
                                              +
                                              3061  }
                                              +
                                              3062  printer->fmt_line("double* savstate{} = static_cast<double*>(thread[dith{}()].pval);",
                                              +
                                              3063  list_num,
                                              +
                                              3064  list_num);
                                              +
                                              3065  printer->add_line(slist1);
                                              +
                                              3066  printer->add_line(dlist1);
                                              +
                                              3067  printer->add_line(dlist2);
                                              +
                                              3068 
                                              +
                                              3069  print_statement_block(*block.get_statement_block(), false, false);
                                              +
                                              3070 
                                              +
                                              3071  printer->add_line("int counter = -1;");
                                              +
                                              3072  printer->fmt_push_block("for (int i=0; i<{}; i++)", info.num_primes);
                                              +
                                              3073  printer->fmt_push_block("if (*deriv{}_advance(thread))", list_num);
                                              +
                                              3074  printer->fmt_line(
                                              +
                                              3075  "dlist{0}[(++counter){1}] = "
                                              +
                                              3076  "data[dlist{2}[i]{1}]-(data[slist{2}[i]{1}]-savstate{2}[i{1}])/nt->_dt;",
                                              +
                                              3077  list_num + 1,
                                              +
                                              3078  stride,
                                              +
                                              3079  list_num);
                                              +
                                              3080  printer->chain_block("else");
                                              +
                                              3081  printer->fmt_line("dlist{0}[(++counter){1}] = data[slist{2}[i]{1}]-savstate{2}[i{1}];",
                                              +
                                              3082  list_num + 1,
                                              +
                                              3083  stride,
                                              +
                                              3084  list_num);
                                              +
                                              3085  printer->pop_block();
                                              +
                                              3086  printer->pop_block();
                                              +
                                              3087  printer->add_line("return 0;");
                                              +
                                              3088  printer->pop_block(); // operator()
                                              +
                                              3089  printer->pop_block(";"); // struct
                                              +
                                              3090  printer->pop_block(); // namespace
                                              +
                                              3091  printer->add_newline();
                                              +
                                              3092  printer->fmt_push_block("int {}_{}({})", block_name, suffix, ext_params);
                                              +
                                              3093  printer->add_line(instance);
                                              +
                                              3094  printer->fmt_line("double* savstate{} = (double*) thread[dith{}()].pval;", list_num, list_num);
                                              +
                                              3095  printer->add_line(slist1);
                                              +
                                              3096  printer->add_line(slist2);
                                              +
                                              3097  printer->add_line(dlist2);
                                              +
                                              3098  printer->fmt_push_block("for (int i=0; i<{}; i++)", info.num_primes);
                                              +
                                              3099  printer->fmt_line("savstate{}[i{}] = data[slist{}[i]{}];", list_num, stride, list_num, stride);
                                              +
                                              3100  printer->pop_block();
                                              +
                                              3101  printer->fmt_line(
                                              +
                                              3102  "int reset = nrn_newton_thread(static_cast<NewtonSpace*>(*newtonspace{}(thread)), {}, "
                                              +
                                              3103  "slist{}, _newton_{}_{}{{}}, dlist{}, {});",
                                              +
                                              3104  list_num,
                                              +
                                              3105  primes_size,
                                              +
                                              3106  list_num + 1,
                                              +
                                              3107  block_name,
                                              +
                                              3108  suffix,
                                              +
                                              3109  list_num + 1,
                                              +
                                              3110  ext_args);
                                              +
                                              3111  printer->add_line("return reset;");
                                              +
                                              3112  printer->pop_block();
                                              +
                                              3113  printer->add_newline(2);
                                              +
                                              3114 }
                                              +
                                              3115 
                                              +
                                              3116 
                                              + +
                                              3118  // nothing to do on cpu
                                              +
                                              3119 }
                                              +
                                              3120 
                                              +
                                              3121 
                                              +
                                              3122 /****************************************************************************************/
                                              +
                                              3123 /* Print nrn_state routine */
                                              +
                                              3124 /****************************************************************************************/
                                              +
                                              3125 
                                              3126 
                                              -
                                              3127  // rename net_receive arguments used in the block itself
                                              -
                                              3128  rename_net_receive_arguments(*info.net_receive_node, *node);
                                              -
                                              3129 
                                              -
                                              3130  std::string name;
                                              -
                                              3131  ParamVector params;
                                              -
                                              3132  if (!info.artificial_cell) {
                                              -
                                              3133  name = method_name("net_receive_kernel");
                                              -
                                              3134  params.emplace_back("", "double", "", "t");
                                              -
                                              3135  params.emplace_back("", "Point_process*", "", "pnt");
                                              -
                                              3136  params.emplace_back("", fmt::format("{}*", instance_struct()),
                                              -
                                              3137  "", "inst");
                                              -
                                              3138  params.emplace_back("", "NrnThread*", "", "nt");
                                              -
                                              3139  params.emplace_back("", "Memb_list*", "", "ml");
                                              -
                                              3140  params.emplace_back("", "int", "", "weight_index");
                                              -
                                              3141  params.emplace_back("", "double", "", "flag");
                                              -
                                              3142  } else {
                                              -
                                              3143  name = method_name("net_receive");
                                              -
                                              3144  params.emplace_back("", "Point_process*", "", "pnt");
                                              -
                                              3145  params.emplace_back("", "int", "", "weight_index");
                                              -
                                              3146  params.emplace_back("", "double", "", "flag");
                                              -
                                              3147  }
                                              -
                                              3148 
                                              -
                                              3149  printer->add_newline(2);
                                              -
                                              3150  printer->fmt_push_block("static inline void {}({})", name, get_parameter_str(params));
                                              -
                                              3151  print_net_receive_common_code(*node, info.artificial_cell);
                                              -
                                              3152  if (info.artificial_cell) {
                                              -
                                              3153  printer->add_line("double t = nt->_t;");
                                              -
                                              3154  }
                                              -
                                              3155 
                                              -
                                              3156  // set voltage variable if it is used in the block (e.g. for WATCH statement)
                                              -
                                              3157  auto v_used = VarUsageVisitor().variable_used(*node->get_statement_block(), "v");
                                              -
                                              3158  if (v_used) {
                                              -
                                              3159  printer->add_line("int node_id = ml->nodeindices[id];");
                                              -
                                              3160  printer->add_line("v = nt->_actual_v[node_id];");
                                              -
                                              3161  }
                                              -
                                              3162 
                                              -
                                              3163  printer->fmt_line("{} = t;", get_variable_name("tsave"));
                                              -
                                              3164 
                                              -
                                              3165  if (info.is_watch_used()) {
                                              -
                                              3166  printer->add_line("bool watch_remove = false;");
                                              -
                                              3167  }
                                              -
                                              3168 
                                              -
                                              3169  printer->add_indent();
                                              -
                                              3170  node->get_statement_block()->accept(*this);
                                              -
                                              3171  printer->add_newline();
                                              -
                                              3172  printer->pop_block();
                                              -
                                              3173 
                                              -
                                              3174  printing_net_receive = false;
                                              -
                                              3175 }
                                              + +
                                              3128  if (!nrn_state_required()) {
                                              +
                                              3129  return;
                                              +
                                              3130  }
                                              +
                                              3131 
                                              +
                                              3132  printer->add_newline(2);
                                              +
                                              3133  printer->add_line("/** update state */");
                                              +
                                              3134  print_global_function_common_code(BlockType::State);
                                              +
                                              3135  print_channel_iteration_block_parallel_hint(BlockType::State, info.nrn_state_block);
                                              +
                                              3136  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              +
                                              3137 
                                              +
                                              3138  printer->add_line("int node_id = node_index[id];");
                                              +
                                              3139  printer->add_line("double v = voltage[node_id];");
                                              +
                                              3140  print_v_unused();
                                              +
                                              3141 
                                              +
                                              3142  /**
                                              +
                                              3143  * \todo Eigen solver node also emits IonCurVar variable in the functor
                                              +
                                              3144  * but that shouldn't update ions in derivative block
                                              +
                                              3145  */
                                              +
                                              3146  if (ion_variable_struct_required()) {
                                              +
                                              3147  print_ion_variable();
                                              +
                                              3148  }
                                              +
                                              3149 
                                              +
                                              3150  auto read_statements = ion_read_statements(BlockType::State);
                                              +
                                              3151  for (auto& statement: read_statements) {
                                              +
                                              3152  printer->add_line(statement);
                                              +
                                              3153  }
                                              +
                                              3154 
                                              +
                                              3155  if (info.nrn_state_block) {
                                              +
                                              3156  info.nrn_state_block->visit_children(*this);
                                              +
                                              3157  }
                                              +
                                              3158 
                                              +
                                              3159  if (info.currents.empty() && info.breakpoint_node != nullptr) {
                                              +
                                              3160  auto block = info.breakpoint_node->get_statement_block();
                                              +
                                              3161  print_statement_block(*block, false, false);
                                              +
                                              3162  }
                                              +
                                              3163 
                                              +
                                              3164  const auto& write_statements = ion_write_statements(BlockType::State);
                                              +
                                              3165  for (auto& statement: write_statements) {
                                              +
                                              3166  const auto& text = process_shadow_update_statement(statement, BlockType::State);
                                              +
                                              3167  printer->add_line(text);
                                              +
                                              3168  }
                                              +
                                              3169  printer->pop_block();
                                              +
                                              3170 
                                              +
                                              3171  print_kernel_data_present_annotation_block_end();
                                              +
                                              3172 
                                              +
                                              3173  printer->pop_block();
                                              +
                                              3174 }
                                              +
                                              3175 
                                              3176 
                                              -
                                              3177 
                                              - -
                                              3179  if (!net_receive_required()) {
                                              -
                                              3180  return;
                                              -
                                              3181  }
                                              -
                                              3182 
                                              -
                                              3183  printing_net_receive = true;
                                              -
                                              3184  if (!info.artificial_cell) {
                                              -
                                              3185  const auto& name = method_name("net_receive");
                                              -
                                              3186  ParamVector params;
                                              -
                                              3187  params.emplace_back("", "Point_process*", "", "pnt");
                                              -
                                              3188  params.emplace_back("", "int", "", "weight_index");
                                              -
                                              3189  params.emplace_back("", "double", "", "flag");
                                              -
                                              3190  printer->add_newline(2);
                                              -
                                              3191  printer->fmt_push_block("static void {}({})", name, get_parameter_str(params));
                                              -
                                              3192  printer->add_line("NrnThread* nt = nrn_threads + pnt->_tid;");
                                              -
                                              3193  printer->add_line("Memb_list* ml = get_memb_list(nt);");
                                              -
                                              3194  printer->add_line("NetReceiveBuffer_t* nrb = ml->_net_receive_buffer;");
                                              -
                                              3195  printer->push_block("if (nrb->_cnt >= nrb->_size)");
                                              -
                                              3196  printer->add_line("realloc_net_receive_buffer(nt, ml);");
                                              -
                                              3197  printer->pop_block();
                                              -
                                              3198  printer->add_multi_line(R"CODE(
                                              -
                                              3199  int id = nrb->_cnt;
                                              -
                                              3200  nrb->_pnt_index[id] = pnt-nt->pntprocs;
                                              -
                                              3201  nrb->_weight_index[id] = weight_index;
                                              -
                                              3202  nrb->_nrb_t[id] = nt->_t;
                                              -
                                              3203  nrb->_nrb_flag[id] = flag;
                                              -
                                              3204  nrb->_cnt++;
                                              -
                                              3205  )CODE");
                                              -
                                              3206  printer->pop_block();
                                              -
                                              3207  }
                                              -
                                              3208  printing_net_receive = false;
                                              -
                                              3209 }
                                              -
                                              3210 
                                              -
                                              3211 
                                              -
                                              3212 /**
                                              -
                                              3213  * \todo Data is not derived. Need to add instance into instance struct?
                                              -
                                              3214  * data used here is wrong in AoS because as in original implementation,
                                              -
                                              3215  * data is not incremented every iteration for AoS. May be better to derive
                                              -
                                              3216  * actual variable names? [resolved now?]
                                              -
                                              3217  * slist needs to added as local variable
                                              -
                                              3218  */
                                              - -
                                              3220  auto ext_args = external_method_arguments();
                                              -
                                              3221  auto ext_params = external_method_parameters();
                                              -
                                              3222  auto suffix = info.mod_suffix;
                                              -
                                              3223  auto list_num = info.derivimplicit_list_num;
                                              -
                                              3224  auto block_name = block.get_node_name();
                                              -
                                              3225  auto primes_size = info.primes_size;
                                              -
                                              3226  auto stride = "*pnodecount+id";
                                              -
                                              3227 
                                              -
                                              3228  printer->add_newline(2);
                                              -
                                              3229 
                                              -
                                              3230  printer->push_block("namespace");
                                              -
                                              3231  printer->fmt_push_block("struct _newton_{}_{}", block_name, info.mod_suffix);
                                              -
                                              3232  printer->fmt_push_block("int operator()({}) const", external_method_parameters());
                                              -
                                              3233  auto const instance = fmt::format("auto* const inst = static_cast<{0}*>(ml->instance);",
                                              -
                                              3234  instance_struct());
                                              -
                                              3235  auto const slist1 = fmt::format("auto const& slist{} = {};",
                                              -
                                              3236  list_num,
                                              -
                                              3237  get_variable_name(fmt::format("slist{}", list_num)));
                                              -
                                              3238  auto const slist2 = fmt::format("auto& slist{} = {};",
                                              -
                                              3239  list_num + 1,
                                              -
                                              3240  get_variable_name(fmt::format("slist{}", list_num + 1)));
                                              -
                                              3241  auto const dlist1 = fmt::format("auto const& dlist{} = {};",
                                              -
                                              3242  list_num,
                                              -
                                              3243  get_variable_name(fmt::format("dlist{}", list_num)));
                                              -
                                              3244  auto const dlist2 = fmt::format(
                                              -
                                              3245  "double* dlist{} = static_cast<double*>(thread[dith{}()].pval) + ({}*pnodecount);",
                                              -
                                              3246  list_num + 1,
                                              -
                                              3247  list_num,
                                              -
                                              3248  info.primes_size);
                                              -
                                              3249  printer->add_line(instance);
                                              -
                                              3250  if (ion_variable_struct_required()) {
                                              -
                                              3251  print_ion_variable();
                                              -
                                              3252  }
                                              -
                                              3253  printer->fmt_line("double* savstate{} = static_cast<double*>(thread[dith{}()].pval);",
                                              -
                                              3254  list_num,
                                              -
                                              3255  list_num);
                                              -
                                              3256  printer->add_line(slist1);
                                              -
                                              3257  printer->add_line(dlist1);
                                              -
                                              3258  printer->add_line(dlist2);
                                              -
                                              3259 
                                              -
                                              3260  print_statement_block(*block.get_statement_block(), false, false);
                                              -
                                              3261 
                                              -
                                              3262  printer->add_line("int counter = -1;");
                                              -
                                              3263  printer->fmt_push_block("for (int i=0; i<{}; i++)", info.num_primes);
                                              -
                                              3264  printer->fmt_push_block("if (*deriv{}_advance(thread))", list_num);
                                              -
                                              3265  printer->fmt_line(
                                              -
                                              3266  "dlist{0}[(++counter){1}] = "
                                              -
                                              3267  "data[dlist{2}[i]{1}]-(data[slist{2}[i]{1}]-savstate{2}[i{1}])/nt->_dt;",
                                              -
                                              3268  list_num + 1,
                                              -
                                              3269  stride,
                                              -
                                              3270  list_num);
                                              -
                                              3271  printer->chain_block("else");
                                              -
                                              3272  printer->fmt_line("dlist{0}[(++counter){1}] = data[slist{2}[i]{1}]-savstate{2}[i{1}];",
                                              -
                                              3273  list_num + 1,
                                              -
                                              3274  stride,
                                              -
                                              3275  list_num);
                                              -
                                              3276  printer->pop_block();
                                              -
                                              3277  printer->pop_block();
                                              -
                                              3278  printer->add_line("return 0;");
                                              -
                                              3279  printer->pop_block(); // operator()
                                              -
                                              3280  printer->pop_block(";"); // struct
                                              -
                                              3281  printer->pop_block(); // namespace
                                              -
                                              3282  printer->add_newline();
                                              -
                                              3283  printer->fmt_push_block("int {}_{}({})", block_name, suffix, ext_params);
                                              -
                                              3284  printer->add_line(instance);
                                              -
                                              3285  printer->fmt_line("double* savstate{} = (double*) thread[dith{}()].pval;", list_num, list_num);
                                              -
                                              3286  printer->add_line(slist1);
                                              -
                                              3287  printer->add_line(slist2);
                                              -
                                              3288  printer->add_line(dlist2);
                                              -
                                              3289  printer->fmt_push_block("for (int i=0; i<{}; i++)", info.num_primes);
                                              -
                                              3290  printer->fmt_line("savstate{}[i{}] = data[slist{}[i]{}];", list_num, stride, list_num, stride);
                                              -
                                              3291  printer->pop_block();
                                              -
                                              3292  printer->fmt_line(
                                              -
                                              3293  "int reset = nrn_newton_thread(static_cast<NewtonSpace*>(*newtonspace{}(thread)), {}, "
                                              -
                                              3294  "slist{}, _newton_{}_{}{{}}, dlist{}, {});",
                                              -
                                              3295  list_num,
                                              -
                                              3296  primes_size,
                                              -
                                              3297  list_num + 1,
                                              -
                                              3298  block_name,
                                              -
                                              3299  suffix,
                                              -
                                              3300  list_num + 1,
                                              -
                                              3301  ext_args);
                                              -
                                              3302  printer->add_line("return reset;");
                                              -
                                              3303  printer->pop_block();
                                              -
                                              3304  printer->add_newline(2);
                                              +
                                              3177 /****************************************************************************************/
                                              +
                                              3178 /* Print nrn_cur related routines */
                                              +
                                              3179 /****************************************************************************************/
                                              +
                                              3180 
                                              +
                                              3181 
                                              + +
                                              3183  const auto& args = internal_method_parameters();
                                              +
                                              3184  const auto& block = node.get_statement_block();
                                              +
                                              3185  printer->add_newline(2);
                                              +
                                              3186  print_device_method_annotation();
                                              +
                                              3187  printer->fmt_push_block("inline double nrn_current_{}({})",
                                              +
                                              3188  info.mod_suffix,
                                              +
                                              3189  get_parameter_str(args));
                                              +
                                              3190  printer->add_line("double current = 0.0;");
                                              +
                                              3191  print_statement_block(*block, false, false);
                                              +
                                              3192  for (auto& current: info.currents) {
                                              +
                                              3193  const auto& name = get_variable_name(current);
                                              +
                                              3194  printer->fmt_line("current += {};", name);
                                              +
                                              3195  }
                                              +
                                              3196  printer->add_line("return current;");
                                              +
                                              3197  printer->pop_block();
                                              +
                                              3198 }
                                              +
                                              3199 
                                              +
                                              3200 
                                              + +
                                              3202  const auto& block = node.get_statement_block();
                                              +
                                              3203  print_statement_block(*block, false, false);
                                              +
                                              3204  if (!info.currents.empty()) {
                                              +
                                              3205  std::string sum;
                                              +
                                              3206  for (const auto& current: info.currents) {
                                              +
                                              3207  auto var = breakpoint_current(current);
                                              +
                                              3208  sum += get_variable_name(var);
                                              +
                                              3209  if (&current != &info.currents.back()) {
                                              +
                                              3210  sum += "+";
                                              +
                                              3211  }
                                              +
                                              3212  }
                                              +
                                              3213  printer->fmt_line("double rhs = {};", sum);
                                              +
                                              3214  }
                                              +
                                              3215 
                                              +
                                              3216  std::string sum;
                                              +
                                              3217  for (const auto& conductance: info.conductances) {
                                              +
                                              3218  auto var = breakpoint_current(conductance.variable);
                                              +
                                              3219  sum += get_variable_name(var);
                                              +
                                              3220  if (&conductance != &info.conductances.back()) {
                                              +
                                              3221  sum += "+";
                                              +
                                              3222  }
                                              +
                                              3223  }
                                              +
                                              3224  printer->fmt_line("double g = {};", sum);
                                              +
                                              3225 
                                              +
                                              3226  for (const auto& conductance: info.conductances) {
                                              +
                                              3227  if (!conductance.ion.empty()) {
                                              +
                                              3228  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + conductance.ion + "dv";
                                              +
                                              3229  const auto& rhs = get_variable_name(conductance.variable);
                                              +
                                              3230  const ShadowUseStatement statement{lhs, "+=", rhs};
                                              +
                                              3231  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                                              +
                                              3232  printer->add_line(text);
                                              +
                                              3233  }
                                              +
                                              3234  }
                                              +
                                              3235 }
                                              +
                                              3236 
                                              +
                                              3237 
                                              + +
                                              3239  printer->fmt_line("double g = nrn_current_{}({}+0.001);",
                                              +
                                              3240  info.mod_suffix,
                                              +
                                              3241  internal_method_arguments());
                                              +
                                              3242  for (auto& ion: info.ions) {
                                              +
                                              3243  for (auto& var: ion.writes) {
                                              +
                                              3244  if (ion.is_ionic_current(var)) {
                                              +
                                              3245  const auto& name = get_variable_name(var);
                                              +
                                              3246  printer->fmt_line("double di{} = {};", ion.name, name);
                                              +
                                              3247  }
                                              +
                                              3248  }
                                              +
                                              3249  }
                                              +
                                              3250  printer->fmt_line("double rhs = nrn_current_{}({});",
                                              +
                                              3251  info.mod_suffix,
                                              +
                                              3252  internal_method_arguments());
                                              +
                                              3253  printer->add_line("g = (g-rhs)/0.001;");
                                              +
                                              3254  for (auto& ion: info.ions) {
                                              +
                                              3255  for (auto& var: ion.writes) {
                                              +
                                              3256  if (ion.is_ionic_current(var)) {
                                              +
                                              3257  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + ion.name + "dv";
                                              +
                                              3258  auto rhs = fmt::format("(di{}-{})/0.001", ion.name, get_variable_name(var));
                                              +
                                              3259  if (info.point_process) {
                                              +
                                              3260  auto area = get_variable_name(naming::NODE_AREA_VARIABLE);
                                              +
                                              3261  rhs += fmt::format("*1.e2/{}", area);
                                              +
                                              3262  }
                                              +
                                              3263  const ShadowUseStatement statement{lhs, "+=", rhs};
                                              +
                                              3264  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                                              +
                                              3265  printer->add_line(text);
                                              +
                                              3266  }
                                              +
                                              3267  }
                                              +
                                              3268  }
                                              +
                                              3269 }
                                              +
                                              3270 
                                              +
                                              3271 
                                              + +
                                              3273  printer->add_line("int node_id = node_index[id];");
                                              +
                                              3274  printer->add_line("double v = voltage[node_id];");
                                              +
                                              3275  print_v_unused();
                                              +
                                              3276  if (ion_variable_struct_required()) {
                                              +
                                              3277  print_ion_variable();
                                              +
                                              3278  }
                                              +
                                              3279 
                                              +
                                              3280  const auto& read_statements = ion_read_statements(BlockType::Equation);
                                              +
                                              3281  for (auto& statement: read_statements) {
                                              +
                                              3282  printer->add_line(statement);
                                              +
                                              3283  }
                                              +
                                              3284 
                                              +
                                              3285  if (info.conductances.empty()) {
                                              +
                                              3286  print_nrn_cur_non_conductance_kernel();
                                              +
                                              3287  } else {
                                              +
                                              3288  print_nrn_cur_conductance_kernel(node);
                                              +
                                              3289  }
                                              +
                                              3290 
                                              +
                                              3291  const auto& write_statements = ion_write_statements(BlockType::Equation);
                                              +
                                              3292  for (auto& statement: write_statements) {
                                              +
                                              3293  auto text = process_shadow_update_statement(statement, BlockType::Equation);
                                              +
                                              3294  printer->add_line(text);
                                              +
                                              3295  }
                                              +
                                              3296 
                                              +
                                              3297  if (info.point_process) {
                                              +
                                              3298  const auto& area = get_variable_name(naming::NODE_AREA_VARIABLE);
                                              +
                                              3299  printer->fmt_line("double mfactor = 1.e2/{};", area);
                                              +
                                              3300  printer->add_line("g = g*mfactor;");
                                              +
                                              3301  printer->add_line("rhs = rhs*mfactor;");
                                              +
                                              3302  }
                                              +
                                              3303 
                                              +
                                              3304  print_g_unused();
                                              3305 }
                                              3306 
                                              3307 
                                              - -
                                              3309  // nothing to do on cpu
                                              -
                                              3310 }
                                              -
                                              3311 
                                              -
                                              3312 
                                              -
                                              3313 /****************************************************************************************/
                                              -
                                              3314 /* Print nrn_state routine */
                                              -
                                              3315 /****************************************************************************************/
                                              -
                                              3316 
                                              -
                                              3317 
                                              - -
                                              3319  if (!nrn_state_required()) {
                                              -
                                              3320  return;
                                              + +
                                              3309  if (!info.electrode_current) {
                                              +
                                              3310  return;
                                              +
                                              3311  }
                                              +
                                              3312  std::string rhs, d;
                                              +
                                              3313  auto rhs_op = operator_for_rhs();
                                              +
                                              3314  auto d_op = operator_for_d();
                                              +
                                              3315  if (info.point_process) {
                                              +
                                              3316  rhs = "shadow_rhs[id]";
                                              +
                                              3317  d = "shadow_d[id]";
                                              +
                                              3318  } else {
                                              +
                                              3319  rhs = "rhs";
                                              +
                                              3320  d = "g";
                                              3321  }
                                              3322 
                                              -
                                              3323  printer->add_newline(2);
                                              -
                                              3324  printer->add_line("/** update state */");
                                              -
                                              3325  print_global_function_common_code(BlockType::State);
                                              -
                                              3326  print_channel_iteration_block_parallel_hint(BlockType::State, info.nrn_state_block);
                                              -
                                              3327  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              -
                                              3328 
                                              -
                                              3329  printer->add_line("int node_id = node_index[id];");
                                              -
                                              3330  printer->add_line("double v = voltage[node_id];");
                                              -
                                              3331  print_v_unused();
                                              -
                                              3332 
                                              -
                                              3333  /**
                                              -
                                              3334  * \todo Eigen solver node also emits IonCurVar variable in the functor
                                              -
                                              3335  * but that shouldn't update ions in derivative block
                                              -
                                              3336  */
                                              -
                                              3337  if (ion_variable_struct_required()) {
                                              -
                                              3338  print_ion_variable();
                                              -
                                              3339  }
                                              -
                                              3340 
                                              -
                                              3341  auto read_statements = ion_read_statements(BlockType::State);
                                              -
                                              3342  for (auto& statement: read_statements) {
                                              -
                                              3343  printer->add_line(statement);
                                              +
                                              3323  printer->push_block("if (nt->nrn_fast_imem)");
                                              +
                                              3324  if (nrn_cur_reduction_loop_required()) {
                                              +
                                              3325  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              +
                                              3326  printer->add_line("int node_id = node_index[id];");
                                              +
                                              3327  }
                                              +
                                              3328  printer->fmt_line("nt->nrn_fast_imem->nrn_sav_rhs[node_id] {} {};", rhs_op, rhs);
                                              +
                                              3329  printer->fmt_line("nt->nrn_fast_imem->nrn_sav_d[node_id] {} {};", d_op, d);
                                              +
                                              3330  if (nrn_cur_reduction_loop_required()) {
                                              +
                                              3331  printer->pop_block();
                                              +
                                              3332  }
                                              +
                                              3333  printer->pop_block();
                                              +
                                              3334 }
                                              +
                                              3335 
                                              +
                                              3336 
                                              + +
                                              3338  if (!nrn_cur_required()) {
                                              +
                                              3339  return;
                                              +
                                              3340  }
                                              +
                                              3341 
                                              +
                                              3342  if (info.conductances.empty()) {
                                              +
                                              3343  print_nrn_current(*info.breakpoint_node);
                                              3344  }
                                              3345 
                                              -
                                              3346  if (info.nrn_state_block) {
                                              -
                                              3347  info.nrn_state_block->visit_children(*this);
                                              -
                                              3348  }
                                              -
                                              3349 
                                              -
                                              3350  if (info.currents.empty() && info.breakpoint_node != nullptr) {
                                              -
                                              3351  auto block = info.breakpoint_node->get_statement_block();
                                              -
                                              3352  print_statement_block(*block, false, false);
                                              -
                                              3353  }
                                              -
                                              3354 
                                              -
                                              3355  const auto& write_statements = ion_write_statements(BlockType::State);
                                              -
                                              3356  for (auto& statement: write_statements) {
                                              -
                                              3357  const auto& text = process_shadow_update_statement(statement, BlockType::State);
                                              -
                                              3358  printer->add_line(text);
                                              -
                                              3359  }
                                              -
                                              3360  printer->pop_block();
                                              -
                                              3361 
                                              -
                                              3362  print_kernel_data_present_annotation_block_end();
                                              -
                                              3363 
                                              -
                                              3364  printer->pop_block();
                                              -
                                              3365 }
                                              -
                                              3366 
                                              -
                                              3367 
                                              -
                                              3368 /****************************************************************************************/
                                              -
                                              3369 /* Print nrn_cur related routines */
                                              +
                                              3346  printer->add_newline(2);
                                              +
                                              3347  printer->add_line("/** update current */");
                                              +
                                              3348  print_global_function_common_code(BlockType::Equation);
                                              +
                                              3349  print_channel_iteration_block_parallel_hint(BlockType::Equation, info.breakpoint_node);
                                              +
                                              3350  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              +
                                              3351  print_nrn_cur_kernel(*info.breakpoint_node);
                                              +
                                              3352  print_nrn_cur_matrix_shadow_update();
                                              +
                                              3353  if (!nrn_cur_reduction_loop_required()) {
                                              +
                                              3354  print_fast_imem_calculation();
                                              +
                                              3355  }
                                              +
                                              3356  printer->pop_block();
                                              +
                                              3357 
                                              +
                                              3358  if (nrn_cur_reduction_loop_required()) {
                                              +
                                              3359  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              +
                                              3360  print_nrn_cur_matrix_shadow_reduction();
                                              +
                                              3361  printer->pop_block();
                                              +
                                              3362  print_fast_imem_calculation();
                                              +
                                              3363  }
                                              +
                                              3364 
                                              +
                                              3365  print_kernel_data_present_annotation_block_end();
                                              +
                                              3366  printer->pop_block();
                                              +
                                              3367 }
                                              +
                                              3368 
                                              +
                                              3369 
                                              3370 /****************************************************************************************/
                                              -
                                              3371 
                                              -
                                              3372 
                                              - -
                                              3374  const auto& args = internal_method_parameters();
                                              -
                                              3375  const auto& block = node.get_statement_block();
                                              -
                                              3376  printer->add_newline(2);
                                              -
                                              3377  print_device_method_annotation();
                                              -
                                              3378  printer->fmt_push_block("inline double nrn_current_{}({})",
                                              -
                                              3379  info.mod_suffix,
                                              -
                                              3380  get_parameter_str(args));
                                              -
                                              3381  printer->add_line("double current = 0.0;");
                                              -
                                              3382  print_statement_block(*block, false, false);
                                              -
                                              3383  for (auto& current: info.currents) {
                                              -
                                              3384  const auto& name = get_variable_name(current);
                                              -
                                              3385  printer->fmt_line("current += {};", name);
                                              -
                                              3386  }
                                              -
                                              3387  printer->add_line("return current;");
                                              -
                                              3388  printer->pop_block();
                                              -
                                              3389 }
                                              -
                                              3390 
                                              +
                                              3371 /* Main code printing entry points */
                                              +
                                              3372 /****************************************************************************************/
                                              +
                                              3373 
                                              + +
                                              3375  print_standard_includes();
                                              +
                                              3376  print_backend_includes();
                                              +
                                              3377  print_coreneuron_includes();
                                              +
                                              3378 }
                                              +
                                              3379 
                                              +
                                              3380 
                                              + +
                                              3382  print_namespace_start();
                                              +
                                              3383  print_backend_namespace_start();
                                              +
                                              3384 }
                                              +
                                              3385 
                                              +
                                              3386 
                                              + +
                                              3388  print_backend_namespace_stop();
                                              +
                                              3389  print_namespace_stop();
                                              +
                                              3390 }
                                              3391 
                                              - -
                                              3393  const auto& block = node.get_statement_block();
                                              -
                                              3394  print_statement_block(*block, false, false);
                                              -
                                              3395  if (!info.currents.empty()) {
                                              -
                                              3396  std::string sum;
                                              -
                                              3397  for (const auto& current: info.currents) {
                                              -
                                              3398  auto var = breakpoint_current(current);
                                              -
                                              3399  sum += get_variable_name(var);
                                              -
                                              3400  if (&current != &info.currents.back()) {
                                              -
                                              3401  sum += "+";
                                              -
                                              3402  }
                                              -
                                              3403  }
                                              -
                                              3404  printer->fmt_line("double rhs = {};", sum);
                                              -
                                              3405  }
                                              -
                                              3406 
                                              -
                                              3407  std::string sum;
                                              -
                                              3408  for (const auto& conductance: info.conductances) {
                                              -
                                              3409  auto var = breakpoint_current(conductance.variable);
                                              -
                                              3410  sum += get_variable_name(var);
                                              -
                                              3411  if (&conductance != &info.conductances.back()) {
                                              -
                                              3412  sum += "+";
                                              -
                                              3413  }
                                              +
                                              3392 
                                              + +
                                              3394  print_first_pointer_var_index_getter();
                                              +
                                              3395  print_first_random_var_index_getter();
                                              +
                                              3396  print_net_receive_arg_size_getter();
                                              +
                                              3397  print_thread_getters();
                                              +
                                              3398  print_num_variable_getter();
                                              +
                                              3399  print_mech_type_getter();
                                              +
                                              3400  print_memb_list_getter();
                                              +
                                              3401 }
                                              +
                                              3402 
                                              +
                                              3403 
                                              + +
                                              3405  print_mechanism_global_var_structure(print_initializers);
                                              +
                                              3406  print_mechanism_range_var_structure(print_initializers);
                                              +
                                              3407  print_ion_var_structure();
                                              +
                                              3408 }
                                              +
                                              3409 
                                              +
                                              3410 
                                              + +
                                              3412  if (!info.vectorize) {
                                              +
                                              3413  return;
                                              3414  }
                                              -
                                              3415  printer->fmt_line("double g = {};", sum);
                                              -
                                              3416 
                                              -
                                              3417  for (const auto& conductance: info.conductances) {
                                              -
                                              3418  if (!conductance.ion.empty()) {
                                              -
                                              3419  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + conductance.ion + "dv";
                                              -
                                              3420  const auto& rhs = get_variable_name(conductance.variable);
                                              -
                                              3421  const ShadowUseStatement statement{lhs, "+=", rhs};
                                              -
                                              3422  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                                              -
                                              3423  printer->add_line(text);
                                              -
                                              3424  }
                                              -
                                              3425  }
                                              -
                                              3426 }
                                              -
                                              3427 
                                              -
                                              3428 
                                              - -
                                              3430  printer->fmt_line("double g = nrn_current_{}({}+0.001);",
                                              -
                                              3431  info.mod_suffix,
                                              -
                                              3432  internal_method_arguments());
                                              -
                                              3433  for (auto& ion: info.ions) {
                                              -
                                              3434  for (auto& var: ion.writes) {
                                              -
                                              3435  if (ion.is_ionic_current(var)) {
                                              -
                                              3436  const auto& name = get_variable_name(var);
                                              -
                                              3437  printer->fmt_line("double di{} = {};", ion.name, name);
                                              -
                                              3438  }
                                              -
                                              3439  }
                                              -
                                              3440  }
                                              -
                                              3441  printer->fmt_line("double rhs = nrn_current_{}({});",
                                              -
                                              3442  info.mod_suffix,
                                              -
                                              3443  internal_method_arguments());
                                              -
                                              3444  printer->add_line("g = (g-rhs)/0.001;");
                                              -
                                              3445  for (auto& ion: info.ions) {
                                              -
                                              3446  for (auto& var: ion.writes) {
                                              -
                                              3447  if (ion.is_ionic_current(var)) {
                                              -
                                              3448  const auto& lhs = std::string(naming::ION_VARNAME_PREFIX) + "di" + ion.name + "dv";
                                              -
                                              3449  auto rhs = fmt::format("(di{}-{})/0.001", ion.name, get_variable_name(var));
                                              -
                                              3450  if (info.point_process) {
                                              -
                                              3451  auto area = get_variable_name(naming::NODE_AREA_VARIABLE);
                                              -
                                              3452  rhs += fmt::format("*1.e2/{}", area);
                                              -
                                              3453  }
                                              -
                                              3454  const ShadowUseStatement statement{lhs, "+=", rhs};
                                              -
                                              3455  const auto& text = process_shadow_update_statement(statement, BlockType::Equation);
                                              -
                                              3456  printer->add_line(text);
                                              -
                                              3457  }
                                              -
                                              3458  }
                                              -
                                              3459  }
                                              +
                                              3415  printer->add_multi_line(R"CODE(
                                              +
                                              3416  #if NRN_PRCELLSTATE
                                              +
                                              3417  inst->v_unused[id] = v;
                                              +
                                              3418  #endif
                                              +
                                              3419  )CODE");
                                              +
                                              3420 }
                                              +
                                              3421 
                                              +
                                              3422 
                                              + +
                                              3424  printer->add_multi_line(R"CODE(
                                              +
                                              3425  #if NRN_PRCELLSTATE
                                              +
                                              3426  inst->g_unused[id] = g;
                                              +
                                              3427  #endif
                                              +
                                              3428  )CODE");
                                              +
                                              3429 }
                                              +
                                              3430 
                                              +
                                              3431 
                                              + +
                                              3433  print_top_verbatim_blocks();
                                              +
                                              3434  for (const auto& procedure: info.procedures) {
                                              +
                                              3435  print_procedure(*procedure);
                                              +
                                              3436  }
                                              +
                                              3437  for (const auto& function: info.functions) {
                                              +
                                              3438  print_function(*function);
                                              +
                                              3439  }
                                              +
                                              3440  for (const auto& function: info.function_tables) {
                                              +
                                              3441  print_function_tables(*function);
                                              +
                                              3442  }
                                              +
                                              3443  for (size_t i = 0; i < info.before_after_blocks.size(); i++) {
                                              +
                                              3444  print_before_after_block(info.before_after_blocks[i], i);
                                              +
                                              3445  }
                                              +
                                              3446  for (const auto& callback: info.derivimplicit_callbacks) {
                                              +
                                              3447  const auto& block = *callback->get_node_to_solve();
                                              +
                                              3448  print_derivimplicit_kernel(block);
                                              +
                                              3449  }
                                              +
                                              3450  print_net_send_buffering();
                                              +
                                              3451  print_net_init();
                                              +
                                              3452  print_watch_activate();
                                              +
                                              3453  print_watch_check();
                                              +
                                              3454  print_net_receive_kernel();
                                              +
                                              3455  print_net_receive();
                                              +
                                              3456  print_net_receive_buffering();
                                              +
                                              3457  print_nrn_init();
                                              +
                                              3458  print_nrn_cur();
                                              +
                                              3459  print_nrn_state();
                                              3460 }
                                              3461 
                                              3462 
                                              - -
                                              3464  printer->add_line("int node_id = node_index[id];");
                                              -
                                              3465  printer->add_line("double v = voltage[node_id];");
                                              -
                                              3466  print_v_unused();
                                              -
                                              3467  if (ion_variable_struct_required()) {
                                              -
                                              3468  print_ion_variable();
                                              -
                                              3469  }
                                              -
                                              3470 
                                              -
                                              3471  const auto& read_statements = ion_read_statements(BlockType::Equation);
                                              -
                                              3472  for (auto& statement: read_statements) {
                                              -
                                              3473  printer->add_line(statement);
                                              -
                                              3474  }
                                              -
                                              3475 
                                              -
                                              3476  if (info.conductances.empty()) {
                                              -
                                              3477  print_nrn_cur_non_conductance_kernel();
                                              -
                                              3478  } else {
                                              -
                                              3479  print_nrn_cur_conductance_kernel(node);
                                              -
                                              3480  }
                                              -
                                              3481 
                                              -
                                              3482  const auto& write_statements = ion_write_statements(BlockType::Equation);
                                              -
                                              3483  for (auto& statement: write_statements) {
                                              -
                                              3484  auto text = process_shadow_update_statement(statement, BlockType::Equation);
                                              -
                                              3485  printer->add_line(text);
                                              -
                                              3486  }
                                              + +
                                              3464  print_backend_info();
                                              +
                                              3465  print_headers_include();
                                              +
                                              3466  print_namespace_begin();
                                              +
                                              3467  print_nmodl_constants();
                                              +
                                              3468  print_prcellstate_macros();
                                              +
                                              3469  print_mechanism_info();
                                              +
                                              3470  print_data_structures(true);
                                              +
                                              3471  print_global_variables_for_hoc();
                                              +
                                              3472  print_common_getters();
                                              +
                                              3473  print_memory_allocation_routine();
                                              +
                                              3474  print_abort_routine();
                                              +
                                              3475  print_thread_memory_callbacks();
                                              +
                                              3476  print_instance_variable_setup();
                                              +
                                              3477  print_nrn_alloc();
                                              +
                                              3478  print_nrn_constructor();
                                              +
                                              3479  print_nrn_destructor();
                                              +
                                              3480  print_function_prototypes();
                                              +
                                              3481  print_functors_definitions();
                                              +
                                              3482  print_compute_functions();
                                              +
                                              3483  print_check_table_thread_function();
                                              +
                                              3484  print_mechanism_register();
                                              +
                                              3485  print_namespace_end();
                                              +
                                              3486 }
                                              3487 
                                              -
                                              3488  if (info.point_process) {
                                              -
                                              3489  const auto& area = get_variable_name(naming::NODE_AREA_VARIABLE);
                                              -
                                              3490  printer->fmt_line("double mfactor = 1.e2/{};", area);
                                              -
                                              3491  printer->add_line("g = g*mfactor;");
                                              -
                                              3492  printer->add_line("rhs = rhs*mfactor;");
                                              -
                                              3493  }
                                              -
                                              3494 
                                              -
                                              3495  print_g_unused();
                                              -
                                              3496 }
                                              -
                                              3497 
                                              -
                                              3498 
                                              - -
                                              3500  if (!info.electrode_current) {
                                              -
                                              3501  return;
                                              -
                                              3502  }
                                              -
                                              3503  std::string rhs, d;
                                              -
                                              3504  auto rhs_op = operator_for_rhs();
                                              -
                                              3505  auto d_op = operator_for_d();
                                              -
                                              3506  if (info.point_process) {
                                              -
                                              3507  rhs = "shadow_rhs[id]";
                                              -
                                              3508  d = "shadow_d[id]";
                                              -
                                              3509  } else {
                                              -
                                              3510  rhs = "rhs";
                                              -
                                              3511  d = "g";
                                              -
                                              3512  }
                                              +
                                              3488 
                                              +
                                              3489 /****************************************************************************************/
                                              +
                                              3490 /* Overloaded visitor routines */
                                              +
                                              3491 /****************************************************************************************/
                                              +
                                              3492 
                                              +
                                              3493 
                                              + +
                                              3495  printer->fmt_line("{}_{}({});",
                                              +
                                              3496  node.get_node_to_solve()->get_node_name(),
                                              +
                                              3497  info.mod_suffix,
                                              +
                                              3498  external_method_arguments());
                                              +
                                              3499 }
                                              +
                                              3500 
                                              +
                                              3501 
                                              + +
                                              3503  const ast::EigenNewtonSolverBlock& node) {
                                              +
                                              3504  // solution vector to store copy of state vars for Newton solver
                                              +
                                              3505  printer->add_newline();
                                              +
                                              3506 
                                              +
                                              3507  auto float_type = default_float_data_type();
                                              +
                                              3508  int N = node.get_n_state_vars()->get_value();
                                              +
                                              3509  printer->fmt_line("Eigen::Matrix<{}, {}, 1> nmodl_eigen_xm;", float_type, N);
                                              +
                                              3510  printer->fmt_line("{}* nmodl_eigen_x = nmodl_eigen_xm.data();", float_type);
                                              +
                                              3511 
                                              +
                                              3512  print_statement_block(*node.get_setup_x_block(), false, false);
                                              3513 
                                              -
                                              3514  printer->push_block("if (nt->nrn_fast_imem)");
                                              -
                                              3515  if (nrn_cur_reduction_loop_required()) {
                                              -
                                              3516  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              -
                                              3517  printer->add_line("int node_id = node_index[id];");
                                              -
                                              3518  }
                                              -
                                              3519  printer->fmt_line("nt->nrn_fast_imem->nrn_sav_rhs[node_id] {} {};", rhs_op, rhs);
                                              -
                                              3520  printer->fmt_line("nt->nrn_fast_imem->nrn_sav_d[node_id] {} {};", d_op, d);
                                              -
                                              3521  if (nrn_cur_reduction_loop_required()) {
                                              -
                                              3522  printer->pop_block();
                                              -
                                              3523  }
                                              -
                                              3524  printer->pop_block();
                                              -
                                              3525 }
                                              -
                                              3526 
                                              -
                                              3527 
                                              - -
                                              3529  if (!nrn_cur_required()) {
                                              -
                                              3530  return;
                                              -
                                              3531  }
                                              -
                                              3532 
                                              -
                                              3533  if (info.conductances.empty()) {
                                              -
                                              3534  print_nrn_current(*info.breakpoint_node);
                                              -
                                              3535  }
                                              -
                                              3536 
                                              -
                                              3537  printer->add_newline(2);
                                              -
                                              3538  printer->add_line("/** update current */");
                                              -
                                              3539  print_global_function_common_code(BlockType::Equation);
                                              -
                                              3540  print_channel_iteration_block_parallel_hint(BlockType::Equation, info.breakpoint_node);
                                              -
                                              3541  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              -
                                              3542  print_nrn_cur_kernel(*info.breakpoint_node);
                                              -
                                              3543  print_nrn_cur_matrix_shadow_update();
                                              -
                                              3544  if (!nrn_cur_reduction_loop_required()) {
                                              -
                                              3545  print_fast_imem_calculation();
                                              -
                                              3546  }
                                              -
                                              3547  printer->pop_block();
                                              -
                                              3548 
                                              -
                                              3549  if (nrn_cur_reduction_loop_required()) {
                                              -
                                              3550  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              -
                                              3551  print_nrn_cur_matrix_shadow_reduction();
                                              -
                                              3552  printer->pop_block();
                                              -
                                              3553  print_fast_imem_calculation();
                                              -
                                              3554  }
                                              +
                                              3514  // call newton solver with functor and X matrix that contains state vars
                                              +
                                              3515  printer->add_line("// call newton solver");
                                              +
                                              3516  printer->fmt_line("{} newton_functor(nt, inst, id, pnodecount, v, indexes, data, thread);",
                                              +
                                              3517  info.functor_names[&node]);
                                              +
                                              3518  printer->add_line("newton_functor.initialize();");
                                              +
                                              3519  printer->add_line(
                                              +
                                              3520  "int newton_iterations = nmodl::newton::newton_solver(nmodl_eigen_xm, newton_functor);");
                                              +
                                              3521  printer->add_line(
                                              +
                                              3522  "if (newton_iterations < 0) assert(false && \"Newton solver did not converge!\");");
                                              +
                                              3523 
                                              +
                                              3524  // assign newton solver results in matrix X to state vars
                                              +
                                              3525  print_statement_block(*node.get_update_states_block(), false, false);
                                              +
                                              3526  printer->add_line("newton_functor.finalize();");
                                              +
                                              3527 }
                                              +
                                              3528 
                                              +
                                              3529 
                                              + +
                                              3531  const ast::EigenLinearSolverBlock& node) {
                                              +
                                              3532  printer->add_newline();
                                              +
                                              3533 
                                              +
                                              3534  const std::string float_type = default_float_data_type();
                                              +
                                              3535  int N = node.get_n_state_vars()->get_value();
                                              +
                                              3536  printer->fmt_line("Eigen::Matrix<{0}, {1}, 1> nmodl_eigen_xm, nmodl_eigen_fm;", float_type, N);
                                              +
                                              3537  printer->fmt_line("Eigen::Matrix<{0}, {1}, {1}> nmodl_eigen_jm;", float_type, N);
                                              +
                                              3538  if (N <= 4)
                                              +
                                              3539  printer->fmt_line("Eigen::Matrix<{0}, {1}, {1}> nmodl_eigen_jm_inv;", float_type, N);
                                              +
                                              3540  printer->fmt_line("{}* nmodl_eigen_x = nmodl_eigen_xm.data();", float_type);
                                              +
                                              3541  printer->fmt_line("{}* nmodl_eigen_j = nmodl_eigen_jm.data();", float_type);
                                              +
                                              3542  printer->fmt_line("{}* nmodl_eigen_f = nmodl_eigen_fm.data();", float_type);
                                              +
                                              3543  print_statement_block(*node.get_variable_block(), false, false);
                                              +
                                              3544  print_statement_block(*node.get_initialize_block(), false, false);
                                              +
                                              3545  print_statement_block(*node.get_setup_x_block(), false, false);
                                              +
                                              3546 
                                              +
                                              3547  printer->add_newline();
                                              +
                                              3548  print_eigen_linear_solver(float_type, N);
                                              +
                                              3549  printer->add_newline();
                                              +
                                              3550 
                                              +
                                              3551  print_statement_block(*node.get_update_states_block(), false, false);
                                              +
                                              3552  print_statement_block(*node.get_finalize_block(), false, false);
                                              +
                                              3553 }
                                              +
                                              3554 
                                              3555 
                                              -
                                              3556  print_kernel_data_present_annotation_block_end();
                                              -
                                              3557  printer->pop_block();
                                              -
                                              3558 }
                                              -
                                              3559 
                                              -
                                              3560 
                                              -
                                              3561 /****************************************************************************************/
                                              -
                                              3562 /* Main code printing entry points */
                                              -
                                              3563 /****************************************************************************************/
                                              -
                                              3564 
                                              - -
                                              3566  print_standard_includes();
                                              -
                                              3567  print_backend_includes();
                                              -
                                              3568  print_coreneuron_includes();
                                              -
                                              3569 }
                                              -
                                              3570 
                                              -
                                              3571 
                                              - -
                                              3573  print_namespace_start();
                                              -
                                              3574  print_backend_namespace_start();
                                              -
                                              3575 }
                                              -
                                              3576 
                                              + +
                                              3557  // For_netcon should take the same arguments as net_receive and apply the operations
                                              +
                                              3558  // in the block to the weights of the netcons. Since all the weights are on the same vector,
                                              +
                                              3559  // weights, we have a mask of operations that we apply iteratively, advancing the offset
                                              +
                                              3560  // to the next netcon.
                                              +
                                              3561  const auto& args = node.get_parameters();
                                              +
                                              3562  RenameVisitor v;
                                              +
                                              3563  const auto& statement_block = node.get_statement_block();
                                              +
                                              3564  for (size_t i_arg = 0; i_arg < args.size(); ++i_arg) {
                                              +
                                              3565  // sanitize node_name since we want to substitute names like (*w) as they are
                                              +
                                              3566  auto old_name =
                                              +
                                              3567  std::regex_replace(args[i_arg]->get_node_name(), regex_special_chars, R"(\$&)");
                                              +
                                              3568  const auto& new_name = fmt::format("weights[{} + nt->_fornetcon_weight_perm[i]]", i_arg);
                                              +
                                              3569  v.set(old_name, new_name);
                                              +
                                              3570  statement_block->accept(v);
                                              +
                                              3571  }
                                              +
                                              3572 
                                              +
                                              3573  const auto index =
                                              +
                                              3574  std::find_if(info.semantics.begin(), info.semantics.end(), [](const IndexSemantics& a) {
                                              +
                                              3575  return a.name == naming::FOR_NETCON_SEMANTIC;
                                              +
                                              3576  })->index;
                                              3577 
                                              - -
                                              3579  print_backend_namespace_stop();
                                              -
                                              3580  print_namespace_stop();
                                              -
                                              3581 }
                                              -
                                              3582 
                                              -
                                              3583 
                                              - -
                                              3585  print_first_pointer_var_index_getter();
                                              -
                                              3586  print_first_random_var_index_getter();
                                              -
                                              3587  print_net_receive_arg_size_getter();
                                              -
                                              3588  print_thread_getters();
                                              -
                                              3589  print_num_variable_getter();
                                              -
                                              3590  print_mech_type_getter();
                                              -
                                              3591  print_memb_list_getter();
                                              -
                                              3592 }
                                              +
                                              3578  printer->fmt_text("const size_t offset = {}*pnodecount + id;", index);
                                              +
                                              3579  printer->add_newline();
                                              +
                                              3580  printer->add_line(
                                              +
                                              3581  "const size_t for_netcon_start = nt->_fornetcon_perm_indices[indexes[offset]];");
                                              +
                                              3582  printer->add_line(
                                              +
                                              3583  "const size_t for_netcon_end = nt->_fornetcon_perm_indices[indexes[offset] + 1];");
                                              +
                                              3584 
                                              +
                                              3585  printer->add_line("for (auto i = for_netcon_start; i < for_netcon_end; ++i) {");
                                              +
                                              3586  printer->increase_indent();
                                              +
                                              3587  print_statement_block(*statement_block, false, false);
                                              +
                                              3588  printer->decrease_indent();
                                              +
                                              3589 
                                              +
                                              3590  printer->add_line("}");
                                              +
                                              3591 }
                                              +
                                              3592 
                                              3593 
                                              -
                                              3594 
                                              - -
                                              3596  print_mechanism_global_var_structure(print_initializers);
                                              -
                                              3597  print_mechanism_range_var_structure(print_initializers);
                                              -
                                              3598  print_ion_var_structure();
                                              -
                                              3599 }
                                              -
                                              3600 
                                              -
                                              3601 
                                              - -
                                              3603  if (!info.vectorize) {
                                              -
                                              3604  return;
                                              -
                                              3605  }
                                              -
                                              3606  printer->add_multi_line(R"CODE(
                                              -
                                              3607  #if NRN_PRCELLSTATE
                                              -
                                              3608  inst->v_unused[id] = v;
                                              -
                                              3609  #endif
                                              -
                                              3610  )CODE");
                                              -
                                              3611 }
                                              -
                                              3612 
                                              -
                                              3613 
                                              - -
                                              3615  printer->add_multi_line(R"CODE(
                                              -
                                              3616  #if NRN_PRCELLSTATE
                                              -
                                              3617  inst->g_unused[id] = g;
                                              -
                                              3618  #endif
                                              -
                                              3619  )CODE");
                                              -
                                              3620 }
                                              -
                                              3621 
                                              -
                                              3622 
                                              - -
                                              3624  print_top_verbatim_blocks();
                                              -
                                              3625  for (const auto& procedure: info.procedures) {
                                              -
                                              3626  print_procedure(*procedure);
                                              -
                                              3627  }
                                              -
                                              3628  for (const auto& function: info.functions) {
                                              -
                                              3629  print_function(*function);
                                              -
                                              3630  }
                                              -
                                              3631  for (const auto& function: info.function_tables) {
                                              -
                                              3632  print_function_tables(*function);
                                              -
                                              3633  }
                                              -
                                              3634  for (size_t i = 0; i < info.before_after_blocks.size(); i++) {
                                              -
                                              3635  print_before_after_block(info.before_after_blocks[i], i);
                                              -
                                              3636  }
                                              -
                                              3637  for (const auto& callback: info.derivimplicit_callbacks) {
                                              -
                                              3638  const auto& block = *callback->get_node_to_solve();
                                              -
                                              3639  print_derivimplicit_kernel(block);
                                              -
                                              3640  }
                                              -
                                              3641  print_net_send_buffering();
                                              -
                                              3642  print_net_init();
                                              -
                                              3643  print_watch_activate();
                                              -
                                              3644  print_watch_check();
                                              -
                                              3645  print_net_receive_kernel();
                                              -
                                              3646  print_net_receive();
                                              -
                                              3647  print_net_receive_buffering();
                                              -
                                              3648  print_nrn_init();
                                              -
                                              3649  print_nrn_cur();
                                              -
                                              3650  print_nrn_state();
                                              -
                                              3651 }
                                              -
                                              3652 
                                              -
                                              3653 
                                              - -
                                              3655  print_backend_info();
                                              -
                                              3656  print_headers_include();
                                              -
                                              3657  print_namespace_begin();
                                              -
                                              3658  print_nmodl_constants();
                                              -
                                              3659  print_prcellstate_macros();
                                              -
                                              3660  print_mechanism_info();
                                              -
                                              3661  print_data_structures(true);
                                              -
                                              3662  print_global_variables_for_hoc();
                                              -
                                              3663  print_common_getters();
                                              -
                                              3664  print_memory_allocation_routine();
                                              -
                                              3665  print_abort_routine();
                                              -
                                              3666  print_thread_memory_callbacks();
                                              -
                                              3667  print_instance_variable_setup();
                                              -
                                              3668  print_nrn_alloc();
                                              -
                                              3669  print_nrn_constructor();
                                              -
                                              3670  print_nrn_destructor();
                                              -
                                              3671  print_function_prototypes();
                                              -
                                              3672  print_functors_definitions();
                                              -
                                              3673  print_compute_functions();
                                              -
                                              3674  print_check_table_thread_function();
                                              -
                                              3675  print_mechanism_register();
                                              -
                                              3676  print_namespace_end();
                                              -
                                              3677 }
                                              -
                                              3678 
                                              -
                                              3679 
                                              -
                                              3680 /****************************************************************************************/
                                              -
                                              3681 /* Overloaded visitor routines */
                                              -
                                              3682 /****************************************************************************************/
                                              -
                                              3683 
                                              -
                                              3684 
                                              - -
                                              3686  printer->fmt_line("{}_{}({});",
                                              -
                                              3687  node.get_node_to_solve()->get_node_name(),
                                              -
                                              3688  info.mod_suffix,
                                              -
                                              3689  external_method_arguments());
                                              -
                                              3690 }
                                              -
                                              3691 
                                              -
                                              3692 
                                              - -
                                              3694  const ast::EigenNewtonSolverBlock& node) {
                                              -
                                              3695  // solution vector to store copy of state vars for Newton solver
                                              -
                                              3696  printer->add_newline();
                                              -
                                              3697 
                                              -
                                              3698  auto float_type = default_float_data_type();
                                              -
                                              3699  int N = node.get_n_state_vars()->get_value();
                                              -
                                              3700  printer->fmt_line("Eigen::Matrix<{}, {}, 1> nmodl_eigen_xm;", float_type, N);
                                              -
                                              3701  printer->fmt_line("{}* nmodl_eigen_x = nmodl_eigen_xm.data();", float_type);
                                              -
                                              3702 
                                              -
                                              3703  print_statement_block(*node.get_setup_x_block(), false, false);
                                              -
                                              3704 
                                              -
                                              3705  // call newton solver with functor and X matrix that contains state vars
                                              -
                                              3706  printer->add_line("// call newton solver");
                                              -
                                              3707  printer->fmt_line("{} newton_functor(nt, inst, id, pnodecount, v, indexes, data, thread);",
                                              -
                                              3708  info.functor_names[&node]);
                                              -
                                              3709  printer->add_line("newton_functor.initialize();");
                                              -
                                              3710  printer->add_line(
                                              -
                                              3711  "int newton_iterations = nmodl::newton::newton_solver(nmodl_eigen_xm, newton_functor);");
                                              -
                                              3712  printer->add_line(
                                              -
                                              3713  "if (newton_iterations < 0) assert(false && \"Newton solver did not converge!\");");
                                              -
                                              3714 
                                              -
                                              3715  // assign newton solver results in matrix X to state vars
                                              -
                                              3716  print_statement_block(*node.get_update_states_block(), false, false);
                                              -
                                              3717  printer->add_line("newton_functor.finalize();");
                                              -
                                              3718 }
                                              -
                                              3719 
                                              -
                                              3720 
                                              - -
                                              3722  const ast::EigenLinearSolverBlock& node) {
                                              -
                                              3723  printer->add_newline();
                                              -
                                              3724 
                                              -
                                              3725  const std::string float_type = default_float_data_type();
                                              -
                                              3726  int N = node.get_n_state_vars()->get_value();
                                              -
                                              3727  printer->fmt_line("Eigen::Matrix<{0}, {1}, 1> nmodl_eigen_xm, nmodl_eigen_fm;", float_type, N);
                                              -
                                              3728  printer->fmt_line("Eigen::Matrix<{0}, {1}, {1}> nmodl_eigen_jm;", float_type, N);
                                              -
                                              3729  if (N <= 4)
                                              -
                                              3730  printer->fmt_line("Eigen::Matrix<{0}, {1}, {1}> nmodl_eigen_jm_inv;", float_type, N);
                                              -
                                              3731  printer->fmt_line("{}* nmodl_eigen_x = nmodl_eigen_xm.data();", float_type);
                                              -
                                              3732  printer->fmt_line("{}* nmodl_eigen_j = nmodl_eigen_jm.data();", float_type);
                                              -
                                              3733  printer->fmt_line("{}* nmodl_eigen_f = nmodl_eigen_fm.data();", float_type);
                                              -
                                              3734  print_statement_block(*node.get_variable_block(), false, false);
                                              -
                                              3735  print_statement_block(*node.get_initialize_block(), false, false);
                                              -
                                              3736  print_statement_block(*node.get_setup_x_block(), false, false);
                                              -
                                              3737 
                                              -
                                              3738  printer->add_newline();
                                              -
                                              3739  print_eigen_linear_solver(float_type, N);
                                              -
                                              3740  printer->add_newline();
                                              -
                                              3741 
                                              -
                                              3742  print_statement_block(*node.get_update_states_block(), false, false);
                                              -
                                              3743  print_statement_block(*node.get_finalize_block(), false, false);
                                              -
                                              3744 }
                                              -
                                              3745 
                                              -
                                              3746 
                                              - -
                                              3748  // For_netcon should take the same arguments as net_receive and apply the operations
                                              -
                                              3749  // in the block to the weights of the netcons. Since all the weights are on the same vector,
                                              -
                                              3750  // weights, we have a mask of operations that we apply iteratively, advancing the offset
                                              -
                                              3751  // to the next netcon.
                                              -
                                              3752  const auto& args = node.get_parameters();
                                              -
                                              3753  RenameVisitor v;
                                              -
                                              3754  const auto& statement_block = node.get_statement_block();
                                              -
                                              3755  for (size_t i_arg = 0; i_arg < args.size(); ++i_arg) {
                                              -
                                              3756  // sanitize node_name since we want to substitute names like (*w) as they are
                                              -
                                              3757  auto old_name =
                                              -
                                              3758  std::regex_replace(args[i_arg]->get_node_name(), regex_special_chars, R"(\$&)");
                                              -
                                              3759  const auto& new_name = fmt::format("weights[{} + nt->_fornetcon_weight_perm[i]]", i_arg);
                                              -
                                              3760  v.set(old_name, new_name);
                                              -
                                              3761  statement_block->accept(v);
                                              -
                                              3762  }
                                              -
                                              3763 
                                              -
                                              3764  const auto index =
                                              -
                                              3765  std::find_if(info.semantics.begin(), info.semantics.end(), [](const IndexSemantics& a) {
                                              -
                                              3766  return a.name == naming::FOR_NETCON_SEMANTIC;
                                              -
                                              3767  })->index;
                                              -
                                              3768 
                                              -
                                              3769  printer->fmt_text("const size_t offset = {}*pnodecount + id;", index);
                                              -
                                              3770  printer->add_newline();
                                              -
                                              3771  printer->add_line(
                                              -
                                              3772  "const size_t for_netcon_start = nt->_fornetcon_perm_indices[indexes[offset]];");
                                              -
                                              3773  printer->add_line(
                                              -
                                              3774  "const size_t for_netcon_end = nt->_fornetcon_perm_indices[indexes[offset] + 1];");
                                              -
                                              3775 
                                              -
                                              3776  printer->add_line("for (auto i = for_netcon_start; i < for_netcon_end; ++i) {");
                                              -
                                              3777  printer->increase_indent();
                                              -
                                              3778  print_statement_block(*statement_block, false, false);
                                              -
                                              3779  printer->decrease_indent();
                                              -
                                              3780 
                                              -
                                              3781  printer->add_line("}");
                                              -
                                              3782 }
                                              -
                                              3783 
                                              -
                                              3784 
                                              - -
                                              3786  printer->add_text(fmt::format("nrn_watch_activate(inst, id, pnodecount, {}, v, watch_remove)",
                                              -
                                              3787  current_watch_statement++));
                                              -
                                              3788 }
                                              -
                                              3789 
                                              -
                                              3790 } // namespace codegen
                                              -
                                              3791 } // namespace nmodl
                                              + +
                                              3595  printer->add_text(fmt::format("nrn_watch_activate(inst, id, pnodecount, {}, v, watch_remove)",
                                              +
                                              3596  current_watch_statement++));
                                              +
                                              3597 }
                                              +
                                              3598 
                                              +
                                              3599 } // namespace codegen
                                              +
                                              3600 } // namespace nmodl
                                              -
                                              static const TableStatement * get_table_statement(const ast::Block &node)
                                              -
                                              virtual void print_procedure(const ast::ProcedureBlock &node) override
                                              Print NMODL procedure in target backend code.
                                              -
                                              virtual void print_device_method_annotation()
                                              Print the backend specific device method annotation.
                                              +
                                              static const TableStatement * get_table_statement(const ast::Block &node)
                                              +
                                              virtual void print_procedure(const ast::ProcedureBlock &node) override
                                              Print NMODL procedure in target backend code.
                                              +
                                              virtual void print_device_method_annotation()
                                              Print the backend specific device method annotation.
                                              Represents a BEFORE block in NMODL.
                                              -
                                              void print_coreneuron_includes()
                                              Print includes from coreneuron.
                                              -
                                              virtual std::string net_receive_buffering_declaration()
                                              Generate the target backend code for the net_receive_buffering function delcaration.
                                              +
                                              void print_coreneuron_includes()
                                              Print includes from coreneuron.
                                              +
                                              virtual std::string net_receive_buffering_declaration()
                                              Generate the target backend code for the net_receive_buffering function delcaration.
                                              std::shared_ptr< Block > get_node_to_solve() const noexcept
                                              Getter for member variable DerivimplicitCallback::node_to_solve.
                                              -
                                              virtual bool nrn_cur_reduction_loop_required()
                                              Check if reduction block in nrn_cur required.
                                              -
                                              virtual void print_backend_namespace_start()
                                              Prints the start of namespace for the backend-specific code.
                                              -
                                              void print_net_move_call(const ast::FunctionCall &node) override
                                              Print call to net_move.
                                              +
                                              virtual bool nrn_cur_reduction_loop_required()
                                              Check if reduction block in nrn_cur required.
                                              +
                                              virtual void print_backend_namespace_start()
                                              Prints the start of namespace for the backend-specific code.
                                              +
                                              void print_net_move_call(const ast::FunctionCall &node) override
                                              Print call to net_move.
                                              Base class for all AST node.
                                              Definition: node.hpp:40
                                              -
                                              void print_mechanism_range_var_structure(bool print_initializers) override
                                              Print the structure that wraps all range and int variables required for the NMODL.
                                              +
                                              void print_mechanism_range_var_structure(bool print_initializers) override
                                              Print the structure that wraps all range and int variables required for the NMODL.
                                              bool is_index
                                              if this is pure index (e.g.
                                              static constexpr char CELSIUS_VARIABLE[]
                                              global temperature variable
                                              -
                                              virtual void print_net_send_buf_count_update_to_host() const
                                              Print the code to update NetSendBuffer_t count from device to host.
                                              +
                                              virtual void print_net_send_buf_count_update_to_host() const
                                              Print the code to update NetSendBuffer_t count from device to host.
                                              -
                                              void print_function_prototypes() override
                                              Print function and procedures prototype declaration.
                                              -
                                              void print_functors_definitions()
                                              Go through the map of EigenNewtonSolverBlock s and their corresponding functor names and print the fu...
                                              -
                                              void print_namespace_stop() override
                                              Prints the end of the coreneuron namespace.
                                              +
                                              void print_function_prototypes() override
                                              Print function and procedures prototype declaration.
                                              +
                                              void print_functors_definitions()
                                              Go through the map of EigenNewtonSolverBlock s and their corresponding functor names and print the fu...
                                              +
                                              void print_namespace_stop() override
                                              Prints the end of the coreneuron namespace.
                                              Helper to represent information about index/int variables.
                                              -
                                              void print_v_unused() const override
                                              Set v_unused (voltage) for NRN_PRCELLSTATE feature.
                                              +
                                              void print_v_unused() const override
                                              Set v_unused (voltage) for NRN_PRCELLSTATE feature.
                                              DUState
                                              Represent a state in Def-Use chain.
                                              -
                                              virtual void print_ion_variable()
                                              Print the ion variable struct.
                                              -
                                              void print_derivimplicit_kernel(const ast::Block &block)
                                              Print derivative kernel when derivimplicit method is used.
                                              -
                                              virtual void print_device_stream_wait() const
                                              Print the code to synchronise/wait on stream specific to NrnThread.
                                              -
                                              static std::pair< std::string, std::string > read_ion_variable_name(const std::string &name)
                                              Return ion variable name and corresponding ion read variable name.
                                              +
                                              virtual void print_ion_variable()
                                              Print the ion variable struct.
                                              +
                                              void print_derivimplicit_kernel(const ast::Block &block)
                                              Print derivative kernel when derivimplicit method is used.
                                              +
                                              virtual void print_device_stream_wait() const
                                              Print the code to synchronise/wait on stream specific to NrnThread.
                                              @ Destructor
                                              destructor block
                                              @ MUTEX_UNLOCK
                                              type of ast::MutexUnlock
                                              -
                                              virtual void print_net_send_buf_count_update_to_device() const
                                              Print the code to update NetSendBuffer_t count from host to device.
                                              +
                                              virtual void print_net_send_buf_count_update_to_device() const
                                              Print the code to update NetSendBuffer_t count from host to device.
                                              BAType
                                              enum type to distinguish BEFORE or AFTER blocks
                                              Definition: ast_common.hpp:80
                                              -
                                              void print_functor_definition(const ast::EigenNewtonSolverBlock &node)
                                              Based on the EigenNewtonSolverBlock passed print the definition needed for its functor.
                                              -
                                              std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
                                              Determine the variable name for a global variable given its symbol.
                                              +
                                              void print_functor_definition(const ast::EigenNewtonSolverBlock &node)
                                              Based on the EigenNewtonSolverBlock passed print the definition needed for its functor.
                                              +
                                              std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
                                              Determine the variable name for a global variable given its symbol.
                                              -
                                              void visit_eigen_linear_solver_block(const ast::EigenLinearSolverBlock &node) override
                                              visit node of type ast::EigenLinearSolverBlock
                                              -
                                              virtual void print_newtonspace_transfer_to_device() const
                                              Print code block to transfer newtonspace structure to device.
                                              +
                                              void visit_eigen_linear_solver_block(const ast::EigenLinearSolverBlock &node) override
                                              visit node of type ast::EigenLinearSolverBlock
                                              +
                                              virtual void print_newtonspace_transfer_to_device() const
                                              Print code block to transfer newtonspace structure to device.
                                              constexpr char NRN_PRIVATE_DESTRUCTOR_METHOD[]
                                              nrn_private_destructor method in generated code
                                              -
                                              void print_namespace_end() override
                                              Print end of namespaces.
                                              -
                                              void print_net_send_call(const ast::FunctionCall &node) override
                                              Print call to net_send.
                                              -
                                              virtual void print_net_receive_loop_begin()
                                              Print the code for the main net_receive loop.
                                              +
                                              void print_namespace_end() override
                                              Print end of namespaces.
                                              +
                                              void print_net_send_call(const ast::FunctionCall &node) override
                                              Print call to net_send.
                                              +
                                              virtual void print_net_receive_loop_begin()
                                              Print the code for the main net_receive loop.
                                              const ArgumentVector & get_parameters() const noexcept override
                                              Getter for member variable FunctionTableBlock::parameters.
                                              static constexpr char NTHREAD_D_SHADOW[]
                                              shadow d variable in neuron thread structure
                                              std::shared_ptr< symtab::Symbol > SymbolType
                                              -
                                              virtual void print_kernel_data_present_annotation_block_begin()
                                              Print accelerator annotations indicating data presence on device.
                                              +
                                              virtual void print_kernel_data_present_annotation_block_begin()
                                              Print accelerator annotations indicating data presence on device.
                                              -
                                              void print_backend_info() override
                                              Print top file header printed in generated code.
                                              -
                                              void print_g_unused() const override
                                              Set g_unused (conductance) for NRN_PRCELLSTATE feature.
                                              +
                                              void print_backend_info() override
                                              Print top file header printed in generated code.
                                              +
                                              void print_g_unused() const override
                                              Set g_unused (conductance) for NRN_PRCELLSTATE feature.
                                              const ArgumentVector & get_parameters() const noexcept override
                                              Getter for member variable NetReceiveBlock::parameters.
                                              @ MUTEX_LOCK
                                              type of ast::MutexLock
                                              -
                                              std::string update_if_ion_variable_name(const std::string &name) const
                                              Determine the updated name if the ion variable has been optimized.
                                              - -
                                              std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
                                              Determine the name of an int variable given its symbol.
                                              -
                                              std::tuple< bool, int > check_if_var_is_array(const std::string &name)
                                              Check if the given name exist in the symbol.
                                              -
                                              void print_initial_block(const ast::InitialBlock *node)
                                              Print initial block statements.
                                              - + +
                                              std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
                                              Determine the name of an int variable given its symbol.
                                              +
                                              std::tuple< bool, int > check_if_var_is_array(const std::string &name)
                                              Check if the given name exist in the symbol.
                                              +
                                              void print_initial_block(const ast::InitialBlock *node)
                                              Print initial block statements.
                                              std::shared_ptr< StatementBlock > get_initialize_block() const noexcept
                                              Getter for member variable EigenNewtonSolverBlock::initialize_block.
                                              -
                                              void print_net_receive_kernel()
                                              Print net_receive kernel function definition.
                                              - -
                                              void print_thread_getters()
                                              Print the getter method for thread variables and ids.
                                              +
                                              void print_net_receive_kernel()
                                              Print net_receive kernel function definition.
                                              +
                                              void print_thread_getters()
                                              Print the getter method for thread variables and ids.
                                              std::string simulator_name() override
                                              Name of the simulator the code was generated for.
                                              -
                                              void print_net_send_buffering()
                                              Print kernel for buffering net_send events.
                                              -
                                              static std::string get_register_type_for_ba_block(const ast::Block *block)
                                              Return registration type for a given BEFORE/AFTER block /param block A BEFORE/AFTER block being regis...
                                              +
                                              void print_net_send_buffering()
                                              Print kernel for buffering net_send events.
                                              +
                                              static std::string get_register_type_for_ba_block(const ast::Block *block)
                                              Return registration type for a given BEFORE/AFTER block /param block A BEFORE/AFTER block being regis...
                                              encapsulates code generation backend implementations
                                              Definition: ast_common.hpp:26
                                              std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
                                              Getter for member variable InitialBlock::statement_block.
                                              @ index
                                              index / int variables
                                              void visit_statement_block(ast::StatementBlock &node) override
                                              visit node of type ast::StatementBlock
                                              -
                                              virtual void print_fast_imem_calculation() override
                                              Print fast membrane current calculation code.
                                              -
                                              virtual void print_dt_update_to_device() const
                                              Print the code to update dt from host to device.
                                              -
                                              virtual void print_net_init_acc_serial_annotation_block_end()
                                              Print accelerator kernels end annotation for net_init kernel.
                                              +
                                              virtual void print_fast_imem_calculation() override
                                              Print fast membrane current calculation code.
                                              +
                                              virtual void print_dt_update_to_device() const
                                              Print the code to update dt from host to device.
                                              +
                                              virtual void print_net_init_acc_serial_annotation_block_end()
                                              Print accelerator kernels end annotation for net_init kernel.
                                              std::shared_ptr< StatementBlock > get_setup_x_block() const noexcept
                                              Getter for member variable EigenLinearSolverBlock::setup_x_block.
                                              static constexpr char NRN_CONSTRUCTOR_METHOD[]
                                              nrn_constructor method in generated code
                                              -
                                              void print_net_init()
                                              Print initial block in the net receive block.
                                              -
                                              void print_net_event_call(const ast::FunctionCall &node) override
                                              Print call to net_event.
                                              -
                                              void print_nrn_destructor() override
                                              Print nrn_destructor function definition.
                                              -
                                              void print_sdlists_init(bool print_initializers) override
                                              +
                                              void print_net_init()
                                              Print initial block in the net receive block.
                                              +
                                              void print_net_event_call(const ast::FunctionCall &node) override
                                              Print call to net_event.
                                              +
                                              void print_nrn_destructor() override
                                              Print nrn_destructor function definition.
                                              +
                                              void print_sdlists_init(bool print_initializers) override
                                              std::shared_ptr< StatementBlock > get_variable_block() const noexcept
                                              Getter for member variable EigenLinearSolverBlock::variable_block.
                                              -
                                              std::vector< std::string > ion_read_statements(BlockType type) const
                                              For a given output block type, return statements for all read ion variables.
                                              - -
                                              void print_send_event_move()
                                              Print send event move block used in net receive as well as watch.
                                              + +
                                              void print_send_event_move()
                                              Print send event move block used in net receive as well as watch.
                                              StatementVector::const_iterator insert_statement(StatementVector::const_iterator position, const std::shared_ptr< Statement > &n)
                                              Insert member to statements.
                                              Definition: ast.cpp:3130
                                              -
                                              void print_table_replacement_function(const ast::Block &node)
                                              Print replacement function for function or procedure using table.
                                              +
                                              void print_table_replacement_function(const ast::Block &node)
                                              Print replacement function for function or procedure using table.
                                              static constexpr char NTHREAD_DT_VARIABLE[]
                                              dt variable in neuron thread structure
                                              virtual bool is_procedure_block() const noexcept
                                              Check if the ast node is an instance of ast::ProcedureBlock.
                                              Definition: ast.cpp:144
                                              Map different tokens from lexer to token types.
                                              Represents TABLE statement in NMODL.
                                              -
                                              std::string conc_write_statement(const std::string &ion_name, const std::string &concentration, int index)
                                              Generate Function call statement for nrn_wrote_conc.
                                              -
                                              virtual void print_atomic_reduction_pragma() override
                                              Print atomic update pragma for reduction statements.
                                              +
                                              virtual void print_atomic_reduction_pragma() override
                                              Print atomic update pragma for reduction statements.
                                              Check if variable is used in given block.
                                              Implement string manipulation functions.
                                              -
                                              void print_global_variables_for_hoc() override
                                              Print byte arrays that register scalar and vector variables for hoc interface.
                                              +
                                              void print_global_variables_for_hoc() override
                                              Print byte arrays that register scalar and vector variables for hoc interface.
                                              static constexpr char NODE_AREA_VARIABLE[]
                                              inbuilt neuron variable for area of the compartment
                                              -
                                              void print_function_or_procedure(const ast::Block &node, const std::string &name) override
                                              Print nmodl function or procedure (common code)
                                              -
                                              void print_net_receive_common_code(const ast::Block &node, bool need_mech_inst=true)
                                              Print the common code section for net receive related methods.
                                              -
                                              void print_nrn_current(const ast::BreakpointBlock &node) override
                                              Print the nrn_current kernel.
                                              +
                                              void print_function_or_procedure(const ast::Block &node, const std::string &name) override
                                              Print nmodl function or procedure (common code)
                                              +
                                              void print_net_receive_common_code(const ast::Block &node, bool need_mech_inst=true)
                                              Print the common code section for net receive related methods.
                                              +
                                              void print_nrn_current(const ast::BreakpointBlock &node) override
                                              Print the nrn_current kernel.
                                              Concrete visitor for constructing symbol table from AST.
                                              +
                                              std::string conc_write_statement(const std::string &ion_name, const std::string &concentration, int index) override
                                              Generate Function call statement for nrn_wrote_conc.
                                              virtual bool is_function_block() const noexcept
                                              Check if the ast node is an instance of ast::FunctionBlock.
                                              Definition: ast.cpp:142
                                              std::shared_ptr< Integer > get_n_state_vars() const noexcept
                                              Getter for member variable EigenNewtonSolverBlock::n_state_vars.
                                              static constexpr char NRN_ALLOC_METHOD[]
                                              nrn_alloc method in generated code
                                              static const std::string GIT_REVISION
                                              git revision id
                                              Definition: config.h:33
                                              -
                                              bool is_integer
                                              if this is an integer (e.g.
                                              -
                                              void print_first_pointer_var_index_getter()
                                              Print the getter method for index position of first pointer variable.
                                              -
                                              void print_setup_range_variable()
                                              Print the function that initialize range variable with different data type.
                                              -
                                              std::string internal_method_arguments() override
                                              Arguments for functions that are defined and used internally.
                                              +
                                              void print_first_pointer_var_index_getter()
                                              Print the getter method for index position of first pointer variable.
                                              +
                                              void print_setup_range_variable()
                                              Print the function that initialize range variable with different data type.
                                              +
                                              std::string internal_method_arguments() override
                                              Arguments for functions that are defined and used internally.
                                              Class that binds all pieces together for parsing C verbatim blocks.
                                              Definition: c11_driver.hpp:37
                                              Visitor to return Def-Use chain for a given variable in the block/node
                                              std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
                                              Getter for member variable BreakpointBlock::statement_block.
                                              -
                                              std::string nrn_thread_arguments() const override
                                              Arguments for "_threadargs_" macro in neuron implementation.
                                              +
                                              std::string nrn_thread_arguments() const override
                                              Arguments for "_threadargs_" macro in neuron implementation.
                                              Represent newton solver solution block based on Eigen.
                                              -
                                              void print_net_receive_arg_size_getter()
                                              Print the getter method for getting number of arguments for net_receive.
                                              +
                                              void print_net_receive_arg_size_getter()
                                              Print the getter method for getting number of arguments for net_receive.
                                              Helper visitor to gather AST information to help code generation.
                                              std::shared_ptr< StatementBlock > get_initialize_block() const noexcept
                                              Getter for member variable EigenLinearSolverBlock::initialize_block.
                                              DUChain analyze(const ast::Ast &node, const std::string &name)
                                              compute def-use chain for a variable within the node
                                              std::string get_node_name() const override
                                              Return name of the node.
                                              Definition: ast.cpp:3800
                                              std::shared_ptr< StatementBlock > get_update_states_block() const noexcept
                                              Getter for member variable EigenLinearSolverBlock::update_states_block.
                                              -
                                              bool is_functor_const(const ast::StatementBlock &variable_block, const ast::StatementBlock &functor_block)
                                              Checks whether the functor_block generated by sympy solver modifies any variable outside its scope.
                                              +
                                              bool is_functor_const(const ast::StatementBlock &variable_block, const ast::StatementBlock &functor_block)
                                              Checks whether the functor_block generated by sympy solver modifies any variable outside its scope.
                                              const StatementVector & get_statements() const noexcept
                                              Getter for member variable StatementBlock::statements.
                                              Check if variable is used in given block.
                                              Base class for all block scoped nodes.
                                              Definition: block.hpp:41
                                              Represents a INITIAL block in the NMODL.
                                              -
                                              virtual void print_nrn_cur_matrix_shadow_update()
                                              Print the update to matrix elements with/without shadow vectors.
                                              -
                                              std::string register_mechanism_arguments() const override
                                              Arguments for register_mech or point_register_mech function.
                                              -
                                              virtual void print_net_init_acc_serial_annotation_block_begin()
                                              Print accelerator kernels begin annotation for net_init kernel.
                                              +
                                              virtual void print_nrn_cur_matrix_shadow_update()
                                              Print the update to matrix elements with/without shadow vectors.
                                              +
                                              std::string register_mechanism_arguments() const override
                                              Arguments for register_mech or point_register_mech function.
                                              +
                                              virtual void print_net_init_acc_serial_annotation_block_begin()
                                              Print accelerator kernels begin annotation for net_init kernel.
                                              std::shared_ptr< StatementBlock > get_setup_x_block() const noexcept
                                              Getter for member variable EigenNewtonSolverBlock::setup_x_block.
                                              -
                                              virtual void print_deriv_advance_flag_transfer_to_device() const
                                              Print the code to copy derivative advance flag to device.
                                              -
                                              void print_first_random_var_index_getter()
                                              Print the getter method for index position of first RANDOM variable.
                                              -
                                              std::string process_shadow_update_statement(const ShadowUseStatement &statement, BlockType type)
                                              Process shadow update statement.
                                              +
                                              virtual void print_deriv_advance_flag_transfer_to_device() const
                                              Print the code to copy derivative advance flag to device.
                                              +
                                              void print_first_random_var_index_getter()
                                              Print the getter method for index position of first RANDOM variable.
                                              static std::string trim(std::string text)
                                              static constexpr char NTHREAD_RHS_SHADOW[]
                                              shadow rhs variable in neuron thread structure
                                              Utility functions for visitors implementation.
                                              @@ -4023,150 +3825,145 @@
                                              static constexpr char USE_TABLE_VARIABLE[]
                                              global variable to indicate if table is used
                                              Represent WATCH statement in NMODL.
                                              std::shared_ptr< StatementBlock > get_finalize_block() const noexcept
                                              Getter for member variable EigenLinearSolverBlock::finalize_block.
                                              -
                                              virtual void print_eigen_linear_solver(const std::string &float_type, int N)
                                              -
                                              virtual void print_before_after_block(const ast::Block *node, size_t block_id)
                                              Print NMODL before / after block in target backend code.
                                              +
                                              virtual void print_eigen_linear_solver(const std::string &float_type, int N)
                                              +
                                              virtual void print_before_after_block(const ast::Block *node, size_t block_id)
                                              Print NMODL before / after block in target backend code.
                                              Represents a BREAKPOINT block in NMODL.
                                              nmodl::parser::UnitDriver driver
                                              Definition: parser.cpp:28
                                              -
                                              const std::regex regex_special_chars
                                              +
                                              const std::regex regex_special_chars
                                              -
                                              static std::pair< std::string, std::string > write_ion_variable_name(const std::string &name)
                                              Return ion variable name and corresponding ion write variable name.
                                              Visitor for printing C++ code compatible with legacy api of CoreNEURON
                                              static const std::unordered_map< std::string, std::string > VERBATIM_VARIABLES_MAPPING
                                              commonly used variables in verbatim block and how they should be mapped to new code generation backen...
                                              @ Constructor
                                              constructor block
                                              symtab::SymbolTable * get_symbol_table() const override
                                              Return associated symbol table for the current ast node.
                                              -
                                              void print_ion_var_structure()
                                              Print structure of ion variables used for local copies.
                                              +
                                              void print_ion_var_structure()
                                              Print structure of ion variables used for local copies.
                                              -
                                              ParamVector internal_method_parameters() override
                                              Parameters for internally defined functions.
                                              +
                                              ParamVector internal_method_parameters() override
                                              Parameters for internally defined functions.
                                              int position_of_int_var(const std::string &name) const override
                                              Determine the position in the data array for a given int variable.
                                              -
                                              virtual void print_channel_iteration_block_parallel_hint(BlockType type, const ast::Block *block)
                                              Print pragma annotations for channel iterations.
                                              -
                                              virtual bool is_constant_variable(const std::string &name) const
                                              Check if variable is qualified as constant.
                                              -
                                              void print_function_procedure_helper(const ast::Block &node) override
                                              Common helper function to help printing function or procedure blocks.
                                              -
                                              const char * external_method_parameters(bool table=false) noexcept override
                                              Parameters for functions in generated code that are called back from external code.
                                              +
                                              virtual void print_channel_iteration_block_parallel_hint(BlockType type, const ast::Block *block)
                                              Print pragma annotations for channel iterations.
                                              +
                                              virtual bool is_constant_variable(const std::string &name) const
                                              Check if variable is qualified as constant.
                                              +
                                              void print_function_procedure_helper(const ast::Block &node) override
                                              Common helper function to help printing function or procedure blocks.
                                              +
                                              const char * external_method_parameters(bool table=false) noexcept override
                                              Parameters for functions in generated code that are called back from external code.
                                              std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
                                              Getter for member variable ForNetcon::statement_block.
                                              Definition: for_netcon.hpp:185
                                              -
                                              void visit_for_netcon(const ast::ForNetcon &node) override
                                              visit node of type ast::ForNetcon
                                              -
                                              virtual void print_compute_functions() override
                                              Print all compute functions for every backend.
                                              -
                                              void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
                                              Print the nrn_cur kernel with NMODL conductance keyword provisions.
                                              +
                                              void visit_for_netcon(const ast::ForNetcon &node) override
                                              visit node of type ast::ForNetcon
                                              +
                                              virtual void print_compute_functions() override
                                              Print all compute functions for every backend.
                                              +
                                              void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
                                              Print the nrn_cur kernel with NMODL conductance keyword provisions.
                                              Represent semantic information for index variable.
                                              -
                                              virtual void print_memory_allocation_routine() const
                                              Print memory allocation routine.
                                              +
                                              virtual void print_memory_allocation_routine() const
                                              Print memory allocation routine.
                                              std::string to_string(const T &obj)
                                              -
                                              void print_check_table_thread_function()
                                              Print check_table functions.
                                              +
                                              void print_check_table_thread_function()
                                              Print check_table functions.
                                              virtual bool is_initial_block() const noexcept
                                              Check if the ast node is an instance of ast::InitialBlock.
                                              Definition: ast.cpp:124
                                              @ NetReceive
                                              net_receive block
                                              -
                                              void print_namespace_begin() override
                                              Print start of namespaces.
                                              +
                                              void print_namespace_begin() override
                                              Print start of namespaces.
                                              virtual std::string backend_name() const override
                                              Name of the code generation backend.
                                              static constexpr char NRN_INIT_METHOD[]
                                              nrn_init method in generated code
                                              -
                                              virtual void print_rhs_d_shadow_variables()
                                              Print the setup method for setting matrix shadow vectors.
                                              +
                                              virtual void print_rhs_d_shadow_variables()
                                              Print the setup method for setting matrix shadow vectors.
                                              const ExpressionVector & get_arguments() const noexcept
                                              Getter for member variable FunctionCall::arguments.
                                              -
                                              std::string process_verbatim_text(std::string const &text) override
                                              Process a verbatim block for possible variable renaming.
                                              +
                                              std::string process_verbatim_text(std::string const &text) override
                                              Process a verbatim block for possible variable renaming.
                                              static constexpr char THREAD_ARGS[]
                                              verbatim name of the variable for nrn thread arguments
                                              -
                                              void print_net_receive()
                                              Print net_receive function definition.
                                              -
                                              static void rename_net_receive_arguments(const ast::NetReceiveBlock &net_receive_node, const ast::Node &node)
                                              Rename arguments to NET_RECEIVE block with corresponding pointer variable.
                                              -
                                              std::string breakpoint_current(std::string current) const
                                              Determine the variable name for the "current" used in breakpoint block taking into account intermedia...
                                              -
                                              void print_function(const ast::FunctionBlock &node) override
                                              Print NMODL function in target backend code.
                                              -
                                              void print_top_verbatim_blocks()
                                              Print top level (global scope) verbatim blocks.
                                              +
                                              void print_net_receive()
                                              Print net_receive function definition.
                                              +
                                              static void rename_net_receive_arguments(const ast::NetReceiveBlock &net_receive_node, const ast::Node &node)
                                              Rename arguments to NET_RECEIVE block with corresponding pointer variable.
                                              +
                                              bool optimize_ion_variable_copies() const override
                                              Check if ion variable copies should be avoided.
                                              +
                                              void print_function(const ast::FunctionBlock &node) override
                                              Print NMODL function in target backend code.
                                              +
                                              void print_top_verbatim_blocks()
                                              Print top level (global scope) verbatim blocks.
                                              std::shared_ptr< Integer > get_n_state_vars() const noexcept
                                              Getter for member variable EigenLinearSolverBlock::n_state_vars.
                                              Blindly rename given variable to new name
                                              static constexpr char NRN_CUR_METHOD[]
                                              nrn_cur method in generated code
                                              Implement utility functions for codegen visitors.
                                              static constexpr char TQITEM_VARIABLE[]
                                              inbuilt neuron variable for tqitem process
                                              void set(const std::string &old_name, std::string new_name)
                                              -
                                              std::vector< std::string > ion_read_statements_optimized(BlockType type) const
                                              For a given output block type, return minimal statements for all read ion variables.
                                              @ LOCAL_VAR
                                              type of ast::LocalVar
                                              Represent linear solver solution block based on Eigen.
                                              std::vector< std::shared_ptr< const ast::Ast > > collect_nodes(const ast::Ast &node, const std::vector< ast::AstNodeType > &types)
                                              traverse node recursively and collect nodes of given types
                                              -
                                              void print_mechanism_global_var_structure(bool print_initializers) override
                                              Print the structure that wraps all global variables used in the NMODL.
                                              +
                                              void print_mechanism_global_var_structure(bool print_initializers) override
                                              Print the structure that wraps all global variables used in the NMODL.
                                              Visitor to return Def-Use chain for a given variable in the block/node
                                              std::string get_node_name() const override
                                              Return name of the node.
                                              Definition: ast.cpp:3963
                                              std::shared_ptr< StatementBlock > get_functor_block() const noexcept
                                              Getter for member variable EigenNewtonSolverBlock::functor_block.
                                              -
                                              void visit_eigen_newton_solver_block(const ast::EigenNewtonSolverBlock &node) override
                                              visit node of type ast::EigenNewtonSolverBlock
                                              -
                                              void print_nrn_constructor() override
                                              Print nrn_constructor function definition.
                                              -
                                              virtual void print_kernel_data_present_annotation_block_end()
                                              Print matching block end of accelerator annotations for data presence on device.
                                              +
                                              void visit_eigen_newton_solver_block(const ast::EigenNewtonSolverBlock &node) override
                                              visit node of type ast::EigenNewtonSolverBlock
                                              +
                                              void print_nrn_constructor() override
                                              Print nrn_constructor function definition.
                                              +
                                              virtual void print_kernel_data_present_annotation_block_end()
                                              Print matching block end of accelerator annotations for data presence on device.
                                              -
                                              void print_nrn_alloc() override
                                              Print nrn_alloc function definition.
                                              -
                                              virtual void print_nrn_cur_matrix_shadow_reduction()
                                              Print the reduction to matrix elements from shadow vectors.
                                              -
                                              void print_memb_list_getter()
                                              Print the getter method for returning membrane list from NrnThread.
                                              - +
                                              void print_nrn_alloc() override
                                              Print nrn_alloc function definition.
                                              +
                                              virtual void print_nrn_cur_matrix_shadow_reduction()
                                              Print the reduction to matrix elements from shadow vectors.
                                              +
                                              void print_memb_list_getter()
                                              Print the getter method for returning membrane list from NrnThread.
                                              +
                                              static constexpr char INST_GLOBAL_MEMBER[]
                                              instance struct member pointing to the global variable structure
                                              -
                                              const char * external_method_arguments() noexcept override
                                              Arguments for external functions called from generated code.
                                              +
                                              const char * external_method_arguments() noexcept override
                                              Arguments for external functions called from generated code.
                                              @ PROTECT_STATEMENT
                                              type of ast::ProtectStatement
                                              -
                                              void print_instance_variable_setup()
                                              Print the function that initialize instance structure.
                                              -
                                              void print_nrn_init(bool skip_init_check=true)
                                              Print the nrn_init function definition.
                                              +
                                              void print_instance_variable_setup()
                                              Print the function that initialize instance structure.
                                              +
                                              void print_nrn_init(bool skip_init_check=true)
                                              Print the nrn_init function definition.
                                              Represents block encapsulating list of statements.
                                              -
                                              std::string get_variable_name(const std::string &name, bool use_instance=true) const override
                                              Determine variable name in the structure of mechanism properties.
                                              +
                                              std::string get_variable_name(const std::string &name, bool use_instance=true) const override
                                              Determine variable name in the structure of mechanism properties.
                                              NmodlType
                                              NMODL variable properties.
                                              -
                                              void print_namespace_start() override
                                              Prints the start of the coreneuron namespace.
                                              +
                                              void print_namespace_start() override
                                              Prints the start of the coreneuron namespace.
                                              @ BATYPE_BREAKPOINT
                                              Definition: ast_common.hpp:80
                                              -
                                              virtual void print_abort_routine() const
                                              Print backend specific abort routine.
                                              -
                                              void print_table_check_function(const ast::Block &node)
                                              Print check_function() for functions or procedure using table.
                                              +
                                              virtual void print_abort_routine() const
                                              Print backend specific abort routine.
                                              +
                                              void print_table_check_function(const ast::Block &node)
                                              Print check_function() for functions or procedure using table.
                                              const ArgumentVector & get_parameters() const noexcept override
                                              Getter for member variable ForNetcon::parameters.
                                              Definition: for_netcon.hpp:176
                                              -
                                              void print_nrn_cur() override
                                              Print nrn_cur / current update function definition.
                                              -
                                              std::string get_range_var_float_type(const SymbolType &symbol)
                                              Returns floating point type for given range variable symbol.
                                              -
                                              bool ion_variable_struct_required() const
                                              Check if a structure for ion variables is required.
                                              -
                                              virtual void print_net_send_buffering_cnt_update() const
                                              Print the code related to the update of NetSendBuffer_t cnt.
                                              +
                                              void print_nrn_cur() override
                                              Print nrn_cur / current update function definition.
                                              +
                                              std::string get_range_var_float_type(const SymbolType &symbol)
                                              Returns floating point type for given range variable symbol.
                                              +
                                              virtual void print_net_send_buffering_cnt_update() const
                                              Print the code related to the update of NetSendBuffer_t cnt.
                                              std::shared_ptr< StatementBlock > get_variable_block() const noexcept
                                              Getter for member variable EigenNewtonSolverBlock::variable_block.
                                              -
                                              void print_thread_memory_callbacks()
                                              Print thread related memory allocation and deallocation callbacks.
                                              +
                                              void print_thread_memory_callbacks()
                                              Print thread related memory allocation and deallocation callbacks.
                                              Represent a callback to NEURON's derivimplicit solver.
                                              Represents ion write statement during code generation.
                                              -
                                              void print_net_receive_buffering(bool need_mech_inst=true)
                                              Print kernel for buffering net_receive events.
                                              -
                                              virtual void print_global_function_common_code(BlockType type, const std::string &function_name="") override
                                              Print common code for global functions like nrn_init, nrn_cur and nrn_state.
                                              +
                                              void print_net_receive_buffering(bool need_mech_inst=true)
                                              Print kernel for buffering net_receive events.
                                              +
                                              virtual void print_global_function_common_code(BlockType type, const std::string &function_name="") override
                                              Print common code for global functions like nrn_init, nrn_cur and nrn_state.
                                              Implement logger based on spdlog library.
                                              static const std::string NMODL_VERSION
                                              project tagged version in the cmake
                                              Definition: config.h:36
                                              bool is_vdata
                                              if variable resides in vdata field of NrnThread typically true for bbcore pointer
                                              std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
                                              Getter for member variable FunctionBlock::statement_block.
                                              BlockType
                                              Helper to represent various block types.
                                              -
                                              void print_mechanism_register() override
                                              Print the mechanism registration function.
                                              -
                                              virtual void print_global_method_annotation()
                                              Print backend specific global method annotation.
                                              +
                                              void print_mechanism_register() override
                                              Print the mechanism registration function.
                                              +
                                              virtual void print_global_method_annotation()
                                              Print backend specific global method annotation.
                                              static constexpr char NRN_STATE_METHOD[]
                                              nrn_state method in generated code
                                              -
                                              void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
                                              Print main body of nrn_cur function.
                                              +
                                              void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
                                              Print main body of nrn_cur function.
                                              Version information and units file path.
                                              -
                                              std::string nrn_thread_internal_arguments() override
                                              Arguments for "_threadargs_" macro in neuron implementation.
                                              -
                                              bool optimize_ion_variable_copies() const
                                              Check if ion variable copies should be avoided.
                                              -
                                              virtual void print_device_atomic_capture_annotation() const
                                              Print pragma annotation for increase and capture of variable in automatic way.
                                              -
                                              void visit_derivimplicit_callback(const ast::DerivimplicitCallback &node) override
                                              visit node of type ast::DerivimplicitCallback
                                              -
                                              std::vector< ShadowUseStatement > ion_write_statements(BlockType type)
                                              For a given output block type, return statements for writing back ion variables.
                                              -
                                              virtual void print_get_memb_list()
                                              Print the target backend code for defining and checking a local Memb_list variable.
                                              -
                                              void print_num_variable_getter()
                                              Print the getter methods for float and integer variables count.
                                              +
                                              std::string nrn_thread_internal_arguments() override
                                              Arguments for "_threadargs_" macro in neuron implementation.
                                              +
                                              virtual void print_device_atomic_capture_annotation() const
                                              Print pragma annotation for increase and capture of variable in automatic way.
                                              +
                                              void visit_derivimplicit_callback(const ast::DerivimplicitCallback &node) override
                                              visit node of type ast::DerivimplicitCallback
                                              +
                                              virtual void print_get_memb_list()
                                              Print the target backend code for defining and checking a local Memb_list variable.
                                              +
                                              void print_num_variable_getter()
                                              Print the getter methods for float and integer variables count.
                                              virtual std::shared_ptr< StatementBlock > get_statement_block() const
                                              Return associated statement block for the AST node.
                                              Definition: ast.cpp:32
                                              -
                                              void print_standard_includes() override
                                              Print standard C/C++ includes.
                                              -
                                              virtual void print_net_receive_loop_end()
                                              Print the code for closing the main net_receive loop.
                                              +
                                              void print_standard_includes() override
                                              Print standard C/C++ includes.
                                              +
                                              virtual void print_net_receive_loop_end()
                                              Print the code for closing the main net_receive loop.
                                              virtual void visit_children(visitor::Visitor &v) override
                                              visit children i.e.
                                              Definition: ast.cpp:388
                                              -
                                              void print_mech_type_getter()
                                              Print the getter method for returning mechtype.
                                              +
                                              void print_mech_type_getter()
                                              Print the getter method for returning mechtype.
                                              Represents a AFTER block in NMODL.
                                              Definition: after_block.hpp:51
                                              virtual bool is_before_block() const noexcept
                                              Check if the ast node is an instance of ast::BeforeBlock.
                                              Definition: ast.cpp:152
                                              std::shared_ptr< StatementBlock > get_update_states_block() const noexcept
                                              Getter for member variable EigenNewtonSolverBlock::update_states_block.
                                              static constexpr char NTHREAD_T_VARIABLE[]
                                              t variable in neuron thread structure
                                              -
                                              std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
                                              Determine the name of a float variable given its symbol.
                                              -
                                              virtual void print_global_variable_device_update_annotation()
                                              Print the pragma annotation to update global variables from host to the device.
                                              +
                                              std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
                                              Determine the name of a float variable given its symbol.
                                              +
                                              virtual void print_global_variable_device_update_annotation()
                                              Print the pragma annotation to update global variables from host to the device.
                                              Blindly rename given variable to new name
                                              @ State
                                              derivative block
                                              -
                                              void print_function_tables(const ast::FunctionTableBlock &node)
                                              Print NMODL function_table in target backend code.
                                              +
                                              void print_function_tables(const ast::FunctionTableBlock &node)
                                              Print NMODL function_table in target backend code.
                                              THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
                                              -
                                              virtual void visit_watch_statement(const ast::WatchStatement &node) override
                                              visit node of type ast::WatchStatement
                                              +
                                              virtual void visit_watch_statement(const ast::WatchStatement &node) override
                                              visit node of type ast::WatchStatement
                                              virtual const ArgumentVector & get_parameters() const
                                              Definition: block.hpp:50
                                              -
                                              void print_nrn_cur_non_conductance_kernel() override
                                              Print the nrn_cur kernel without NMODL conductance keyword provisions.
                                              +
                                              void print_nrn_cur_non_conductance_kernel() override
                                              Print the nrn_cur kernel without NMODL conductance keyword provisions.
                                              bool variable_used(const ast::Node &node, std::string name)
                                              -
                                              virtual void print_backend_includes()
                                              Print backend specific includes (none needed for C++ backend)
                                              -
                                              std::string process_verbatim_token(const std::string &token)
                                              Process a token in a verbatim block for possible variable renaming.
                                              -
                                              void print_nrn_state() override
                                              Print nrn_state / state update function definition.
                                              +
                                              virtual void print_backend_includes()
                                              Print backend specific includes (none needed for C++ backend)
                                              +
                                              std::string process_verbatim_token(const std::string &token)
                                              Process a token in a verbatim block for possible variable renaming.
                                              +
                                              void print_nrn_state() override
                                              Print nrn_state / state update function definition.
                                              static constexpr char NRN_DESTRUCTOR_METHOD[]
                                              nrn_destructor method in generated code
                                              -
                                              virtual void print_codegen_routines() override
                                              Print entry point to code generation.
                                              +
                                              virtual void print_codegen_routines() override
                                              Print entry point to code generation.
                                              - +
                                              static constexpr char THREAD_ARGS_PROTO[]
                                              verbatim name of the variable for nrn thread arguments in prototype
                                              @ BeforeAfter
                                              before / after block
                                              std::shared_ptr< StatementBlock > get_finalize_block() const noexcept
                                              Getter for member variable EigenNewtonSolverBlock::finalize_block.
                                              -
                                              virtual void print_net_send_buffering_grow()
                                              Print statement that grows NetSendBuffering_t structure if needed.
                                              +
                                              virtual void print_net_send_buffering_grow()
                                              Print statement that grows NetSendBuffering_t structure if needed.
                                              constexpr char NRN_PRIVATE_CONSTRUCTOR_METHOD[]
                                              nrn_private_constructor method in generated code
                                              -
                                              virtual void print_backend_namespace_stop()
                                              Prints the end of namespace for the backend-specific code.
                                              +
                                              virtual void print_backend_namespace_stop()
                                              Prints the end of namespace for the backend-specific code.
                                              virtual std::string get_node_name() const
                                              Return name of of the node.
                                              Definition: ast.cpp:28
                                              -
                                              virtual void print_net_send_buf_update_to_host() const
                                              Print the code to update NetSendBuffer_t from device to host.
                                              +
                                              virtual void print_net_send_buf_update_to_host() const
                                              Print the code to update NetSendBuffer_t from device to host.
                                              Auto generated AST classes declaration.
                                              -
                                              void print_data_structures(bool print_initializers) override
                                              Print all classes.
                                              -
                                              std::string replace_if_verbatim_variable(std::string name)
                                              Replace commonly used verbatim variables.
                                              -
                                              virtual void print_ion_var_constructor(const std::vector< std::string > &members)
                                              Print constructor of ion variables.
                                              +
                                              void print_data_structures(bool print_initializers) override
                                              Print all classes.
                                              +
                                              std::string replace_if_verbatim_variable(std::string name)
                                              Replace commonly used verbatim variables.
                                              +
                                              virtual void print_ion_var_constructor(const std::vector< std::string > &members)
                                              Print constructor of ion variables.
                                              int position_of_float_var(const std::string &name) const override
                                              Determine the position in the data array for a given float variable.
                                              std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
                                              A vector of parameters represented by a 4-tuple of strings:
                                              static constexpr char ION_VARNAME_PREFIX[]
                                              prefix for ion variable
                                              diff --git a/html/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html b/html/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html index ccfd58eead..36dd282016 100644 --- a/html/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html +++ b/html/doxygen/src_2codegen_2codegen__neuron__cpp__visitor_8cpp_source.html @@ -179,919 +179,933 @@
                                              83  return;
                                              84 }
                                              85 
                                              -
                                              86 
                                              -
                                              87 /****************************************************************************************/
                                              -
                                              88 /* Printing routines for code generation */
                                              -
                                              89 /****************************************************************************************/
                                              -
                                              90 
                                              -
                                              91 
                                              -
                                              92 /// TODO: Edit for NEURON
                                              - -
                                              94  if (info.functions.empty() && info.procedures.empty()) {
                                              -
                                              95  return;
                                              -
                                              96  }
                                              -
                                              97 }
                                              -
                                              98 
                                              -
                                              99 
                                              -
                                              100 /// TODO: Edit for NEURON
                                              - -
                                              102  const std::string& name) {
                                              -
                                              103  return;
                                              + +
                                              87  if (optimize_ionvar_copies) {
                                              +
                                              88  throw std::runtime_error("Not implemented.");
                                              +
                                              89  }
                                              +
                                              90  return false;
                                              +
                                              91 }
                                              +
                                              92 
                                              +
                                              93 
                                              +
                                              94 /****************************************************************************************/
                                              +
                                              95 /* Printing routines for code generation */
                                              +
                                              96 /****************************************************************************************/
                                              +
                                              97 
                                              +
                                              98 
                                              +
                                              99 /// TODO: Edit for NEURON
                                              + +
                                              101  if (info.functions.empty() && info.procedures.empty()) {
                                              +
                                              102  return;
                                              +
                                              103  }
                                              104 }
                                              105 
                                              106 
                                              107 /// TODO: Edit for NEURON
                                              - -
                                              109  return;
                                              -
                                              110 }
                                              -
                                              111 
                                              -
                                              112 
                                              -
                                              113 /// TODO: Edit for NEURON
                                              - -
                                              115  return;
                                              -
                                              116 }
                                              -
                                              117 
                                              -
                                              118 
                                              -
                                              119 /// TODO: Edit for NEURON
                                              - -
                                              121  return;
                                              -
                                              122 }
                                              -
                                              123 
                                              + +
                                              109  const std::string& name) {
                                              +
                                              110  return;
                                              +
                                              111 }
                                              +
                                              112 
                                              +
                                              113 
                                              +
                                              114 /// TODO: Edit for NEURON
                                              + +
                                              116  return;
                                              +
                                              117 }
                                              +
                                              118 
                                              +
                                              119 
                                              +
                                              120 /// TODO: Edit for NEURON
                                              + +
                                              122  return;
                                              +
                                              123 }
                                              124 
                                              -
                                              125 /****************************************************************************************/
                                              -
                                              126 /* Code-specific helper routines */
                                              -
                                              127 /****************************************************************************************/
                                              -
                                              128 
                                              -
                                              129 
                                              -
                                              130 /// TODO: Edit for NEURON
                                              - -
                                              132  return {};
                                              -
                                              133 }
                                              -
                                              134 
                                              -
                                              135 
                                              -
                                              136 /// TODO: Edit for NEURON
                                              - -
                                              138  return {};
                                              -
                                              139 }
                                              -
                                              140 
                                              -
                                              141 
                                              -
                                              142 /// TODO: Edit for NEURON
                                              - -
                                              144  return {};
                                              -
                                              145 }
                                              -
                                              146 
                                              -
                                              147 
                                              -
                                              148 /// TODO: Edit for NEURON
                                              -
                                              149 const char* CodegenNeuronCppVisitor::external_method_parameters(bool table) noexcept {
                                              -
                                              150  return {};
                                              -
                                              151 }
                                              -
                                              152 
                                              -
                                              153 
                                              -
                                              154 /// TODO: Edit for NEURON
                                              - -
                                              156  return {};
                                              -
                                              157 }
                                              -
                                              158 
                                              -
                                              159 
                                              -
                                              160 /// TODO: Edit for NEURON
                                              - -
                                              162  return {};
                                              -
                                              163 }
                                              -
                                              164 
                                              -
                                              165 
                                              -
                                              166 /// TODO: Write for NEURON
                                              -
                                              167 std::string CodegenNeuronCppVisitor::process_verbatim_text(std::string const& text) {
                                              -
                                              168  return {};
                                              -
                                              169 }
                                              -
                                              170 
                                              -
                                              171 
                                              -
                                              172 /// TODO: Write for NEURON
                                              - -
                                              174  return {};
                                              -
                                              175 };
                                              -
                                              176 
                                              +
                                              125 
                                              +
                                              126 /// TODO: Edit for NEURON
                                              + +
                                              128  return;
                                              +
                                              129 }
                                              +
                                              130 
                                              +
                                              131 
                                              +
                                              132 /****************************************************************************************/
                                              +
                                              133 /* Code-specific helper routines */
                                              +
                                              134 /****************************************************************************************/
                                              +
                                              135 
                                              +
                                              136 
                                              +
                                              137 /// TODO: Edit for NEURON
                                              + +
                                              139  return {};
                                              +
                                              140 }
                                              +
                                              141 
                                              +
                                              142 
                                              +
                                              143 /// TODO: Edit for NEURON
                                              + +
                                              145  return {};
                                              +
                                              146 }
                                              +
                                              147 
                                              +
                                              148 
                                              +
                                              149 /// TODO: Edit for NEURON
                                              + +
                                              151  return {};
                                              +
                                              152 }
                                              +
                                              153 
                                              +
                                              154 
                                              +
                                              155 /// TODO: Edit for NEURON
                                              +
                                              156 const char* CodegenNeuronCppVisitor::external_method_parameters(bool table) noexcept {
                                              +
                                              157  return {};
                                              +
                                              158 }
                                              +
                                              159 
                                              +
                                              160 
                                              +
                                              161 /// TODO: Edit for NEURON
                                              + +
                                              163  return {};
                                              +
                                              164 }
                                              +
                                              165 
                                              +
                                              166 
                                              +
                                              167 /// TODO: Edit for NEURON
                                              + +
                                              169  return {};
                                              +
                                              170 }
                                              +
                                              171 
                                              +
                                              172 
                                              +
                                              173 /// TODO: Write for NEURON
                                              +
                                              174 std::string CodegenNeuronCppVisitor::process_verbatim_text(std::string const& text) {
                                              +
                                              175  return {};
                                              +
                                              176 }
                                              177 
                                              -
                                              178 /****************************************************************************************/
                                              -
                                              179 /* Code-specific printing routines for code generation */
                                              -
                                              180 /****************************************************************************************/
                                              -
                                              181 
                                              -
                                              182 
                                              - -
                                              184  printer->add_newline(2);
                                              -
                                              185  printer->push_block("namespace neuron");
                                              -
                                              186 }
                                              -
                                              187 
                                              +
                                              178 
                                              +
                                              179 /// TODO: Write for NEURON
                                              + +
                                              181  return {};
                                              +
                                              182 };
                                              +
                                              183 
                                              +
                                              184 
                                              +
                                              185 /****************************************************************************************/
                                              +
                                              186 /* Code-specific printing routines for code generation */
                                              +
                                              187 /****************************************************************************************/
                                              188 
                                              - -
                                              190  printer->pop_block();
                                              -
                                              191 }
                                              -
                                              192 
                                              -
                                              193 
                                              -
                                              194 /****************************************************************************************/
                                              -
                                              195 /* Routines for returning variable name */
                                              -
                                              196 /****************************************************************************************/
                                              -
                                              197 
                                              -
                                              198 
                                              -
                                              199 /// TODO: Edit for NEURON
                                              - -
                                              201  bool use_instance) const {
                                              -
                                              202  auto name = symbol->get_name();
                                              -
                                              203  auto dimension = symbol->get_length();
                                              -
                                              204  // auto position = position_of_float_var(name);
                                              -
                                              205  if (symbol->is_array()) {
                                              -
                                              206  if (use_instance) {
                                              -
                                              207  return fmt::format("(inst.{}+id*{})", name, dimension);
                                              -
                                              208  }
                                              -
                                              209  throw std::runtime_error("Printing non-instance variables is not implemented.");
                                              -
                                              210  // return fmt::format("(data + {}*pnodecount + id*{})", position, dimension);
                                              -
                                              211  }
                                              -
                                              212  if (use_instance) {
                                              -
                                              213  return fmt::format("inst.{}[id]", name);
                                              -
                                              214  }
                                              -
                                              215  throw std::runtime_error("Not implemented.");
                                              -
                                              216  // return fmt::format("data[{}*pnodecount + id]", position);
                                              -
                                              217 }
                                              -
                                              218 
                                              -
                                              219 
                                              -
                                              220 /// TODO: Edit for NEURON
                                              - -
                                              222  const std::string& name,
                                              -
                                              223  bool use_instance) const {
                                              -
                                              224  return name;
                                              -
                                              225 }
                                              -
                                              226 
                                              -
                                              227 
                                              - -
                                              229  bool use_instance) const {
                                              -
                                              230  if (use_instance) {
                                              -
                                              231  return fmt::format("inst.{}->{}", naming::INST_GLOBAL_MEMBER, symbol->get_name());
                                              -
                                              232  } else {
                                              -
                                              233  return fmt::format("{}.{}", global_struct_instance(), symbol->get_name());
                                              -
                                              234  }
                                              -
                                              235 }
                                              -
                                              236 
                                              -
                                              237 
                                              -
                                              238 std::string CodegenNeuronCppVisitor::get_variable_name(const std::string& name,
                                              -
                                              239  bool use_instance) const {
                                              -
                                              240  // const std::string& varname = update_if_ion_variable_name(name);
                                              -
                                              241  const std::string& varname = name;
                                              -
                                              242 
                                              -
                                              243  auto symbol_comparator = [&varname](const SymbolType& sym) {
                                              -
                                              244  return varname == sym->get_name();
                                              -
                                              245  };
                                              -
                                              246 
                                              -
                                              247  auto index_comparator = [&varname](const IndexVariableInfo& var) {
                                              -
                                              248  return varname == var.symbol->get_name();
                                              -
                                              249  };
                                              +
                                              189 
                                              + +
                                              191  printer->add_newline(2);
                                              +
                                              192  printer->push_block("namespace neuron");
                                              +
                                              193 }
                                              +
                                              194 
                                              +
                                              195 
                                              + +
                                              197  printer->pop_block();
                                              +
                                              198 }
                                              +
                                              199 
                                              +
                                              200 
                                              +
                                              201 std::string CodegenNeuronCppVisitor::conc_write_statement(const std::string& ion_name,
                                              +
                                              202  const std::string& concentration,
                                              +
                                              203  int index) {
                                              +
                                              204  throw std::runtime_error("Not implemented.");
                                              +
                                              205 }
                                              +
                                              206 
                                              +
                                              207 /****************************************************************************************/
                                              +
                                              208 /* Routines for returning variable name */
                                              +
                                              209 /****************************************************************************************/
                                              +
                                              210 
                                              +
                                              211 
                                              +
                                              212 /// TODO: Edit for NEURON
                                              + +
                                              214  bool use_instance) const {
                                              +
                                              215  auto name = symbol->get_name();
                                              +
                                              216  auto dimension = symbol->get_length();
                                              +
                                              217  // auto position = position_of_float_var(name);
                                              +
                                              218  if (symbol->is_array()) {
                                              +
                                              219  if (use_instance) {
                                              +
                                              220  return fmt::format("(inst.{}+id*{})", name, dimension);
                                              +
                                              221  }
                                              +
                                              222  throw std::runtime_error("Printing non-instance variables is not implemented.");
                                              +
                                              223  // return fmt::format("(data + {}*pnodecount + id*{})", position, dimension);
                                              +
                                              224  }
                                              +
                                              225  if (use_instance) {
                                              +
                                              226  return fmt::format("inst.{}[id]", name);
                                              +
                                              227  }
                                              +
                                              228  throw std::runtime_error("Not implemented.");
                                              +
                                              229  // return fmt::format("data[{}*pnodecount + id]", position);
                                              +
                                              230 }
                                              +
                                              231 
                                              +
                                              232 
                                              +
                                              233 /// TODO: Edit for NEURON
                                              + +
                                              235  const std::string& name,
                                              +
                                              236  bool use_instance) const {
                                              +
                                              237  return name;
                                              +
                                              238 }
                                              +
                                              239 
                                              +
                                              240 
                                              + +
                                              242  bool use_instance) const {
                                              +
                                              243  if (use_instance) {
                                              +
                                              244  return fmt::format("inst.{}->{}", naming::INST_GLOBAL_MEMBER, symbol->get_name());
                                              +
                                              245  } else {
                                              +
                                              246  return fmt::format("{}.{}", global_struct_instance(), symbol->get_name());
                                              +
                                              247  }
                                              +
                                              248 }
                                              +
                                              249 
                                              250 
                                              -
                                              251  // float variable
                                              -
                                              252  auto f = std::find_if(codegen_float_variables.begin(),
                                              -
                                              253  codegen_float_variables.end(),
                                              -
                                              254  symbol_comparator);
                                              -
                                              255  if (f != codegen_float_variables.end()) {
                                              -
                                              256  return float_variable_name(*f, use_instance);
                                              -
                                              257  }
                                              -
                                              258 
                                              -
                                              259  // integer variable
                                              -
                                              260  auto i =
                                              -
                                              261  std::find_if(codegen_int_variables.begin(), codegen_int_variables.end(), index_comparator);
                                              -
                                              262  if (i != codegen_int_variables.end()) {
                                              -
                                              263  return int_variable_name(*i, varname, use_instance);
                                              -
                                              264  }
                                              -
                                              265 
                                              -
                                              266  // global variable
                                              -
                                              267  auto g = std::find_if(codegen_global_variables.begin(),
                                              -
                                              268  codegen_global_variables.end(),
                                              -
                                              269  symbol_comparator);
                                              -
                                              270  if (g != codegen_global_variables.end()) {
                                              -
                                              271  return global_variable_name(*g, use_instance);
                                              -
                                              272  }
                                              -
                                              273 
                                              -
                                              274  if (varname == naming::NTHREAD_DT_VARIABLE) {
                                              -
                                              275  return std::string("_nt->_") + naming::NTHREAD_DT_VARIABLE;
                                              -
                                              276  }
                                              -
                                              277 
                                              -
                                              278  // t in net_receive method is an argument to function and hence it should
                                              -
                                              279  // be used instead of nt->_t which is current time of thread
                                              -
                                              280  if (varname == naming::NTHREAD_T_VARIABLE && !printing_net_receive) {
                                              -
                                              281  return std::string("_nt->_") + naming::NTHREAD_T_VARIABLE;
                                              -
                                              282  }
                                              -
                                              283 
                                              -
                                              284  auto const iter =
                                              -
                                              285  std::find_if(info.neuron_global_variables.begin(),
                                              -
                                              286  info.neuron_global_variables.end(),
                                              -
                                              287  [&varname](auto const& entry) { return entry.first->get_name() == varname; });
                                              -
                                              288  if (iter != info.neuron_global_variables.end()) {
                                              -
                                              289  std::string ret;
                                              -
                                              290  if (use_instance) {
                                              -
                                              291  ret = "*(inst->";
                                              -
                                              292  }
                                              -
                                              293  ret.append(varname);
                                              -
                                              294  if (use_instance) {
                                              -
                                              295  ret.append(")");
                                              -
                                              296  }
                                              -
                                              297  return ret;
                                              -
                                              298  }
                                              -
                                              299 
                                              -
                                              300  // otherwise return original name
                                              -
                                              301  return varname;
                                              -
                                              302 }
                                              -
                                              303 
                                              -
                                              304 
                                              -
                                              305 /****************************************************************************************/
                                              -
                                              306 /* Main printing routines for code generation */
                                              -
                                              307 /****************************************************************************************/
                                              -
                                              308 
                                              -
                                              309 
                                              - -
                                              311  time_t current_time{};
                                              -
                                              312  time(&current_time);
                                              -
                                              313  std::string data_time_str{std::ctime(&current_time)};
                                              -
                                              314  auto version = nmodl::Version::NMODL_VERSION + " [" + nmodl::Version::GIT_REVISION + "]";
                                              -
                                              315 
                                              -
                                              316  printer->add_line("/*********************************************************");
                                              -
                                              317  printer->add_line("Model Name : ", info.mod_suffix);
                                              -
                                              318  printer->add_line("Filename : ", info.mod_file, ".mod");
                                              -
                                              319  printer->add_line("NMODL Version : ", nmodl_version());
                                              -
                                              320  printer->fmt_line("Vectorized : {}", info.vectorize);
                                              -
                                              321  printer->fmt_line("Threadsafe : {}", info.thread_safe);
                                              -
                                              322  printer->add_line("Created : ", stringutils::trim(data_time_str));
                                              -
                                              323  printer->add_line("Simulator : ", simulator_name());
                                              -
                                              324  printer->add_line("Backend : ", backend_name());
                                              -
                                              325  printer->add_line("NMODL Compiler : ", version);
                                              -
                                              326  printer->add_line("*********************************************************/");
                                              -
                                              327 }
                                              +
                                              251 std::string CodegenNeuronCppVisitor::get_variable_name(const std::string& name,
                                              +
                                              252  bool use_instance) const {
                                              +
                                              253  // const std::string& varname = update_if_ion_variable_name(name);
                                              +
                                              254  const std::string& varname = name;
                                              +
                                              255 
                                              +
                                              256  auto symbol_comparator = [&varname](const SymbolType& sym) {
                                              +
                                              257  return varname == sym->get_name();
                                              +
                                              258  };
                                              +
                                              259 
                                              +
                                              260  auto index_comparator = [&varname](const IndexVariableInfo& var) {
                                              +
                                              261  return varname == var.symbol->get_name();
                                              +
                                              262  };
                                              +
                                              263 
                                              +
                                              264  // float variable
                                              +
                                              265  auto f = std::find_if(codegen_float_variables.begin(),
                                              +
                                              266  codegen_float_variables.end(),
                                              +
                                              267  symbol_comparator);
                                              +
                                              268  if (f != codegen_float_variables.end()) {
                                              +
                                              269  return float_variable_name(*f, use_instance);
                                              +
                                              270  }
                                              +
                                              271 
                                              +
                                              272  // integer variable
                                              +
                                              273  auto i =
                                              +
                                              274  std::find_if(codegen_int_variables.begin(), codegen_int_variables.end(), index_comparator);
                                              +
                                              275  if (i != codegen_int_variables.end()) {
                                              +
                                              276  return int_variable_name(*i, varname, use_instance);
                                              +
                                              277  }
                                              +
                                              278 
                                              +
                                              279  // global variable
                                              +
                                              280  auto g = std::find_if(codegen_global_variables.begin(),
                                              +
                                              281  codegen_global_variables.end(),
                                              +
                                              282  symbol_comparator);
                                              +
                                              283  if (g != codegen_global_variables.end()) {
                                              +
                                              284  return global_variable_name(*g, use_instance);
                                              +
                                              285  }
                                              +
                                              286 
                                              +
                                              287  if (varname == naming::NTHREAD_DT_VARIABLE) {
                                              +
                                              288  return std::string("_nt->_") + naming::NTHREAD_DT_VARIABLE;
                                              +
                                              289  }
                                              +
                                              290 
                                              +
                                              291  // t in net_receive method is an argument to function and hence it should
                                              +
                                              292  // be used instead of nt->_t which is current time of thread
                                              +
                                              293  if (varname == naming::NTHREAD_T_VARIABLE && !printing_net_receive) {
                                              +
                                              294  return std::string("_nt->_") + naming::NTHREAD_T_VARIABLE;
                                              +
                                              295  }
                                              +
                                              296 
                                              +
                                              297  auto const iter =
                                              +
                                              298  std::find_if(info.neuron_global_variables.begin(),
                                              +
                                              299  info.neuron_global_variables.end(),
                                              +
                                              300  [&varname](auto const& entry) { return entry.first->get_name() == varname; });
                                              +
                                              301  if (iter != info.neuron_global_variables.end()) {
                                              +
                                              302  std::string ret;
                                              +
                                              303  if (use_instance) {
                                              +
                                              304  ret = "*(inst->";
                                              +
                                              305  }
                                              +
                                              306  ret.append(varname);
                                              +
                                              307  if (use_instance) {
                                              +
                                              308  ret.append(")");
                                              +
                                              309  }
                                              +
                                              310  return ret;
                                              +
                                              311  }
                                              +
                                              312 
                                              +
                                              313  // otherwise return original name
                                              +
                                              314  return varname;
                                              +
                                              315 }
                                              +
                                              316 
                                              +
                                              317 
                                              +
                                              318 /****************************************************************************************/
                                              +
                                              319 /* Main printing routines for code generation */
                                              +
                                              320 /****************************************************************************************/
                                              +
                                              321 
                                              +
                                              322 
                                              + +
                                              324  time_t current_time{};
                                              +
                                              325  time(&current_time);
                                              +
                                              326  std::string data_time_str{std::ctime(&current_time)};
                                              +
                                              327  auto version = nmodl::Version::NMODL_VERSION + " [" + nmodl::Version::GIT_REVISION + "]";
                                              328 
                                              -
                                              329 
                                              - -
                                              331  printer->add_newline();
                                              -
                                              332  printer->add_multi_line(R"CODE(
                                              -
                                              333  #include <math.h>
                                              -
                                              334  #include <stdio.h>
                                              -
                                              335  #include <stdlib.h>
                                              -
                                              336  )CODE");
                                              -
                                              337  if (!info.vectorize) {
                                              -
                                              338  printer->add_line("#include <vector>");
                                              -
                                              339  }
                                              +
                                              329  printer->add_line("/*********************************************************");
                                              +
                                              330  printer->add_line("Model Name : ", info.mod_suffix);
                                              +
                                              331  printer->add_line("Filename : ", info.mod_file, ".mod");
                                              +
                                              332  printer->add_line("NMODL Version : ", nmodl_version());
                                              +
                                              333  printer->fmt_line("Vectorized : {}", info.vectorize);
                                              +
                                              334  printer->fmt_line("Threadsafe : {}", info.thread_safe);
                                              +
                                              335  printer->add_line("Created : ", stringutils::trim(data_time_str));
                                              +
                                              336  printer->add_line("Simulator : ", simulator_name());
                                              +
                                              337  printer->add_line("Backend : ", backend_name());
                                              +
                                              338  printer->add_line("NMODL Compiler : ", version);
                                              +
                                              339  printer->add_line("*********************************************************/");
                                              340 }
                                              341 
                                              342 
                                              - +
                                              344  printer->add_newline();
                                              345  printer->add_multi_line(R"CODE(
                                              -
                                              346  #include "mech_api.h"
                                              -
                                              347  #include "neuron/cache/mechanism_range.hpp"
                                              -
                                              348  #include "nrniv_mf.h"
                                              -
                                              349  #include "section_fwd.hpp"
                                              -
                                              350  )CODE");
                                              -
                                              351 }
                                              -
                                              352 
                                              -
                                              353 
                                              -
                                              354 void CodegenNeuronCppVisitor::print_sdlists_init([[maybe_unused]] bool print_initializers) {
                                              -
                                              355  /// _initlists() should only be called once by the mechanism registration function
                                              -
                                              356  /// (_<mod_file>_reg())
                                              -
                                              357  printer->add_newline(2);
                                              -
                                              358  printer->push_block("static void _initlists()");
                                              -
                                              359  for (auto i = 0; i < info.prime_variables_by_order.size(); ++i) {
                                              -
                                              360  const auto& prime_var = info.prime_variables_by_order[i];
                                              -
                                              361  /// TODO: Something similar needs to happen for slist/dlist2 but I don't know their usage at
                                              -
                                              362  // the moment
                                              -
                                              363  /// TODO: We have to do checks and add errors similar to nocmodl in the
                                              -
                                              364  // SemanticAnalysisVisitor
                                              -
                                              365  if (prime_var->is_array()) {
                                              -
                                              366  /// TODO: Needs a for loop here. Look at
                                              -
                                              367  // https://github.com/neuronsimulator/nrn/blob/df001a436bcb4e23d698afe66c2a513819a6bfe8/src/nmodl/deriv.cpp#L524
                                              -
                                              368  /// TODO: Also needs a test
                                              -
                                              369  printer->fmt_push_block("for (int _i = 0; _i < {}; ++_i)", prime_var->get_length());
                                              -
                                              370  printer->fmt_line("/* {}[{}] */", prime_var->get_name(), prime_var->get_length());
                                              -
                                              371  printer->fmt_line("_slist1[{}+_i] = {{{}, _i}};",
                                              -
                                              372  i,
                                              -
                                              373  position_of_float_var(prime_var->get_name()));
                                              -
                                              374  const auto prime_var_deriv_name = "D" + prime_var->get_name();
                                              -
                                              375  printer->fmt_line("/* {}[{}] */", prime_var_deriv_name, prime_var->get_length());
                                              -
                                              376  printer->fmt_line("_dlist1[{}+_i] = {{{}, _i}};",
                                              -
                                              377  i,
                                              -
                                              378  position_of_float_var(prime_var_deriv_name));
                                              -
                                              379  printer->pop_block();
                                              -
                                              380  } else {
                                              -
                                              381  printer->fmt_line("/* {} */", prime_var->get_name());
                                              -
                                              382  printer->fmt_line("_slist1[{}] = {{{}, 0}};",
                                              -
                                              383  i,
                                              -
                                              384  position_of_float_var(prime_var->get_name()));
                                              -
                                              385  const auto prime_var_deriv_name = "D" + prime_var->get_name();
                                              -
                                              386  printer->fmt_line("/* {} */", prime_var_deriv_name);
                                              -
                                              387  printer->fmt_line("_dlist1[{}] = {{{}, 0}};",
                                              -
                                              388  i,
                                              -
                                              389  position_of_float_var(prime_var_deriv_name));
                                              -
                                              390  }
                                              -
                                              391  }
                                              -
                                              392  printer->pop_block();
                                              -
                                              393 }
                                              -
                                              394 
                                              -
                                              395 
                                              - -
                                              397  const auto value_initialize = print_initializers ? "{}" : "";
                                              -
                                              398 
                                              -
                                              399  /// TODO: Print only global variables printed in NEURON
                                              -
                                              400  printer->add_newline(2);
                                              -
                                              401  printer->add_line("/* NEURON global variables */");
                                              -
                                              402  if (info.primes_size != 0) {
                                              -
                                              403  printer->fmt_line("static neuron::container::field_index _slist1[{0}], _dlist1[{0}];",
                                              -
                                              404  info.primes_size);
                                              -
                                              405  }
                                              -
                                              406  printer->add_line("static int mech_type;");
                                              +
                                              346  #include <math.h>
                                              +
                                              347  #include <stdio.h>
                                              +
                                              348  #include <stdlib.h>
                                              +
                                              349  )CODE");
                                              +
                                              350  if (!info.vectorize) {
                                              +
                                              351  printer->add_line("#include <vector>");
                                              +
                                              352  }
                                              +
                                              353 }
                                              +
                                              354 
                                              +
                                              355 
                                              + +
                                              357  printer->add_newline();
                                              +
                                              358  printer->add_multi_line(R"CODE(
                                              +
                                              359  #include "mech_api.h"
                                              +
                                              360  #include "neuron/cache/mechanism_range.hpp"
                                              +
                                              361  #include "nrniv_mf.h"
                                              +
                                              362  #include "section_fwd.hpp"
                                              +
                                              363  )CODE");
                                              +
                                              364 }
                                              +
                                              365 
                                              +
                                              366 
                                              +
                                              367 void CodegenNeuronCppVisitor::print_sdlists_init([[maybe_unused]] bool print_initializers) {
                                              +
                                              368  /// _initlists() should only be called once by the mechanism registration function
                                              +
                                              369  /// (_<mod_file>_reg())
                                              +
                                              370  printer->add_newline(2);
                                              +
                                              371  printer->push_block("static void _initlists()");
                                              +
                                              372  for (auto i = 0; i < info.prime_variables_by_order.size(); ++i) {
                                              +
                                              373  const auto& prime_var = info.prime_variables_by_order[i];
                                              +
                                              374  /// TODO: Something similar needs to happen for slist/dlist2 but I don't know their usage at
                                              +
                                              375  // the moment
                                              +
                                              376  /// TODO: We have to do checks and add errors similar to nocmodl in the
                                              +
                                              377  // SemanticAnalysisVisitor
                                              +
                                              378  if (prime_var->is_array()) {
                                              +
                                              379  /// TODO: Needs a for loop here. Look at
                                              +
                                              380  // https://github.com/neuronsimulator/nrn/blob/df001a436bcb4e23d698afe66c2a513819a6bfe8/src/nmodl/deriv.cpp#L524
                                              +
                                              381  /// TODO: Also needs a test
                                              +
                                              382  printer->fmt_push_block("for (int _i = 0; _i < {}; ++_i)", prime_var->get_length());
                                              +
                                              383  printer->fmt_line("/* {}[{}] */", prime_var->get_name(), prime_var->get_length());
                                              +
                                              384  printer->fmt_line("_slist1[{}+_i] = {{{}, _i}};",
                                              +
                                              385  i,
                                              +
                                              386  position_of_float_var(prime_var->get_name()));
                                              +
                                              387  const auto prime_var_deriv_name = "D" + prime_var->get_name();
                                              +
                                              388  printer->fmt_line("/* {}[{}] */", prime_var_deriv_name, prime_var->get_length());
                                              +
                                              389  printer->fmt_line("_dlist1[{}+_i] = {{{}, _i}};",
                                              +
                                              390  i,
                                              +
                                              391  position_of_float_var(prime_var_deriv_name));
                                              +
                                              392  printer->pop_block();
                                              +
                                              393  } else {
                                              +
                                              394  printer->fmt_line("/* {} */", prime_var->get_name());
                                              +
                                              395  printer->fmt_line("_slist1[{}] = {{{}, 0}};",
                                              +
                                              396  i,
                                              +
                                              397  position_of_float_var(prime_var->get_name()));
                                              +
                                              398  const auto prime_var_deriv_name = "D" + prime_var->get_name();
                                              +
                                              399  printer->fmt_line("/* {} */", prime_var_deriv_name);
                                              +
                                              400  printer->fmt_line("_dlist1[{}] = {{{}, 0}};",
                                              +
                                              401  i,
                                              +
                                              402  position_of_float_var(prime_var_deriv_name));
                                              +
                                              403  }
                                              +
                                              404  }
                                              +
                                              405  printer->pop_block();
                                              +
                                              406 }
                                              407 
                                              -
                                              408  printer->fmt_line("static int {} = {};",
                                              - -
                                              410  info.pointer_variables.size() > 0
                                              -
                                              411  ? static_cast<int>(info.pointer_variables.size())
                                              -
                                              412  : -1);
                                              -
                                              413 
                                              -
                                              414  // Start printing the CNRN-style global variables.
                                              -
                                              415  auto float_type = default_float_data_type();
                                              -
                                              416  printer->add_newline(2);
                                              -
                                              417  printer->add_line("/** all global variables */");
                                              -
                                              418  printer->fmt_push_block("struct {}", global_struct());
                                              -
                                              419 
                                              -
                                              420  if (!info.ions.empty()) {
                                              -
                                              421  // TODO implement these when needed.
                                              -
                                              422  }
                                              -
                                              423 
                                              -
                                              424  if (info.point_process) {
                                              -
                                              425  throw std::runtime_error("Not implemented, global point process.");
                                              -
                                              426  }
                                              -
                                              427 
                                              -
                                              428  if (!info.vectorize && !info.top_local_variables.empty()) {
                                              -
                                              429  throw std::runtime_error("Not implemented, global vectorize something.");
                                              -
                                              430  }
                                              -
                                              431 
                                              -
                                              432  if (!info.thread_variables.empty()) {
                                              -
                                              433  throw std::runtime_error("Not implemented, global thread variables.");
                                              -
                                              434  }
                                              -
                                              435 
                                              -
                                              436  if (info.table_count > 0) {
                                              -
                                              437  throw std::runtime_error("Not implemented, global table count.");
                                              -
                                              438  }
                                              -
                                              439 
                                              -
                                              440  for (const auto& var: info.state_vars) {
                                              -
                                              441  auto name = var->get_name() + "0";
                                              -
                                              442  auto symbol = program_symtab->lookup(name);
                                              -
                                              443  if (symbol == nullptr) {
                                              -
                                              444  printer->fmt_line("{} {}{};", float_type, name, value_initialize);
                                              -
                                              445  codegen_global_variables.push_back(make_symbol(name));
                                              -
                                              446  }
                                              +
                                              408 
                                              + +
                                              410  const auto value_initialize = print_initializers ? "{}" : "";
                                              +
                                              411 
                                              +
                                              412  /// TODO: Print only global variables printed in NEURON
                                              +
                                              413  printer->add_newline(2);
                                              +
                                              414  printer->add_line("/* NEURON global variables */");
                                              +
                                              415  if (info.primes_size != 0) {
                                              +
                                              416  printer->fmt_line("static neuron::container::field_index _slist1[{0}], _dlist1[{0}];",
                                              +
                                              417  info.primes_size);
                                              +
                                              418  }
                                              +
                                              419  printer->add_line("static int mech_type;");
                                              +
                                              420 
                                              +
                                              421  printer->fmt_line("static int {} = {};",
                                              + +
                                              423  info.pointer_variables.size() > 0
                                              +
                                              424  ? static_cast<int>(info.pointer_variables.size())
                                              +
                                              425  : -1);
                                              +
                                              426 
                                              +
                                              427  // Start printing the CNRN-style global variables.
                                              +
                                              428  auto float_type = default_float_data_type();
                                              +
                                              429  printer->add_newline(2);
                                              +
                                              430  printer->add_line("/** all global variables */");
                                              +
                                              431  printer->fmt_push_block("struct {}", global_struct());
                                              +
                                              432 
                                              +
                                              433  if (!info.ions.empty()) {
                                              +
                                              434  // TODO implement these when needed.
                                              +
                                              435  }
                                              +
                                              436 
                                              +
                                              437  if (info.point_process) {
                                              +
                                              438  throw std::runtime_error("Not implemented, global point process.");
                                              +
                                              439  }
                                              +
                                              440 
                                              +
                                              441  if (!info.vectorize && !info.top_local_variables.empty()) {
                                              +
                                              442  throw std::runtime_error("Not implemented, global vectorize something.");
                                              +
                                              443  }
                                              +
                                              444 
                                              +
                                              445  if (!info.thread_variables.empty()) {
                                              +
                                              446  throw std::runtime_error("Not implemented, global thread variables.");
                                              447  }
                                              448 
                                              -
                                              449  for (const auto& var: info.global_variables) {
                                              -
                                              450  auto name = var->get_name();
                                              -
                                              451  auto length = var->get_length();
                                              -
                                              452  if (var->is_array()) {
                                              -
                                              453  printer->fmt_line("{} {}[{}] /* TODO init const-array */;", float_type, name, length);
                                              -
                                              454  } else {
                                              -
                                              455  double value{};
                                              -
                                              456  if (auto const& value_ptr = var->get_value()) {
                                              -
                                              457  value = *value_ptr;
                                              -
                                              458  }
                                              -
                                              459  printer->fmt_line("{} {}{};",
                                              -
                                              460  float_type,
                                              -
                                              461  name,
                                              -
                                              462  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                                              -
                                              463  }
                                              -
                                              464  codegen_global_variables.push_back(var);
                                              -
                                              465  }
                                              -
                                              466 
                                              -
                                              467 
                                              -
                                              468  for (const auto& f: info.function_tables) {
                                              -
                                              469  throw std::runtime_error("Not implemented, global function tables.");
                                              -
                                              470  }
                                              -
                                              471 
                                              -
                                              472  if (info.vectorize && info.thread_data_index) {
                                              -
                                              473  throw std::runtime_error("Not implemented, global vectorize something else.");
                                              -
                                              474  }
                                              -
                                              475 
                                              -
                                              476  printer->pop_block(";");
                                              -
                                              477 
                                              -
                                              478  print_global_var_struct_assertions();
                                              -
                                              479  print_global_var_struct_decl();
                                              -
                                              480 }
                                              -
                                              481 
                                              -
                                              482 
                                              -
                                              483 /// TODO: Same as CoreNEURON?
                                              - -
                                              485  /// TODO: Write HocParmLimits and other HOC global variables (delta_t)
                                              -
                                              486  // Probably needs more changes
                                              -
                                              487  auto variable_printer =
                                              -
                                              488  [&](const std::vector<SymbolType>& variables, bool if_array, bool if_vector) {
                                              -
                                              489  for (const auto& variable: variables) {
                                              -
                                              490  if (variable->is_array() == if_array) {
                                              -
                                              491  // false => do not use the instance struct, which is not
                                              -
                                              492  // defined in the global declaration that we are printing
                                              -
                                              493  auto name = get_variable_name(variable->get_name(), false);
                                              -
                                              494  auto ename = add_escape_quote(variable->get_name() + "_" + info.mod_suffix);
                                              -
                                              495  auto length = variable->get_length();
                                              -
                                              496  if (if_vector) {
                                              -
                                              497  printer->fmt_line("{{{}, {}, {}}},", ename, name, length);
                                              -
                                              498  } else {
                                              -
                                              499  printer->fmt_line("{{{}, &{}}},", ename, name);
                                              -
                                              500  }
                                              -
                                              501  }
                                              -
                                              502  }
                                              -
                                              503  };
                                              -
                                              504 
                                              -
                                              505  auto globals = info.global_variables;
                                              -
                                              506  auto thread_vars = info.thread_variables;
                                              -
                                              507 
                                              -
                                              508  if (info.table_count > 0) {
                                              -
                                              509  globals.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                                              -
                                              510  }
                                              -
                                              511 
                                              -
                                              512  printer->add_newline(2);
                                              -
                                              513  printer->add_line("/** connect global (scalar) variables to hoc -- */");
                                              -
                                              514  printer->add_line("static DoubScal hoc_scalar_double[] = {");
                                              -
                                              515  printer->increase_indent();
                                              -
                                              516  variable_printer(globals, false, false);
                                              -
                                              517  variable_printer(thread_vars, false, false);
                                              -
                                              518  printer->add_line("{nullptr, nullptr}");
                                              -
                                              519  printer->decrease_indent();
                                              -
                                              520  printer->add_line("};");
                                              -
                                              521 
                                              -
                                              522  printer->add_newline(2);
                                              -
                                              523  printer->add_line("/** connect global (array) variables to hoc -- */");
                                              -
                                              524  printer->add_line("static DoubVec hoc_vector_double[] = {");
                                              -
                                              525  printer->increase_indent();
                                              -
                                              526  variable_printer(globals, true, true);
                                              -
                                              527  variable_printer(thread_vars, true, true);
                                              -
                                              528  printer->add_line("{nullptr, nullptr, 0}");
                                              -
                                              529  printer->decrease_indent();
                                              -
                                              530  printer->add_line("};");
                                              -
                                              531 }
                                              -
                                              532 
                                              - -
                                              534  printer->add_newline(2);
                                              -
                                              535  printer->fmt_push_block("static {} make_instance_{}(_nrn_mechanism_cache_range& _ml)",
                                              -
                                              536  instance_struct(),
                                              -
                                              537  info.mod_suffix);
                                              -
                                              538  printer->fmt_push_block("return {}", instance_struct());
                                              -
                                              539 
                                              -
                                              540  const auto codegen_float_variables_size = codegen_float_variables.size();
                                              -
                                              541  for (int i = 0; i < codegen_float_variables_size; ++i) {
                                              -
                                              542  const auto& float_var = codegen_float_variables[i];
                                              -
                                              543  if (float_var->is_array()) {
                                              -
                                              544  printer->fmt_line("_ml.template data_array<{}, {}>(0){}",
                                              -
                                              545  i,
                                              -
                                              546  float_var->get_length(),
                                              -
                                              547  i < codegen_float_variables_size - 1 ? "," : "");
                                              -
                                              548  } else {
                                              -
                                              549  printer->fmt_line("&_ml.template fpfield<{}>(0){}",
                                              -
                                              550  i,
                                              -
                                              551  i < codegen_float_variables_size - 1 ? "," : "");
                                              -
                                              552  }
                                              -
                                              553  }
                                              -
                                              554  printer->pop_block(";");
                                              -
                                              555  printer->pop_block();
                                              -
                                              556 }
                                              -
                                              557 
                                              - -
                                              559  /// TODO: Write this according to NEURON
                                              -
                                              560  printer->add_newline(2);
                                              -
                                              561  printer->add_line("/** register channel with the simulator */");
                                              -
                                              562  printer->fmt_push_block("extern \"C\" void _{}_reg()", info.mod_file);
                                              -
                                              563  printer->add_line("_initlists();");
                                              -
                                              564  printer->add_newline();
                                              -
                                              565 
                                              -
                                              566  const auto compute_functions_parameters =
                                              -
                                              567  breakpoint_exist()
                                              -
                                              568  ? fmt::format("{}, {}, {}",
                                              -
                                              569  nrn_cur_required() ? method_name(naming::NRN_CUR_METHOD) : "nullptr",
                                              -
                                              570  method_name(naming::NRN_JACOB_METHOD),
                                              -
                                              571  nrn_state_required() ? method_name(naming::NRN_STATE_METHOD) : "nullptr")
                                              -
                                              572  : "nullptr, nullptr, nullptr";
                                              -
                                              573  const auto register_mech_args = fmt::format("{}, {}, {}, {}, {}, {}",
                                              -
                                              574  get_channel_info_var_name(),
                                              -
                                              575  method_name(naming::NRN_ALLOC_METHOD),
                                              -
                                              576  compute_functions_parameters,
                                              -
                                              577  method_name(naming::NRN_INIT_METHOD),
                                              - -
                                              579  1 + info.thread_data_index);
                                              -
                                              580  printer->fmt_line("register_mech({});", register_mech_args);
                                              -
                                              581 
                                              -
                                              582  // type related information
                                              -
                                              583  printer->add_newline();
                                              -
                                              584  printer->fmt_line("mech_type = nrn_get_mechtype({}[1]);", get_channel_info_var_name());
                                              -
                                              585 
                                              -
                                              586  // More things to add here
                                              -
                                              587  printer->add_line("_nrn_mechanism_register_data_fields(mech_type,");
                                              -
                                              588  printer->increase_indent();
                                              -
                                              589  const auto codegen_float_variables_size = codegen_float_variables.size();
                                              -
                                              590  for (int i = 0; i < codegen_float_variables_size; ++i) {
                                              -
                                              591  const auto& float_var = codegen_float_variables[i];
                                              -
                                              592  const auto print_comma = i < codegen_float_variables_size - 1 || info.emit_cvode;
                                              -
                                              593  if (float_var->is_array()) {
                                              -
                                              594  printer->fmt_line("_nrn_mechanism_field<double>{{\"{}\", {}}} /* {} */{}",
                                              -
                                              595  float_var->get_name(),
                                              -
                                              596  float_var->get_length(),
                                              -
                                              597  i,
                                              -
                                              598  print_comma ? "," : "");
                                              -
                                              599  } else {
                                              -
                                              600  printer->fmt_line("_nrn_mechanism_field<double>{{\"{}\"}} /* {} */{}",
                                              -
                                              601  float_var->get_name(),
                                              -
                                              602  i,
                                              -
                                              603  print_comma ? "," : "");
                                              -
                                              604  }
                                              -
                                              605  }
                                              -
                                              606  if (info.emit_cvode) {
                                              -
                                              607  printer->add_line("_nrn_mechanism_field<int>{\"_cvode_ieq\", \"cvodeieq\"} /* 0 */");
                                              -
                                              608  }
                                              -
                                              609  printer->decrease_indent();
                                              -
                                              610  printer->add_line(");");
                                              -
                                              611  printer->add_newline();
                                              -
                                              612  printer->pop_block();
                                              -
                                              613 }
                                              -
                                              614 
                                              -
                                              615 
                                              - -
                                              617  auto const value_initialize = print_initializers ? "{}" : "";
                                              -
                                              618  auto int_type = default_int_data_type();
                                              -
                                              619  printer->add_newline(2);
                                              -
                                              620  printer->add_line("/** all mechanism instance variables and global variables */");
                                              -
                                              621  printer->fmt_push_block("struct {} ", instance_struct());
                                              -
                                              622 
                                              -
                                              623  for (auto const& [var, type]: info.neuron_global_variables) {
                                              -
                                              624  auto const name = var->get_name();
                                              -
                                              625  printer->fmt_line("{}* {}{};",
                                              -
                                              626  type,
                                              -
                                              627  name,
                                              -
                                              628  print_initializers ? fmt::format("{{&coreneuron::{}}}", name)
                                              -
                                              629  : std::string{});
                                              -
                                              630  }
                                              -
                                              631  for (auto& var: codegen_float_variables) {
                                              -
                                              632  const auto& name = var->get_name();
                                              -
                                              633  printer->fmt_line("double* {}{};", name, value_initialize);
                                              -
                                              634  }
                                              -
                                              635  for (auto& var: codegen_int_variables) {
                                              -
                                              636  const auto& name = var.symbol->get_name();
                                              -
                                              637  if (var.is_index || var.is_integer) {
                                              -
                                              638  auto qualifier = var.is_constant ? "const " : "";
                                              -
                                              639  printer->fmt_line("{}{}* {}{};", qualifier, int_type, name, value_initialize);
                                              -
                                              640  } else {
                                              -
                                              641  auto qualifier = var.is_constant ? "const " : "";
                                              -
                                              642  auto type = var.is_vdata ? "void*" : default_float_data_type();
                                              -
                                              643  printer->fmt_line("{}{}* {}{};", qualifier, type, name, value_initialize);
                                              -
                                              644  }
                                              -
                                              645  }
                                              -
                                              646 
                                              -
                                              647  printer->fmt_line("{}* {}{};",
                                              -
                                              648  global_struct(),
                                              - -
                                              650  print_initializers ? fmt::format("{{&{}}}", global_struct_instance())
                                              -
                                              651  : std::string{});
                                              -
                                              652  printer->pop_block(";");
                                              -
                                              653 }
                                              -
                                              654 
                                              -
                                              655 
                                              - -
                                              657  // initial block
                                              -
                                              658  if (node != nullptr) {
                                              -
                                              659  const auto& block = node->get_statement_block();
                                              -
                                              660  print_statement_block(*block, false, false);
                                              -
                                              661  }
                                              -
                                              662 }
                                              -
                                              663 
                                              -
                                              664 
                                              - -
                                              666  const std::string& function_name) {
                                              -
                                              667  std::string method = function_name.empty() ? compute_method_name(type) : function_name;
                                              -
                                              668  std::string args =
                                              -
                                              669  "_nrn_model_sorted_token const& _sorted_token, NrnThread* _nt, Memb_list* _ml_arg, int "
                                              -
                                              670  "_type";
                                              -
                                              671  printer->fmt_push_block("void {}({})", method, args);
                                              -
                                              672 
                                              -
                                              673  printer->add_line("_nrn_mechanism_cache_range _lmr{_sorted_token, *_nt, *_ml_arg, _type};");
                                              -
                                              674  printer->fmt_line("auto inst = make_instance_{}(_lmr);", info.mod_suffix);
                                              -
                                              675  printer->add_line("auto nodecount = _ml_arg->nodecount;");
                                              -
                                              676 }
                                              +
                                              449  if (info.table_count > 0) {
                                              +
                                              450  throw std::runtime_error("Not implemented, global table count.");
                                              +
                                              451  }
                                              +
                                              452 
                                              +
                                              453  for (const auto& var: info.state_vars) {
                                              +
                                              454  auto name = var->get_name() + "0";
                                              +
                                              455  auto symbol = program_symtab->lookup(name);
                                              +
                                              456  if (symbol == nullptr) {
                                              +
                                              457  printer->fmt_line("{} {}{};", float_type, name, value_initialize);
                                              +
                                              458  codegen_global_variables.push_back(make_symbol(name));
                                              +
                                              459  }
                                              +
                                              460  }
                                              +
                                              461 
                                              +
                                              462  for (const auto& var: info.global_variables) {
                                              +
                                              463  auto name = var->get_name();
                                              +
                                              464  auto length = var->get_length();
                                              +
                                              465  if (var->is_array()) {
                                              +
                                              466  printer->fmt_line("{} {}[{}] /* TODO init const-array */;", float_type, name, length);
                                              +
                                              467  } else {
                                              +
                                              468  double value{};
                                              +
                                              469  if (auto const& value_ptr = var->get_value()) {
                                              +
                                              470  value = *value_ptr;
                                              +
                                              471  }
                                              +
                                              472  printer->fmt_line("{} {}{};",
                                              +
                                              473  float_type,
                                              +
                                              474  name,
                                              +
                                              475  print_initializers ? fmt::format("{{{:g}}}", value) : std::string{});
                                              +
                                              476  }
                                              +
                                              477  codegen_global_variables.push_back(var);
                                              +
                                              478  }
                                              +
                                              479 
                                              +
                                              480 
                                              +
                                              481  for (const auto& f: info.function_tables) {
                                              +
                                              482  throw std::runtime_error("Not implemented, global function tables.");
                                              +
                                              483  }
                                              +
                                              484 
                                              +
                                              485  if (info.vectorize && info.thread_data_index) {
                                              +
                                              486  throw std::runtime_error("Not implemented, global vectorize something else.");
                                              +
                                              487  }
                                              +
                                              488 
                                              +
                                              489  printer->pop_block(";");
                                              +
                                              490 
                                              +
                                              491  print_global_var_struct_assertions();
                                              +
                                              492  print_global_var_struct_decl();
                                              +
                                              493 }
                                              +
                                              494 
                                              +
                                              495 
                                              +
                                              496 /// TODO: Same as CoreNEURON?
                                              + +
                                              498  /// TODO: Write HocParmLimits and other HOC global variables (delta_t)
                                              +
                                              499  // Probably needs more changes
                                              +
                                              500  auto variable_printer =
                                              +
                                              501  [&](const std::vector<SymbolType>& variables, bool if_array, bool if_vector) {
                                              +
                                              502  for (const auto& variable: variables) {
                                              +
                                              503  if (variable->is_array() == if_array) {
                                              +
                                              504  // false => do not use the instance struct, which is not
                                              +
                                              505  // defined in the global declaration that we are printing
                                              +
                                              506  auto name = get_variable_name(variable->get_name(), false);
                                              +
                                              507  auto ename = add_escape_quote(variable->get_name() + "_" + info.mod_suffix);
                                              +
                                              508  auto length = variable->get_length();
                                              +
                                              509  if (if_vector) {
                                              +
                                              510  printer->fmt_line("{{{}, {}, {}}},", ename, name, length);
                                              +
                                              511  } else {
                                              +
                                              512  printer->fmt_line("{{{}, &{}}},", ename, name);
                                              +
                                              513  }
                                              +
                                              514  }
                                              +
                                              515  }
                                              +
                                              516  };
                                              +
                                              517 
                                              +
                                              518  auto globals = info.global_variables;
                                              +
                                              519  auto thread_vars = info.thread_variables;
                                              +
                                              520 
                                              +
                                              521  if (info.table_count > 0) {
                                              +
                                              522  globals.push_back(make_symbol(naming::USE_TABLE_VARIABLE));
                                              +
                                              523  }
                                              +
                                              524 
                                              +
                                              525  printer->add_newline(2);
                                              +
                                              526  printer->add_line("/** connect global (scalar) variables to hoc -- */");
                                              +
                                              527  printer->add_line("static DoubScal hoc_scalar_double[] = {");
                                              +
                                              528  printer->increase_indent();
                                              +
                                              529  variable_printer(globals, false, false);
                                              +
                                              530  variable_printer(thread_vars, false, false);
                                              +
                                              531  printer->add_line("{nullptr, nullptr}");
                                              +
                                              532  printer->decrease_indent();
                                              +
                                              533  printer->add_line("};");
                                              +
                                              534 
                                              +
                                              535  printer->add_newline(2);
                                              +
                                              536  printer->add_line("/** connect global (array) variables to hoc -- */");
                                              +
                                              537  printer->add_line("static DoubVec hoc_vector_double[] = {");
                                              +
                                              538  printer->increase_indent();
                                              +
                                              539  variable_printer(globals, true, true);
                                              +
                                              540  variable_printer(thread_vars, true, true);
                                              +
                                              541  printer->add_line("{nullptr, nullptr, 0}");
                                              +
                                              542  printer->decrease_indent();
                                              +
                                              543  printer->add_line("};");
                                              +
                                              544 }
                                              +
                                              545 
                                              + +
                                              547  printer->add_newline(2);
                                              +
                                              548  printer->fmt_push_block("static {} make_instance_{}(_nrn_mechanism_cache_range& _ml)",
                                              +
                                              549  instance_struct(),
                                              +
                                              550  info.mod_suffix);
                                              +
                                              551  printer->fmt_push_block("return {}", instance_struct());
                                              +
                                              552 
                                              +
                                              553  const auto codegen_float_variables_size = codegen_float_variables.size();
                                              +
                                              554  for (int i = 0; i < codegen_float_variables_size; ++i) {
                                              +
                                              555  const auto& float_var = codegen_float_variables[i];
                                              +
                                              556  if (float_var->is_array()) {
                                              +
                                              557  printer->fmt_line("_ml.template data_array<{}, {}>(0){}",
                                              +
                                              558  i,
                                              +
                                              559  float_var->get_length(),
                                              +
                                              560  i < codegen_float_variables_size - 1 ? "," : "");
                                              +
                                              561  } else {
                                              +
                                              562  printer->fmt_line("&_ml.template fpfield<{}>(0){}",
                                              +
                                              563  i,
                                              +
                                              564  i < codegen_float_variables_size - 1 ? "," : "");
                                              +
                                              565  }
                                              +
                                              566  }
                                              +
                                              567  printer->pop_block(";");
                                              +
                                              568  printer->pop_block();
                                              +
                                              569 }
                                              +
                                              570 
                                              + +
                                              572  /// TODO: Write this according to NEURON
                                              +
                                              573  printer->add_newline(2);
                                              +
                                              574  printer->add_line("/** register channel with the simulator */");
                                              +
                                              575  printer->fmt_push_block("extern \"C\" void _{}_reg()", info.mod_file);
                                              +
                                              576  printer->add_line("_initlists();");
                                              +
                                              577  printer->add_newline();
                                              +
                                              578 
                                              +
                                              579  const auto compute_functions_parameters =
                                              +
                                              580  breakpoint_exist()
                                              +
                                              581  ? fmt::format("{}, {}, {}",
                                              +
                                              582  nrn_cur_required() ? method_name(naming::NRN_CUR_METHOD) : "nullptr",
                                              +
                                              583  method_name(naming::NRN_JACOB_METHOD),
                                              +
                                              584  nrn_state_required() ? method_name(naming::NRN_STATE_METHOD) : "nullptr")
                                              +
                                              585  : "nullptr, nullptr, nullptr";
                                              +
                                              586  const auto register_mech_args = fmt::format("{}, {}, {}, {}, {}, {}",
                                              +
                                              587  get_channel_info_var_name(),
                                              +
                                              588  method_name(naming::NRN_ALLOC_METHOD),
                                              +
                                              589  compute_functions_parameters,
                                              +
                                              590  method_name(naming::NRN_INIT_METHOD),
                                              + +
                                              592  1 + info.thread_data_index);
                                              +
                                              593  printer->fmt_line("register_mech({});", register_mech_args);
                                              +
                                              594 
                                              +
                                              595  // type related information
                                              +
                                              596  printer->add_newline();
                                              +
                                              597  printer->fmt_line("mech_type = nrn_get_mechtype({}[1]);", get_channel_info_var_name());
                                              +
                                              598 
                                              +
                                              599  // More things to add here
                                              +
                                              600  printer->add_line("_nrn_mechanism_register_data_fields(mech_type,");
                                              +
                                              601  printer->increase_indent();
                                              +
                                              602  const auto codegen_float_variables_size = codegen_float_variables.size();
                                              +
                                              603  for (int i = 0; i < codegen_float_variables_size; ++i) {
                                              +
                                              604  const auto& float_var = codegen_float_variables[i];
                                              +
                                              605  const auto print_comma = i < codegen_float_variables_size - 1 || info.emit_cvode;
                                              +
                                              606  if (float_var->is_array()) {
                                              +
                                              607  printer->fmt_line("_nrn_mechanism_field<double>{{\"{}\", {}}} /* {} */{}",
                                              +
                                              608  float_var->get_name(),
                                              +
                                              609  float_var->get_length(),
                                              +
                                              610  i,
                                              +
                                              611  print_comma ? "," : "");
                                              +
                                              612  } else {
                                              +
                                              613  printer->fmt_line("_nrn_mechanism_field<double>{{\"{}\"}} /* {} */{}",
                                              +
                                              614  float_var->get_name(),
                                              +
                                              615  i,
                                              +
                                              616  print_comma ? "," : "");
                                              +
                                              617  }
                                              +
                                              618  }
                                              +
                                              619  if (info.emit_cvode) {
                                              +
                                              620  printer->add_line("_nrn_mechanism_field<int>{\"_cvode_ieq\", \"cvodeieq\"} /* 0 */");
                                              +
                                              621  }
                                              +
                                              622  printer->decrease_indent();
                                              +
                                              623  printer->add_line(");");
                                              +
                                              624  printer->add_newline();
                                              +
                                              625  printer->pop_block();
                                              +
                                              626 }
                                              +
                                              627 
                                              +
                                              628 
                                              + +
                                              630  auto const value_initialize = print_initializers ? "{}" : "";
                                              +
                                              631  auto int_type = default_int_data_type();
                                              +
                                              632  printer->add_newline(2);
                                              +
                                              633  printer->add_line("/** all mechanism instance variables and global variables */");
                                              +
                                              634  printer->fmt_push_block("struct {} ", instance_struct());
                                              +
                                              635 
                                              +
                                              636  for (auto const& [var, type]: info.neuron_global_variables) {
                                              +
                                              637  auto const name = var->get_name();
                                              +
                                              638  printer->fmt_line("{}* {}{};",
                                              +
                                              639  type,
                                              +
                                              640  name,
                                              +
                                              641  print_initializers ? fmt::format("{{&coreneuron::{}}}", name)
                                              +
                                              642  : std::string{});
                                              +
                                              643  }
                                              +
                                              644  for (auto& var: codegen_float_variables) {
                                              +
                                              645  const auto& name = var->get_name();
                                              +
                                              646  printer->fmt_line("double* {}{};", name, value_initialize);
                                              +
                                              647  }
                                              +
                                              648  for (auto& var: codegen_int_variables) {
                                              +
                                              649  const auto& name = var.symbol->get_name();
                                              +
                                              650  if (var.is_index || var.is_integer) {
                                              +
                                              651  auto qualifier = var.is_constant ? "const " : "";
                                              +
                                              652  printer->fmt_line("{}{}* {}{};", qualifier, int_type, name, value_initialize);
                                              +
                                              653  } else {
                                              +
                                              654  auto qualifier = var.is_constant ? "const " : "";
                                              +
                                              655  auto type = var.is_vdata ? "void*" : default_float_data_type();
                                              +
                                              656  printer->fmt_line("{}{}* {}{};", qualifier, type, name, value_initialize);
                                              +
                                              657  }
                                              +
                                              658  }
                                              +
                                              659 
                                              +
                                              660  printer->fmt_line("{}* {}{};",
                                              +
                                              661  global_struct(),
                                              + +
                                              663  print_initializers ? fmt::format("{{&{}}}", global_struct_instance())
                                              +
                                              664  : std::string{});
                                              +
                                              665  printer->pop_block(";");
                                              +
                                              666 }
                                              +
                                              667 
                                              +
                                              668 
                                              + +
                                              670  // initial block
                                              +
                                              671  if (node != nullptr) {
                                              +
                                              672  const auto& block = node->get_statement_block();
                                              +
                                              673  print_statement_block(*block, false, false);
                                              +
                                              674  }
                                              +
                                              675 }
                                              +
                                              676 
                                              677 
                                              -
                                              678 
                                              -
                                              679 void CodegenNeuronCppVisitor::print_nrn_init(bool skip_init_check) {
                                              -
                                              680  printer->add_newline(2);
                                              -
                                              681 
                                              -
                                              682  print_global_function_common_code(BlockType::Initial);
                                              -
                                              683 
                                              -
                                              684  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              -
                                              685  print_initial_block(info.initial_node);
                                              -
                                              686  printer->pop_block();
                                              -
                                              687 
                                              -
                                              688  printer->pop_block();
                                              + +
                                              679  const std::string& function_name) {
                                              +
                                              680  std::string method = function_name.empty() ? compute_method_name(type) : function_name;
                                              +
                                              681  std::string args =
                                              +
                                              682  "_nrn_model_sorted_token const& _sorted_token, NrnThread* _nt, Memb_list* _ml_arg, int "
                                              +
                                              683  "_type";
                                              +
                                              684  printer->fmt_push_block("void {}({})", method, args);
                                              +
                                              685 
                                              +
                                              686  printer->add_line("_nrn_mechanism_cache_range _lmr{_sorted_token, *_nt, *_ml_arg, _type};");
                                              +
                                              687  printer->fmt_line("auto inst = make_instance_{}(_lmr);", info.mod_suffix);
                                              +
                                              688  printer->add_line("auto nodecount = _ml_arg->nodecount;");
                                              689 }
                                              690 
                                              - -
                                              692  printer->add_newline(2);
                                              -
                                              693  printer->add_line("/** nrn_jacob function */");
                                              +
                                              691 
                                              +
                                              692 void CodegenNeuronCppVisitor::print_nrn_init(bool skip_init_check) {
                                              +
                                              693  printer->add_newline(2);
                                              694 
                                              -
                                              695  printer->fmt_line(
                                              -
                                              696  "static void {}(_nrn_model_sorted_token const& _sorted_token, NrnThread* "
                                              -
                                              697  "_nt, Memb_list* _ml_arg, int _type) {{}}",
                                              -
                                              698  method_name(naming::NRN_JACOB_METHOD));
                                              -
                                              699 }
                                              +
                                              695  print_global_function_common_code(BlockType::Initial);
                                              +
                                              696 
                                              +
                                              697  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              +
                                              698  print_initial_block(info.initial_node);
                                              +
                                              699  printer->pop_block();
                                              700 
                                              -
                                              701 
                                              -
                                              702 /// TODO: Edit for NEURON
                                              - -
                                              704  return;
                                              -
                                              705 }
                                              -
                                              706 
                                              -
                                              707 
                                              -
                                              708 /// TODO: Edit for NEURON
                                              - -
                                              710  return;
                                              -
                                              711 }
                                              -
                                              712 
                                              -
                                              713 
                                              -
                                              714 /// TODO: Print the equivalent of `nrn_alloc_<mech_name>`
                                              - -
                                              716  printer->add_newline(2);
                                              -
                                              717  auto method = method_name(naming::NRN_ALLOC_METHOD);
                                              -
                                              718  printer->fmt_push_block("static void {}(Prop* _prop)", method);
                                              -
                                              719  printer->add_line("// do nothing");
                                              -
                                              720  printer->pop_block();
                                              -
                                              721 }
                                              -
                                              722 
                                              -
                                              723 
                                              -
                                              724 /****************************************************************************************/
                                              -
                                              725 /* Print nrn_state routine */
                                              -
                                              726 /****************************************************************************************/
                                              -
                                              727 
                                              -
                                              728 
                                              -
                                              729 /// TODO: Edit for NEURON
                                              - -
                                              731  if (!nrn_state_required()) {
                                              -
                                              732  return;
                                              -
                                              733  }
                                              -
                                              734 
                                              -
                                              735  printer->add_newline(2);
                                              -
                                              736  print_global_function_common_code(BlockType::State);
                                              -
                                              737 
                                              -
                                              738  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              -
                                              739 
                                              -
                                              740  if (info.nrn_state_block) {
                                              -
                                              741  info.nrn_state_block->visit_children(*this);
                                              -
                                              742  }
                                              -
                                              743 
                                              -
                                              744  if (info.currents.empty() && info.breakpoint_node != nullptr) {
                                              -
                                              745  auto block = info.breakpoint_node->get_statement_block();
                                              -
                                              746  print_statement_block(*block, false, false);
                                              -
                                              747  }
                                              -
                                              748 
                                              -
                                              749  printer->pop_block();
                                              -
                                              750  printer->pop_block();
                                              -
                                              751 }
                                              +
                                              701  printer->pop_block();
                                              +
                                              702 }
                                              +
                                              703 
                                              + +
                                              705  printer->add_newline(2);
                                              +
                                              706  printer->add_line("/** nrn_jacob function */");
                                              +
                                              707 
                                              +
                                              708  printer->fmt_line(
                                              +
                                              709  "static void {}(_nrn_model_sorted_token const& _sorted_token, NrnThread* "
                                              +
                                              710  "_nt, Memb_list* _ml_arg, int _type) {{}}",
                                              +
                                              711  method_name(naming::NRN_JACOB_METHOD));
                                              +
                                              712 }
                                              +
                                              713 
                                              +
                                              714 
                                              +
                                              715 /// TODO: Edit for NEURON
                                              + +
                                              717  return;
                                              +
                                              718 }
                                              +
                                              719 
                                              +
                                              720 
                                              +
                                              721 /// TODO: Edit for NEURON
                                              + +
                                              723  return;
                                              +
                                              724 }
                                              +
                                              725 
                                              +
                                              726 
                                              +
                                              727 /// TODO: Print the equivalent of `nrn_alloc_<mech_name>`
                                              + +
                                              729  printer->add_newline(2);
                                              +
                                              730  auto method = method_name(naming::NRN_ALLOC_METHOD);
                                              +
                                              731  printer->fmt_push_block("static void {}(Prop* _prop)", method);
                                              +
                                              732  printer->add_line("// do nothing");
                                              +
                                              733  printer->pop_block();
                                              +
                                              734 }
                                              +
                                              735 
                                              +
                                              736 
                                              +
                                              737 /****************************************************************************************/
                                              +
                                              738 /* Print nrn_state routine */
                                              +
                                              739 /****************************************************************************************/
                                              +
                                              740 
                                              +
                                              741 
                                              +
                                              742 /// TODO: Edit for NEURON
                                              + +
                                              744  if (!nrn_state_required()) {
                                              +
                                              745  return;
                                              +
                                              746  }
                                              +
                                              747 
                                              +
                                              748  printer->add_newline(2);
                                              +
                                              749  print_global_function_common_code(BlockType::State);
                                              +
                                              750 
                                              +
                                              751  printer->push_block("for (int id = 0; id < nodecount; id++)");
                                              752 
                                              -
                                              753 
                                              -
                                              754 /****************************************************************************************/
                                              -
                                              755 /* Print nrn_cur related routines */
                                              -
                                              756 /****************************************************************************************/
                                              -
                                              757 
                                              -
                                              758 
                                              -
                                              759 /// TODO: Edit for NEURON
                                              - -
                                              761  return;
                                              -
                                              762 }
                                              -
                                              763 
                                              -
                                              764 
                                              -
                                              765 /// TODO: Edit for NEURON
                                              - -
                                              767  return;
                                              -
                                              768 }
                                              -
                                              769 
                                              -
                                              770 
                                              -
                                              771 /// TODO: Edit for NEURON
                                              - -
                                              773  return;
                                              -
                                              774 }
                                              -
                                              775 
                                              -
                                              776 
                                              -
                                              777 /// TODO: Edit for NEURON
                                              - -
                                              779  return;
                                              -
                                              780 }
                                              -
                                              781 
                                              -
                                              782 
                                              -
                                              783 /// TODO: Edit for NEURON
                                              - -
                                              785  return;
                                              -
                                              786 }
                                              -
                                              787 
                                              -
                                              788 
                                              -
                                              789 /// TODO: Edit for NEURON
                                              - -
                                              791  if (!nrn_cur_required()) {
                                              -
                                              792  return;
                                              -
                                              793  }
                                              +
                                              753  if (info.nrn_state_block) {
                                              +
                                              754  info.nrn_state_block->visit_children(*this);
                                              +
                                              755  }
                                              +
                                              756 
                                              +
                                              757  if (info.currents.empty() && info.breakpoint_node != nullptr) {
                                              +
                                              758  auto block = info.breakpoint_node->get_statement_block();
                                              +
                                              759  print_statement_block(*block, false, false);
                                              +
                                              760  }
                                              +
                                              761 
                                              +
                                              762  printer->pop_block();
                                              +
                                              763  printer->pop_block();
                                              +
                                              764 }
                                              +
                                              765 
                                              +
                                              766 
                                              +
                                              767 /****************************************************************************************/
                                              +
                                              768 /* Print nrn_cur related routines */
                                              +
                                              769 /****************************************************************************************/
                                              +
                                              770 
                                              +
                                              771 
                                              +
                                              772 /// TODO: Edit for NEURON
                                              + +
                                              774  return;
                                              +
                                              775 }
                                              +
                                              776 
                                              +
                                              777 
                                              +
                                              778 /// TODO: Edit for NEURON
                                              + +
                                              780  return;
                                              +
                                              781 }
                                              +
                                              782 
                                              +
                                              783 
                                              +
                                              784 /// TODO: Edit for NEURON
                                              + +
                                              786  return;
                                              +
                                              787 }
                                              +
                                              788 
                                              +
                                              789 
                                              +
                                              790 /// TODO: Edit for NEURON
                                              + +
                                              792  return;
                                              +
                                              793 }
                                              794 
                                              -
                                              795  printer->add_newline(2);
                                              -
                                              796 
                                              -
                                              797  printer->fmt_line(
                                              -
                                              798  "void {}(_nrn_model_sorted_token const& _sorted_token, NrnThread* _nt, Memb_list* _ml_arg, "
                                              -
                                              799  "int _type) {{}}",
                                              -
                                              800  method_name(naming::NRN_CUR_METHOD));
                                              +
                                              795 
                                              +
                                              796 /// TODO: Edit for NEURON
                                              + +
                                              798  return;
                                              +
                                              799 }
                                              +
                                              800 
                                              801 
                                              -
                                              802  /// TODO: Fill in
                                              -
                                              803 }
                                              -
                                              804 
                                              -
                                              805 
                                              -
                                              806 /****************************************************************************************/
                                              -
                                              807 /* Main code printing entry points */
                                              -
                                              808 /****************************************************************************************/
                                              +
                                              802 /// TODO: Edit for NEURON
                                              + +
                                              804  if (!nrn_cur_required()) {
                                              +
                                              805  return;
                                              +
                                              806  }
                                              +
                                              807 
                                              +
                                              808  printer->add_newline(2);
                                              809 
                                              - -
                                              811  print_standard_includes();
                                              -
                                              812  print_neuron_includes();
                                              -
                                              813 }
                                              -
                                              814 
                                              -
                                              815 
                                              - -
                                              817  print_global_macros();
                                              -
                                              818  print_mechanism_variables_macros();
                                              -
                                              819 }
                                              -
                                              820 
                                              -
                                              821 
                                              - -
                                              823  printer->add_newline();
                                              -
                                              824  printer->add_line("/* NEURON global macro definitions */");
                                              -
                                              825  if (info.vectorize) {
                                              -
                                              826  printer->add_multi_line(R"CODE(
                                              -
                                              827  /* VECTORIZED */
                                              -
                                              828  #define NRN_VECTORIZED 1
                                              -
                                              829  )CODE");
                                              -
                                              830  } else {
                                              -
                                              831  printer->add_multi_line(R"CODE(
                                              -
                                              832  /* NOT VECTORIZED */
                                              -
                                              833  #define NRN_VECTORIZED 0
                                              -
                                              834  )CODE");
                                              -
                                              835  }
                                              -
                                              836 }
                                              -
                                              837 
                                              -
                                              838 
                                              - -
                                              840  printer->add_newline();
                                              -
                                              841  printer->add_line("static constexpr auto number_of_datum_variables = ",
                                              -
                                              842  std::to_string(int_variables_size()),
                                              -
                                              843  ";");
                                              -
                                              844  printer->add_line("static constexpr auto number_of_floating_point_variables = ",
                                              -
                                              845  std::to_string(float_variables_size()),
                                              -
                                              846  ";");
                                              -
                                              847  printer->add_newline();
                                              -
                                              848  printer->add_multi_line(R"CODE(
                                              -
                                              849  namespace {
                                              -
                                              850  template <typename T>
                                              -
                                              851  using _nrn_mechanism_std_vector = std::vector<T>;
                                              -
                                              852  using _nrn_model_sorted_token = neuron::model_sorted_token;
                                              -
                                              853  using _nrn_mechanism_cache_range = neuron::cache::MechanismRange<number_of_floating_point_variables, number_of_datum_variables>;
                                              -
                                              854  using _nrn_mechanism_cache_instance = neuron::cache::MechanismInstance<number_of_floating_point_variables, number_of_datum_variables>;
                                              -
                                              855  using _nrn_non_owning_id_without_container = neuron::container::non_owning_identifier_without_container;
                                              -
                                              856  template <typename T>
                                              -
                                              857  using _nrn_mechanism_field = neuron::mechanism::field<T>;
                                              -
                                              858  template <typename... Args>
                                              -
                                              859  void _nrn_mechanism_register_data_fields(Args&&... args) {
                                              -
                                              860  neuron::mechanism::register_data_fields(std::forward<Args>(args)...);
                                              -
                                              861  }
                                              -
                                              862  } // namespace
                                              -
                                              863  )CODE");
                                              -
                                              864  /// TODO: More prints here?
                                              -
                                              865 }
                                              -
                                              866 
                                              -
                                              867 
                                              - -
                                              869  print_namespace_start();
                                              -
                                              870 }
                                              -
                                              871 
                                              -
                                              872 
                                              - -
                                              874  print_namespace_stop();
                                              -
                                              875 }
                                              -
                                              876 
                                              -
                                              877 
                                              -
                                              878 void CodegenNeuronCppVisitor::print_data_structures(bool print_initializers) {
                                              -
                                              879  print_mechanism_global_var_structure(print_initializers);
                                              -
                                              880  print_mechanism_range_var_structure(print_initializers);
                                              -
                                              881  print_make_instance();
                                              -
                                              882 }
                                              -
                                              883 
                                              +
                                              810  printer->fmt_line(
                                              +
                                              811  "void {}(_nrn_model_sorted_token const& _sorted_token, NrnThread* _nt, Memb_list* _ml_arg, "
                                              +
                                              812  "int _type) {{}}",
                                              +
                                              813  method_name(naming::NRN_CUR_METHOD));
                                              +
                                              814 
                                              +
                                              815  /// TODO: Fill in
                                              +
                                              816 }
                                              +
                                              817 
                                              +
                                              818 
                                              +
                                              819 /****************************************************************************************/
                                              +
                                              820 /* Main code printing entry points */
                                              +
                                              821 /****************************************************************************************/
                                              +
                                              822 
                                              + +
                                              824  print_standard_includes();
                                              +
                                              825  print_neuron_includes();
                                              +
                                              826 }
                                              +
                                              827 
                                              +
                                              828 
                                              + +
                                              830  print_global_macros();
                                              +
                                              831  print_mechanism_variables_macros();
                                              +
                                              832 }
                                              +
                                              833 
                                              +
                                              834 
                                              + +
                                              836  printer->add_newline();
                                              +
                                              837  printer->add_line("/* NEURON global macro definitions */");
                                              +
                                              838  if (info.vectorize) {
                                              +
                                              839  printer->add_multi_line(R"CODE(
                                              +
                                              840  /* VECTORIZED */
                                              +
                                              841  #define NRN_VECTORIZED 1
                                              +
                                              842  )CODE");
                                              +
                                              843  } else {
                                              +
                                              844  printer->add_multi_line(R"CODE(
                                              +
                                              845  /* NOT VECTORIZED */
                                              +
                                              846  #define NRN_VECTORIZED 0
                                              +
                                              847  )CODE");
                                              +
                                              848  }
                                              +
                                              849 }
                                              +
                                              850 
                                              +
                                              851 
                                              + +
                                              853  printer->add_newline();
                                              +
                                              854  printer->add_line("static constexpr auto number_of_datum_variables = ",
                                              +
                                              855  std::to_string(int_variables_size()),
                                              +
                                              856  ";");
                                              +
                                              857  printer->add_line("static constexpr auto number_of_floating_point_variables = ",
                                              +
                                              858  std::to_string(float_variables_size()),
                                              +
                                              859  ";");
                                              +
                                              860  printer->add_newline();
                                              +
                                              861  printer->add_multi_line(R"CODE(
                                              +
                                              862  namespace {
                                              +
                                              863  template <typename T>
                                              +
                                              864  using _nrn_mechanism_std_vector = std::vector<T>;
                                              +
                                              865  using _nrn_model_sorted_token = neuron::model_sorted_token;
                                              +
                                              866  using _nrn_mechanism_cache_range = neuron::cache::MechanismRange<number_of_floating_point_variables, number_of_datum_variables>;
                                              +
                                              867  using _nrn_mechanism_cache_instance = neuron::cache::MechanismInstance<number_of_floating_point_variables, number_of_datum_variables>;
                                              +
                                              868  using _nrn_non_owning_id_without_container = neuron::container::non_owning_identifier_without_container;
                                              +
                                              869  template <typename T>
                                              +
                                              870  using _nrn_mechanism_field = neuron::mechanism::field<T>;
                                              +
                                              871  template <typename... Args>
                                              +
                                              872  void _nrn_mechanism_register_data_fields(Args&&... args) {
                                              +
                                              873  neuron::mechanism::register_data_fields(std::forward<Args>(args)...);
                                              +
                                              874  }
                                              +
                                              875  } // namespace
                                              +
                                              876  )CODE");
                                              +
                                              877  /// TODO: More prints here?
                                              +
                                              878 }
                                              +
                                              879 
                                              +
                                              880 
                                              + +
                                              882  print_namespace_start();
                                              +
                                              883 }
                                              884 
                                              - -
                                              886  if (!info.vectorize) {
                                              -
                                              887  return;
                                              -
                                              888  }
                                              -
                                              889  printer->add_multi_line(R"CODE(
                                              -
                                              890  #if NRN_PRCELLSTATE
                                              -
                                              891  inst->v_unused[id] = v;
                                              -
                                              892  #endif
                                              -
                                              893  )CODE");
                                              -
                                              894 }
                                              -
                                              895 
                                              -
                                              896 
                                              - -
                                              898  printer->add_multi_line(R"CODE(
                                              -
                                              899  #if NRN_PRCELLSTATE
                                              -
                                              900  inst->g_unused[id] = g;
                                              -
                                              901  #endif
                                              -
                                              902  )CODE");
                                              -
                                              903 }
                                              -
                                              904 
                                              -
                                              905 
                                              -
                                              906 /// TODO: Edit for NEURON
                                              - -
                                              908  print_nrn_init();
                                              -
                                              909  print_nrn_cur();
                                              -
                                              910  print_nrn_state();
                                              -
                                              911  print_nrn_jacob();
                                              -
                                              912 }
                                              -
                                              913 
                                              -
                                              914 
                                              -
                                              915 /// TODO: Edit for NEURON
                                              - -
                                              917  print_backend_info();
                                              -
                                              918  print_headers_include();
                                              -
                                              919  print_macro_definitions();
                                              -
                                              920  print_namespace_begin();
                                              -
                                              921  print_nmodl_constants();
                                              -
                                              922  print_prcellstate_macros();
                                              -
                                              923  print_mechanism_info();
                                              -
                                              924  print_data_structures(true);
                                              -
                                              925  print_nrn_alloc();
                                              -
                                              926  print_global_variables_for_hoc();
                                              -
                                              927  print_compute_functions(); // only nrn_cur and nrn_state
                                              -
                                              928  print_sdlists_init(true);
                                              -
                                              929  print_mechanism_register();
                                              -
                                              930  print_namespace_end();
                                              -
                                              931 }
                                              -
                                              932 
                                              - -
                                              934  throw std::runtime_error("Not implemented.");
                                              -
                                              935 }
                                              -
                                              936 
                                              - -
                                              938  throw std::runtime_error("Not implemented.");
                                              -
                                              939 }
                                              -
                                              940 
                                              - -
                                              942  throw std::runtime_error("Not implemented.");
                                              -
                                              943 }
                                              -
                                              944 
                                              +
                                              885 
                                              + +
                                              887  print_namespace_stop();
                                              +
                                              888 }
                                              +
                                              889 
                                              +
                                              890 
                                              +
                                              891 void CodegenNeuronCppVisitor::print_data_structures(bool print_initializers) {
                                              +
                                              892  print_mechanism_global_var_structure(print_initializers);
                                              +
                                              893  print_mechanism_range_var_structure(print_initializers);
                                              +
                                              894  print_make_instance();
                                              +
                                              895 }
                                              +
                                              896 
                                              +
                                              897 
                                              + +
                                              899  if (!info.vectorize) {
                                              +
                                              900  return;
                                              +
                                              901  }
                                              +
                                              902  printer->add_multi_line(R"CODE(
                                              +
                                              903  #if NRN_PRCELLSTATE
                                              +
                                              904  inst->v_unused[id] = v;
                                              +
                                              905  #endif
                                              +
                                              906  )CODE");
                                              +
                                              907 }
                                              +
                                              908 
                                              +
                                              909 
                                              + +
                                              911  printer->add_multi_line(R"CODE(
                                              +
                                              912  #if NRN_PRCELLSTATE
                                              +
                                              913  inst->g_unused[id] = g;
                                              +
                                              914  #endif
                                              +
                                              915  )CODE");
                                              +
                                              916 }
                                              +
                                              917 
                                              +
                                              918 
                                              +
                                              919 /// TODO: Edit for NEURON
                                              + +
                                              921  print_nrn_init();
                                              +
                                              922  print_nrn_cur();
                                              +
                                              923  print_nrn_state();
                                              +
                                              924  print_nrn_jacob();
                                              +
                                              925 }
                                              +
                                              926 
                                              +
                                              927 
                                              +
                                              928 /// TODO: Edit for NEURON
                                              + +
                                              930  print_backend_info();
                                              +
                                              931  print_headers_include();
                                              +
                                              932  print_macro_definitions();
                                              +
                                              933  print_namespace_begin();
                                              +
                                              934  print_nmodl_constants();
                                              +
                                              935  print_prcellstate_macros();
                                              +
                                              936  print_mechanism_info();
                                              +
                                              937  print_data_structures(true);
                                              +
                                              938  print_nrn_alloc();
                                              +
                                              939  print_global_variables_for_hoc();
                                              +
                                              940  print_compute_functions(); // only nrn_cur and nrn_state
                                              +
                                              941  print_sdlists_init(true);
                                              +
                                              942  print_mechanism_register();
                                              +
                                              943  print_namespace_end();
                                              +
                                              944 }
                                              945 
                                              -
                                              946 /****************************************************************************************/
                                              -
                                              947 /* Overloaded visitor routines */
                                              -
                                              948 /****************************************************************************************/
                                              -
                                              949 
                                              -
                                              950 /// TODO: Edit for NEURON
                                              - -
                                              952  return;
                                              -
                                              953 }
                                              -
                                              954 
                                              -
                                              955 
                                              -
                                              956 } // namespace codegen
                                              -
                                              957 } // namespace nmodl
                                              + +
                                              947  throw std::runtime_error("Not implemented.");
                                              +
                                              948 }
                                              +
                                              949 
                                              + +
                                              951  throw std::runtime_error("Not implemented.");
                                              +
                                              952 }
                                              +
                                              953 
                                              + +
                                              955  throw std::runtime_error("Not implemented.");
                                              +
                                              956 }
                                              +
                                              957 
                                              +
                                              958 
                                              +
                                              959 /****************************************************************************************/
                                              +
                                              960 /* Overloaded visitor routines */
                                              +
                                              961 /****************************************************************************************/
                                              +
                                              962 
                                              +
                                              963 /// TODO: Edit for NEURON
                                              + +
                                              965  return;
                                              +
                                              966 }
                                              +
                                              967 
                                              +
                                              968 
                                              +
                                              969 } // namespace codegen
                                              +
                                              970 } // namespace nmodl
                                              -
                                              const char * external_method_parameters(bool table=false) noexcept override
                                              Parameters for functions in generated code that are called back from external code.
                                              -
                                              void print_nrn_destructor() override
                                              Print nrn_destructor function definition.
                                              -
                                              void print_nrn_cur_non_conductance_kernel() override
                                              Print the nrn_cur kernel without NMODL conductance keyword provisions.
                                              +
                                              const char * external_method_parameters(bool table=false) noexcept override
                                              Parameters for functions in generated code that are called back from external code.
                                              +
                                              void print_nrn_destructor() override
                                              Print nrn_destructor function definition.
                                              +
                                              void print_nrn_cur_non_conductance_kernel() override
                                              Print the nrn_cur kernel without NMODL conductance keyword provisions.
                                              Helper to represent information about index/int variables.
                                              -
                                              void print_nrn_cur() override
                                              Print nrn_cur / current update function definition.
                                              -
                                              void print_macro_definitions()
                                              Print all NEURON macros.
                                              +
                                              void print_nrn_cur() override
                                              Print nrn_cur / current update function definition.
                                              +
                                              void print_macro_definitions()
                                              Print all NEURON macros.
                                              -
                                              void print_net_event_call(const ast::FunctionCall &node) override
                                              Print call to net_event.
                                              -
                                              void print_neuron_includes()
                                              Print includes from NEURON.
                                              +
                                              void print_net_event_call(const ast::FunctionCall &node) override
                                              Print call to net_event.
                                              +
                                              void print_neuron_includes()
                                              Print includes from NEURON.
                                              static constexpr char NRN_JACOB_METHOD[]
                                              nrn_jacob method in generated code
                                              -
                                              void print_nrn_init(bool skip_init_check=true)
                                              Print the nrn_init function definition.
                                              -
                                              std::string internal_method_arguments() override
                                              Arguments for functions that are defined and used internally.
                                              +
                                              void print_nrn_init(bool skip_init_check=true)
                                              Print the nrn_init function definition.
                                              +
                                              std::string internal_method_arguments() override
                                              Arguments for functions that are defined and used internally.
                                              std::shared_ptr< symtab::Symbol > SymbolType
                                              -
                                              void print_nrn_alloc() override
                                              Print nrn_alloc function definition.
                                              -
                                              std::string register_mechanism_arguments() const override
                                              Arguments for register_mech or point_register_mech function.
                                              +
                                              void print_nrn_alloc() override
                                              Print nrn_alloc function definition.
                                              +
                                              std::string register_mechanism_arguments() const override
                                              Arguments for register_mech or point_register_mech function.
                                              int position_of_int_var(const std::string &name) const override
                                              Determine the position in the data array for a given int variable.
                                              -
                                              ParamVector internal_method_parameters() override
                                              Parameters for internally defined functions.
                                              +
                                              bool optimize_ion_variable_copies() const override
                                              Check if ion variable copies should be avoided.
                                              +
                                              ParamVector internal_method_parameters() override
                                              Parameters for internally defined functions.
                                              encapsulates code generation backend implementations
                                              Definition: ast_common.hpp:26
                                              std::shared_ptr< StatementBlock > get_statement_block() const noexcept override
                                              Getter for member variable InitialBlock::statement_block.
                                              -
                                              std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
                                              Determine the variable name for a global variable given its symbol.
                                              -
                                              std::string nrn_thread_internal_arguments() override
                                              Arguments for "_threadargs_" macro in neuron implementation.
                                              +
                                              std::string global_variable_name(const SymbolType &symbol, bool use_instance=true) const override
                                              Determine the variable name for a global variable given its symbol.
                                              +
                                              std::string nrn_thread_internal_arguments() override
                                              Arguments for "_threadargs_" macro in neuron implementation.
                                              Visitor for printing C++ code compatible with legacy api of NEURON
                                              virtual std::string backend_name() const override
                                              Name of the code generation backend.
                                              -
                                              std::string process_verbatim_text(std::string const &text) override
                                              Process a verbatim block for possible variable renaming.
                                              +
                                              std::string process_verbatim_text(std::string const &text) override
                                              Process a verbatim block for possible variable renaming.
                                              static constexpr char NTHREAD_DT_VARIABLE[]
                                              dt variable in neuron thread structure
                                              -
                                              void print_g_unused() const override
                                              Set g_unused (conductance) for NRN_PRCELLSTATE feature.
                                              -
                                              virtual void visit_watch_statement(const ast::WatchStatement &node) override
                                              TODO: Edit for NEURON.
                                              -
                                              void print_net_send_call(const ast::FunctionCall &node) override
                                              Print call to net_send.
                                              +
                                              void print_g_unused() const override
                                              Set g_unused (conductance) for NRN_PRCELLSTATE feature.
                                              +
                                              virtual void visit_watch_statement(const ast::WatchStatement &node) override
                                              TODO: Edit for NEURON.
                                              +
                                              void print_net_send_call(const ast::FunctionCall &node) override
                                              Print call to net_send.
                                              Implement string manipulation functions.
                                              -
                                              void print_namespace_end() override
                                              Print end of namespaces.
                                              -
                                              void print_net_move_call(const ast::FunctionCall &node) override
                                              Print call to net_move.
                                              -
                                              void print_nrn_state() override
                                              Print nrn_state / state update function definition.
                                              +
                                              void print_namespace_end() override
                                              Print end of namespaces.
                                              +
                                              void print_net_move_call(const ast::FunctionCall &node) override
                                              Print call to net_move.
                                              +
                                              void print_nrn_state() override
                                              Print nrn_state / state update function definition.
                                              static constexpr char NRN_ALLOC_METHOD[]
                                              nrn_alloc method in generated code
                                              static const std::string GIT_REVISION
                                              git revision id
                                              Definition: config.h:33
                                              -
                                              void print_initial_block(const ast::InitialBlock *node)
                                              Print the initial block.
                                              -
                                              virtual void print_global_function_common_code(BlockType type, const std::string &function_name="") override
                                              Print common code for global functions like nrn_init, nrn_cur and nrn_state.
                                              -
                                              std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
                                              Determine the name of a float variable given its symbol.
                                              -
                                              void print_function(const ast::FunctionBlock &node) override
                                              Print NMODL function in target backend code.
                                              -
                                              void print_v_unused() const override
                                              Set v_unused (voltage) for NRN_PRCELLSTATE feature.
                                              +
                                              void print_initial_block(const ast::InitialBlock *node)
                                              Print the initial block.
                                              +
                                              virtual void print_global_function_common_code(BlockType type, const std::string &function_name="") override
                                              Print common code for global functions like nrn_init, nrn_cur and nrn_state.
                                              +
                                              std::string float_variable_name(const SymbolType &symbol, bool use_instance) const override
                                              Determine the name of a float variable given its symbol.
                                              +
                                              void print_function(const ast::FunctionBlock &node) override
                                              Print NMODL function in target backend code.
                                              +
                                              void print_v_unused() const override
                                              Set v_unused (voltage) for NRN_PRCELLSTATE feature.
                                              Base class for all block scoped nodes.
                                              Definition: block.hpp:41
                                              Represents a INITIAL block in the NMODL.
                                              static std::string trim(std::string text)
                                              @@ -1099,57 +1113,58 @@
                                              static constexpr char USE_TABLE_VARIABLE[]
                                              global variable to indicate if table is used
                                              Represent WATCH statement in NMODL.
                                              Represents a BREAKPOINT block in NMODL.
                                              -
                                              void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
                                              Print the nrn_cur kernel with NMODL conductance keyword provisions.
                                              -
                                              std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
                                              Determine the name of an int variable given its symbol.
                                              -
                                              void print_namespace_begin() override
                                              Print start of namespaces.
                                              +
                                              void print_nrn_cur_conductance_kernel(const ast::BreakpointBlock &node) override
                                              Print the nrn_cur kernel with NMODL conductance keyword provisions.
                                              +
                                              std::string int_variable_name(const IndexVariableInfo &symbol, const std::string &name, bool use_instance) const override
                                              Determine the name of an int variable given its symbol.
                                              +
                                              void print_namespace_begin() override
                                              Print start of namespaces.
                                              -
                                              void print_global_variables_for_hoc() override
                                              Print byte arrays that register scalar and vector variables for hoc interface.
                                              -
                                              void print_standard_includes() override
                                              Print standard C/C++ includes.
                                              -
                                              void print_mechanism_range_var_structure(bool print_initializers) override
                                              Print the structure that wraps all range and int variables required for the NMODL.
                                              -
                                              virtual void print_procedure(const ast::ProcedureBlock &node) override
                                              Print NMODL procedure in target backend code.
                                              -
                                              void print_namespace_start() override
                                              Prints the start of the neuron namespace.
                                              -
                                              void print_backend_info() override
                                              Print top file header printed in generated code.
                                              +
                                              void print_global_variables_for_hoc() override
                                              Print byte arrays that register scalar and vector variables for hoc interface.
                                              +
                                              void print_standard_includes() override
                                              Print standard C/C++ includes.
                                              +
                                              void print_mechanism_range_var_structure(bool print_initializers) override
                                              Print the structure that wraps all range and int variables required for the NMODL.
                                              +
                                              virtual void print_procedure(const ast::ProcedureBlock &node) override
                                              Print NMODL procedure in target backend code.
                                              +
                                              void print_namespace_start() override
                                              Prints the start of the neuron namespace.
                                              +
                                              void print_backend_info() override
                                              Print top file header printed in generated code.
                                              std::string to_string(const T &obj)
                                              -
                                              virtual void print_compute_functions() override
                                              Print all compute functions for every backend.
                                              +
                                              virtual void print_compute_functions() override
                                              Print all compute functions for every backend.
                                              static constexpr char NRN_INIT_METHOD[]
                                              nrn_init method in generated code
                                              -
                                              void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
                                              Print main body of nrn_cur function.
                                              +
                                              void print_nrn_cur_kernel(const ast::BreakpointBlock &node) override
                                              Print main body of nrn_cur function.
                                              static constexpr char NRN_CUR_METHOD[]
                                              nrn_cur method in generated code
                                              -
                                              void print_mechanism_register() override
                                              Print the mechanism registration function.
                                              +
                                              std::string conc_write_statement(const std::string &ion_name, const std::string &concentration, int index) override
                                              Generate Function call statement for nrn_wrote_conc.
                                              +
                                              void print_mechanism_register() override
                                              Print the mechanism registration function.
                                              Implement utility functions for codegen visitors.
                                              -
                                              void print_nrn_jacob()
                                              Print nrn_jacob function definition.
                                              -
                                              virtual void print_fast_imem_calculation() override
                                              Print fast membrane current calculation code.
                                              -
                                              void print_data_structures(bool print_initializers) override
                                              Print all classes.
                                              -
                                              void print_sdlists_init(bool print_initializers) override
                                              +
                                              void print_nrn_jacob()
                                              Print nrn_jacob function definition.
                                              +
                                              virtual void print_fast_imem_calculation() override
                                              Print fast membrane current calculation code.
                                              +
                                              void print_data_structures(bool print_initializers) override
                                              Print all classes.
                                              +
                                              void print_sdlists_init(bool print_initializers) override
                                              static constexpr char INST_GLOBAL_MEMBER[]
                                              instance struct member pointing to the global variable structure
                                              -
                                              void print_make_instance() const
                                              Print make_*_instance.
                                              +
                                              void print_make_instance() const
                                              Print make_*_instance.
                                              virtual void print_atomic_reduction_pragma() override
                                              Print atomic update pragma for reduction statements.
                                              NmodlType
                                              NMODL variable properties.
                                              -
                                              void print_namespace_stop() override
                                              Prints the end of the neuron namespace.
                                              +
                                              void print_namespace_stop() override
                                              Prints the end of the neuron namespace.
                                              -
                                              void print_mechanism_variables_macros()
                                              Print mechanism variables' related macros.
                                              -
                                              void print_nrn_constructor() override
                                              Print nrn_constructor function definition.
                                              +
                                              void print_mechanism_variables_macros()
                                              Print mechanism variables' related macros.
                                              +
                                              void print_nrn_constructor() override
                                              Print nrn_constructor function definition.
                                              static const std::string NMODL_VERSION
                                              project tagged version in the cmake
                                              Definition: config.h:36
                                              BlockType
                                              Helper to represent various block types.
                                              -
                                              void print_function_or_procedure(const ast::Block &node, const std::string &name) override
                                              Print nmodl function or procedure (common code)
                                              -
                                              void print_headers_include() override
                                              Print all includes.
                                              +
                                              void print_function_or_procedure(const ast::Block &node, const std::string &name) override
                                              Print nmodl function or procedure (common code)
                                              +
                                              void print_headers_include() override
                                              Print all includes.
                                              static constexpr char NRN_STATE_METHOD[]
                                              nrn_state method in generated code
                                              Version information and units file path.
                                              -
                                              void print_nrn_current(const ast::BreakpointBlock &node) override
                                              Print the nrn_current kernel.
                                              +
                                              void print_nrn_current(const ast::BreakpointBlock &node) override
                                              Print the nrn_current kernel.
                                              int position_of_float_var(const std::string &name) const override
                                              Determine the position in the data array for a given float variable.
                                              -
                                              std::string get_variable_name(const std::string &name, bool use_instance=true) const override
                                              Determine variable name in the structure of mechanism properties.
                                              +
                                              std::string get_variable_name(const std::string &name, bool use_instance=true) const override
                                              Determine variable name in the structure of mechanism properties.
                                              std::string simulator_name() override
                                              Name of the simulator the code was generated for.
                                              -
                                              void print_function_procedure_helper(const ast::Block &node) override
                                              Common helper function to help printing function or procedure blocks.
                                              +
                                              void print_function_procedure_helper(const ast::Block &node) override
                                              Common helper function to help printing function or procedure blocks.
                                              static constexpr char NTHREAD_T_VARIABLE[]
                                              t variable in neuron thread structure
                                              -
                                              const char * external_method_arguments() noexcept override
                                              Arguments for external functions called from generated code.
                                              +
                                              const char * external_method_arguments() noexcept override
                                              Arguments for external functions called from generated code.
                                              @ State
                                              derivative block
                                              -
                                              std::string nrn_thread_arguments() const override
                                              Arguments for "_threadargs_" macro in neuron implementation.
                                              -
                                              void print_codegen_routines() override
                                              Print entry point to code generation.
                                              +
                                              std::string nrn_thread_arguments() const override
                                              Arguments for "_threadargs_" macro in neuron implementation.
                                              +
                                              void print_codegen_routines() override
                                              Print entry point to code generation.
                                              static constexpr char NRN_POINTERINDEX[]
                                              hoc_nrnpointerindex name
                                              Auto generated AST classes declaration.
                                              -
                                              void print_function_prototypes() override
                                              Print function and procedures prototype declaration.
                                              -
                                              void print_mechanism_global_var_structure(bool print_initializers) override
                                              Print the structure that wraps all global variables used in the NMODL.
                                              -
                                              void print_global_macros()
                                              Print NEURON global variable macros.
                                              +
                                              void print_function_prototypes() override
                                              Print function and procedures prototype declaration.
                                              +
                                              void print_mechanism_global_var_structure(bool print_initializers) override
                                              Print the structure that wraps all global variables used in the NMODL.
                                              +
                                              void print_global_macros()
                                              Print NEURON global variable macros.
                                              std::vector< std::tuple< std::string, std::string, std::string, std::string > > ParamVector
                                              A vector of parameters represented by a 4-tuple of strings:
                                              diff --git a/html/doxygen/src_2main_8cpp_source.html b/html/doxygen/src_2main_8cpp_source.html index 4e65ff6058..bfef294d95 100644 --- a/html/doxygen/src_2main_8cpp_source.html +++ b/html/doxygen/src_2main_8cpp_source.html @@ -716,7 +716,7 @@
                                              Visitor to inline local procedure and function calls
                                              Version information and units file path.
                                              -
                                              void visit_program(const ast::Program &program) override
                                              Main and only member function to call after creating an instance of this class.
                                              +
                                              void visit_program(const ast::Program &program) override
                                              Main and only member function to call after creating an instance of this class.
                                              Represents top level AST node for whole NMODL input.
                                              Definition: program.hpp:39
                                              bool sparse_solver_exists(const ast::Ast &node)
                                              THIS FILE IS GENERATED AT BUILD TIME AND SHALL NOT BE EDITED.
                                              diff --git a/html/doxygen/todo.html b/html/doxygen/todo.html index b0176f696c..ad0394ad37 100644 --- a/html/doxygen/todo.html +++ b/html/doxygen/todo.html @@ -106,27 +106,25 @@
                                              Member nmodl::codegen::CodegenAccVisitor::print_net_init_acc_serial_annotation_block_begin () override
                                              : With the current code structure for NMODL and MOD2C, we use serial construct to launch serial kernels. This is during initialization but still inefficient. This should be improved when we drop MOD2C.
                                              Class nmodl::codegen::CodegenCoreneuronCppVisitor
                                              -