diff --git a/src/codegen/codegen_neuron_cpp_visitor.cpp b/src/codegen/codegen_neuron_cpp_visitor.cpp index d944b3c77..189f45158 100644 --- a/src/codegen/codegen_neuron_cpp_visitor.cpp +++ b/src/codegen/codegen_neuron_cpp_visitor.cpp @@ -74,6 +74,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 823055b30..1a267eb34 100644 --- a/src/codegen/codegen_neuron_cpp_visitor.hpp +++ b/src/codegen/codegen_neuron_cpp_visitor.hpp @@ -147,6 +147,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 */ /****************************************************************************************/