diff --git a/src/codegen/codegen_coreneuron_cpp_visitor.cpp b/src/codegen/codegen_coreneuron_cpp_visitor.cpp index d11e2f53fb..126921c35b 100644 --- a/src/codegen/codegen_coreneuron_cpp_visitor.cpp +++ b/src/codegen/codegen_coreneuron_cpp_visitor.cpp @@ -497,29 +497,6 @@ void CodegenCoreneuronCppVisitor::print_abort_routine() const { } -std::string CodegenCoreneuronCppVisitor::compute_method_name(BlockType type) const { - if (type == BlockType::Initial) { - return method_name(naming::NRN_INIT_METHOD); - } - if (type == BlockType::Constructor) { - return method_name(naming::NRN_CONSTRUCTOR_METHOD); - } - if (type == BlockType::Destructor) { - return method_name(naming::NRN_DESTRUCTOR_METHOD); - } - if (type == BlockType::State) { - return method_name(naming::NRN_STATE_METHOD); - } - if (type == BlockType::Equation) { - return method_name(naming::NRN_CUR_METHOD); - } - if (type == BlockType::Watch) { - return method_name(naming::NRN_WATCH_CHECK_METHOD); - } - throw std::logic_error("compute_method_name not implemented"); -} - - void CodegenCoreneuronCppVisitor::print_global_var_struct_decl() { printer->add_line(global_struct(), ' ', global_struct_instance(), ';'); } diff --git a/src/codegen/codegen_coreneuron_cpp_visitor.hpp b/src/codegen/codegen_coreneuron_cpp_visitor.hpp index 1fc5d8d4ad..f411e18366 100644 --- a/src/codegen/codegen_coreneuron_cpp_visitor.hpp +++ b/src/codegen/codegen_coreneuron_cpp_visitor.hpp @@ -370,13 +370,6 @@ class CodegenCoreneuronCppVisitor: public CodegenCppVisitor { virtual void print_abort_routine() const; - /** - * Return the name of main compute kernels - * \param type A block type - */ - virtual std::string compute_method_name(BlockType type) const; - - /** * Instantiate global var instance * diff --git a/src/codegen/codegen_cpp_visitor.cpp b/src/codegen/codegen_cpp_visitor.cpp index 906ea43576..779d045a7b 100644 --- a/src/codegen/codegen_cpp_visitor.cpp +++ b/src/codegen/codegen_cpp_visitor.cpp @@ -911,6 +911,28 @@ void CodegenCppVisitor::setup(const Program& node) { rename_function_arguments(); } +std::string CodegenCppVisitor::compute_method_name(BlockType type) const { + if (type == BlockType::Initial) { + return method_name(naming::NRN_INIT_METHOD); + } + if (type == BlockType::Constructor) { + return method_name(naming::NRN_CONSTRUCTOR_METHOD); + } + if (type == BlockType::Destructor) { + return method_name(naming::NRN_DESTRUCTOR_METHOD); + } + if (type == BlockType::State) { + return method_name(naming::NRN_STATE_METHOD); + } + if (type == BlockType::Equation) { + return method_name(naming::NRN_CUR_METHOD); + } + if (type == BlockType::Watch) { + return method_name(naming::NRN_WATCH_CHECK_METHOD); + } + throw std::logic_error("compute_method_name not implemented"); +} + void CodegenCppVisitor::visit_program(const Program& node) { setup(node); diff --git a/src/codegen/codegen_cpp_visitor.hpp b/src/codegen/codegen_cpp_visitor.hpp index 710f14c879..b611aec9e7 100644 --- a/src/codegen/codegen_cpp_visitor.hpp +++ b/src/codegen/codegen_cpp_visitor.hpp @@ -1123,6 +1123,7 @@ class CodegenCppVisitor: public visitor::ConstAstVisitor { void visit_mutex_lock(const ast::MutexLock& node) override; void visit_mutex_unlock(const ast::MutexUnlock& node) override; + std::string compute_method_name(BlockType type) const; public: /** Setup the target backend code generator