Skip to content

Commit

Permalink
attempt 2: ignore cvode
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc committed Nov 4, 2024
1 parent 144875d commit 544cdeb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/codegen/codegen_helper_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,12 @@ void CodegenHelperVisitor::check_cvode_codegen(const ast::Program& node) {
});
});

const auto& cvode_nodes = collect_nodes(*breakpoint_node, {AstNodeType::CVODE_BLOCK});

// only case when we emit CVODE code is if we have exactly one block, and
// that block is either a KINETIC/DERIVATIVE with any method, or a
// PROCEDURE with `after_cvode` method
if (solve_nodes.size() == 1 && (kinetic_or_derivative_nodes.size() || using_cvode)) {
if (solve_nodes.size() == 1 && !cvode_nodes.empty() && (kinetic_or_derivative_nodes.size() || using_cvode)) {
logger->debug("Will emit code for CVODE");
info.emit_cvode = true;
}
Expand Down

0 comments on commit 544cdeb

Please sign in to comment.