Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to CodegenCppVisitor::visit_solution_expression. #1117

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/codegen/codegen_coreneuron_cpp_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3841,17 +3841,6 @@ void CodegenCoreneuronCppVisitor::visit_for_netcon(const ast::ForNetcon& node) {
}


void CodegenCoreneuronCppVisitor::visit_solution_expression(const SolutionExpression& node) {
auto block = node.get_node_to_solve().get();
if (block->is_statement_block()) {
auto statement_block = dynamic_cast<ast::StatementBlock*>(block);
print_statement_block(*statement_block, false, false);
} else {
block->accept(*this);
}
}


void CodegenCoreneuronCppVisitor::visit_watch_statement(const ast::WatchStatement& /* node */) {
printer->add_text(fmt::format("nrn_watch_activate(inst, id, pnodecount, {}, v, watch_remove)",
current_watch_statement++));
Expand Down
1 change: 0 additions & 1 deletion src/codegen/codegen_coreneuron_cpp_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,6 @@ class CodegenCoreneuronCppVisitor: public CodegenCppVisitor {
void visit_eigen_newton_solver_block(const ast::EigenNewtonSolverBlock& node) override;
void visit_eigen_linear_solver_block(const ast::EigenLinearSolverBlock& node) override;
void visit_for_netcon(const ast::ForNetcon& node) override;
virtual void visit_solution_expression(const ast::SolutionExpression& node) override;
virtual void visit_watch_statement(const ast::WatchStatement& node) override;


Expand Down
11 changes: 11 additions & 0 deletions src/codegen/codegen_cpp_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,17 @@ void CodegenCppVisitor::visit_mutex_unlock(const ast::MutexUnlock& node) {
}


void CodegenCppVisitor::visit_solution_expression(const SolutionExpression& node) {
auto block = node.get_node_to_solve().get();
if (block->is_statement_block()) {
auto statement_block = dynamic_cast<ast::StatementBlock*>(block);
print_statement_block(*statement_block, false, false);
} else {
block->accept(*this);
}
}


/**
* \details Once variables are populated, update index semantics to register with coreneuron
*/
Expand Down
1 change: 1 addition & 0 deletions src/codegen/codegen_cpp_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,7 @@ class CodegenCppVisitor: public visitor::ConstAstVisitor {
void visit_protect_statement(const ast::ProtectStatement& node) override;
void visit_mutex_lock(const ast::MutexLock& node) override;
void visit_mutex_unlock(const ast::MutexUnlock& node) override;
void visit_solution_expression(const ast::SolutionExpression& node) override;

std::string compute_method_name(BlockType type) const;

Expand Down
7 changes: 0 additions & 7 deletions src/codegen/codegen_neuron_cpp_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,13 +748,6 @@ void CodegenNeuronCppVisitor::print_codegen_routines() {
/* Overloaded visitor routines */
/****************************************************************************************/


/// TODO: Edit for NEURON
void CodegenNeuronCppVisitor::visit_solution_expression(const SolutionExpression& node) {
return;
}


/// TODO: Edit for NEURON
void CodegenNeuronCppVisitor::visit_watch_statement(const ast::WatchStatement& /* node */) {
return;
Expand Down
1 change: 0 additions & 1 deletion src/codegen/codegen_neuron_cpp_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,6 @@ class CodegenNeuronCppVisitor: public CodegenCppVisitor {
/****************************************************************************************/


virtual void visit_solution_expression(const ast::SolutionExpression& node) override;
virtual void visit_watch_statement(const ast::WatchStatement& node) override;


Expand Down
Loading