From 9c1aa6c7067ab7b2068d8dc5fb66f6b15def1eef Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Wed, 31 Aug 2022 10:47:11 +0800 Subject: [PATCH] fix bug that Op with id 0 can not be lauched (#45577) --- paddle/fluid/framework/new_executor/interpretercore.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/framework/new_executor/interpretercore.cc b/paddle/fluid/framework/new_executor/interpretercore.cc index caf10c62b5..c679ae47a3 100644 --- a/paddle/fluid/framework/new_executor/interpretercore.cc +++ b/paddle/fluid/framework/new_executor/interpretercore.cc @@ -821,11 +821,11 @@ void InterpreterCore::RunNextInstructions( } auto direct_run_ops = interpreter::merge_vector(next_instr.SyncRunIds(), next_instr.DirectRunIds()); - size_t first_op = 0; + int64_t first_op = -1; for (auto next_id : direct_run_ops) { if (IsReady(next_id)) { // only keep one op running in current thread - if (first_op == 0) { + if (first_op == -1) { first_op = next_id; continue; } @@ -837,7 +837,7 @@ void InterpreterCore::RunNextInstructions( }); } } - if (first_op != 0) reserved_next_ops->push(first_op); + if (first_op != -1) reserved_next_ops->push(first_op); } } -- GitLab