From 1a769ce499d2f1ea4b564031580e3099c3f4cfd6 Mon Sep 17 00:00:00 2001 From: Wilson Seok Date: Wed, 13 Mar 2024 10:27:01 +0900 Subject: [PATCH] [GPU] Move event completion wait to first of execute_impl (#23363) ### Details: - Move event completion wait to first of execute_impl ### Tickets: - 129373 --- src/plugins/intel_gpu/src/graph/impls/common/loop.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/intel_gpu/src/graph/impls/common/loop.cpp b/src/plugins/intel_gpu/src/graph/impls/common/loop.cpp index 3ffad79067db9c..bb5650d8cc09fb 100644 --- a/src/plugins/intel_gpu/src/graph/impls/common/loop.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/common/loop.cpp @@ -167,6 +167,9 @@ struct loop_impl : typed_primitive_impl { // read initial execution condition from outer network int64_t execution_condition = 1; if (!primitive->first_execution_condition_id.empty()) { + // Wait for completion of the execution_condition of outer_network + if (outer_network.has_event(primitive->first_execution_condition_id)) + outer_network.get_primitive_event(primitive->first_execution_condition_id)->wait(); memory::ptr first_execution_condition_mem = outer_network.get_primitive(primitive->first_execution_condition_id)->output_memory_ptr(); execution_condition = read_scalar_value(first_execution_condition_mem, stream); }