diff --git a/src/codegen/codegen_neuron_cpp_visitor.cpp b/src/codegen/codegen_neuron_cpp_visitor.cpp index 4344697ee..5ba23cabe 100644 --- a/src/codegen/codegen_neuron_cpp_visitor.cpp +++ b/src/codegen/codegen_neuron_cpp_visitor.cpp @@ -76,6 +76,12 @@ int CodegenNeuronCppVisitor::position_of_int_var(const std::string& name) const } +bool CodegenNeuronCppVisitor::parallel_iteration_condition(BlockType type, + const ast::Block* block) { + return info.thread_safe && CodegenCppVisitor::parallel_iteration_condition(type, block); +} + + /****************************************************************************************/ /* Backend specific routines */ /****************************************************************************************/ diff --git a/src/codegen/codegen_neuron_cpp_visitor.hpp b/src/codegen/codegen_neuron_cpp_visitor.hpp index c0aa55f83..e1fc9fc28 100644 --- a/src/codegen/codegen_neuron_cpp_visitor.hpp +++ b/src/codegen/codegen_neuron_cpp_visitor.hpp @@ -149,6 +149,9 @@ class CodegenNeuronCppVisitor: public CodegenCppVisitor { int position_of_int_var(const std::string& name) const override; + bool parallel_iteration_condition(BlockType type, const ast::Block* block) override; + + /****************************************************************************************/ /* Backend specific routines */ /****************************************************************************************/