@@ -228,6 +228,55 @@ TEST(prepare_buffer_fusing, in_place_concat_dynamic) {
228228 }
229229}
230230
231+ TEST (prepare_buffer_fusing, in_place_concat_dynamic_and_static) {
232+ auto & engine = get_test_engine ();
233+ auto in_layout1_dyn = layout{ ov::PartialShape{1 , 2 , ov::Dimension () }, data_types::f32 , format::bfyx };
234+ auto in_layout3_dyn = layout{ ov::PartialShape{1 , 2 , ov::Dimension (21 , ov::Interval::s_max) }, data_types::f32 , format::yxfb };
235+ auto reorder_layout = layout{ ov::PartialShape{1 , 2 , ov::Dimension (21 , ov::Interval::s_max) }, data_types::f32 , format::bfyx };
236+
237+ auto in_layout1 = layout{ {1 , 2 , 42 }, data_types::f32 , format::bfyx };
238+ auto in_layout2 = layout{ {1 , 2 , 42 }, data_types::f32 , format::bfyx };
239+ auto in_layout3 = layout{ {1 , 2 , 42 }, data_types::f32 , format::yxfb };
240+
241+ auto input_memory1 = engine.allocate_memory (in_layout1);
242+ auto input_memory2 = engine.allocate_memory (in_layout2);
243+ auto input_memory3 = engine.allocate_memory (in_layout3);
244+
245+ topology topology;
246+ topology.add (input_layout (" input1" , in_layout1_dyn));
247+ topology.add (input_layout (" input2" , in_layout2));
248+ topology.add (input_layout (" input3" , in_layout3_dyn));
249+ topology.add (eltwise (" add" , input_info (" input1" ), input_info (" input2" ), eltwise_mode::sum));
250+ topology.add (reorder (" reorder" , input_info (" input3" ), reorder_layout));
251+ topology.add (concatenation (" concat" , { input_info (" add" ), input_info (" reorder" ) }, 1 ));
252+ topology.add (permute (" output" , input_info (" concat" ), {0 , 2 , 1 }));
253+
254+ ExecutionConfig config = get_test_default_config (engine);
255+ config.set_property (ov::intel_gpu::optimize_data (true ));
256+ config.set_property (ov::intel_gpu::allow_new_shape_infer (true ));
257+ auto prog = program::build_program (engine, topology, config, false , false );
258+ ASSERT_NE (prog, nullptr );
259+ cldnn::network net (prog, 0 );
260+
261+ net.set_input_data (" input1" , input_memory1);
262+ net.set_input_data (" input2" , input_memory2);
263+ net.set_input_data (" input3" , input_memory3);
264+ auto outputs = net.execute ();
265+
266+ auto output_memory = outputs.at (" output" ).get_memory ();
267+ auto output_layout = output_memory->get_layout ();
268+
269+ int y_size = output_layout.spatial (1 );
270+ int x_size = output_layout.spatial (0 );
271+ int f_size = output_layout.feature ();
272+ int b_size = output_layout.batch ();
273+
274+ ASSERT_EQ (y_size, 4 );
275+ ASSERT_EQ (x_size, 1 );
276+ ASSERT_EQ (f_size, 42 );
277+ ASSERT_EQ (b_size, 1 );
278+ }
279+
231280TEST (prepare_buffer_fusing, in_place_concat_dynamic_memory_reallocation) {
232281 tests::random_generator rg (GET_SUITE_NAME);
233282 auto & engine = get_test_engine ();
0 commit comments