@@ -30,7 +30,7 @@ struct eltwise_test_params {
30
30
31
31
class EltwiseFusingTest : public ::BaseFusingTest<eltwise_test_params> {
32
32
public:
33
- void execute (eltwise_test_params& p) {
33
+ void execute (eltwise_test_params& p, bool count_reorder = false ) {
34
34
auto input_prim = get_mem (get_input_layout (p));
35
35
auto input_prim2 = get_mem (get_input_layout2 (p));
36
36
@@ -45,7 +45,7 @@ class EltwiseFusingTest : public ::BaseFusingTest<eltwise_test_params> {
45
45
network_not_fused.set_input_data (" input2" , input_prim2);
46
46
}
47
47
48
- compare (network_not_fused, network_fused, p);
48
+ compare (network_not_fused, network_fused, p, count_reorder );
49
49
}
50
50
51
51
layout get_input_layout (eltwise_test_params& p) {
@@ -545,21 +545,27 @@ INSTANTIATE_TEST_SUITE_P(fusings_gpu, eltwise_no_pitches_same_dims_quantize, ::t
545
545
eltwise_test_params{ CASE_ELTWISE_FP32_3, 3 , 4 },
546
546
}));
547
547
548
- class eltwise_activation : public EltwiseFusingTest {};
549
- TEST_P (eltwise_activation , basic) {
548
+ class eltwise_activation_reorder : public EltwiseFusingTest {};
549
+ TEST_P (eltwise_activation_reorder , basic) {
550
550
auto p = GetParam ();
551
- create_topologies (
552
- input_layout (" input" , get_input_layout (p)),
553
- input_layout (" input2" , get_input_layout2 (p)),
554
- eltwise (" eltwise" , { input_info (" input" ), input_info (" input2" ) }, p.mode , p.default_type ),
555
- activation (" activation" , input_info (" eltwise" ), activation_func::relu, { 6 .0f , 0 .0f }),
556
- reorder (" out" , input_info (" activation" ), p.default_format , data_types::f32)
557
- );
551
+ create_topologies (input_layout (" input" , get_input_layout (p)),
552
+ input_layout (" input2" , get_input_layout2 (p)),
553
+ eltwise (" eltwise" , {input_info (" input" ), input_info (" input2" )}, p.mode , p.default_type ),
554
+ activation (" activation" , input_info (" eltwise" ), activation_func::relu, {6 .0f , 0 .0f }),
555
+ reorder (" out" ,
556
+ input_info (" activation" ),
557
+ p.default_format ,
558
+ data_types::f32,
559
+ std::vector<float >(),
560
+ cldnn::reorder_mean_mode::subtract,
561
+ cldnn::padding (),
562
+ true ));
558
563
559
564
tolerance = default_tolerance (p.input_type );
560
- execute (p);
565
+ execute (p, true );
561
566
}
562
567
568
+ class eltwise_activation : public EltwiseFusingTest {};
563
569
TEST_P (eltwise_activation, fp16_out) {
564
570
auto p = GetParam ();
565
571
create_topologies (
@@ -574,6 +580,21 @@ TEST_P(eltwise_activation, fp16_out) {
574
580
execute (p);
575
581
}
576
582
583
+ INSTANTIATE_TEST_SUITE_P (fusings_gpu, eltwise_activation_reorder, ::testing::ValuesIn(std::vector<eltwise_test_params>{
584
+ eltwise_test_params{ CASE_ELTWISE_FP16_1, 3 , 5 },
585
+ eltwise_test_params{ CASE_ELTWISE_FP16_2, 3 , 5 },
586
+ eltwise_test_params{ CASE_ELTWISE_FP16_3, 4 , 5 },
587
+ eltwise_test_params{ CASE_ELTWISE_FP32_1, 3 , 5 },
588
+ eltwise_test_params{ CASE_ELTWISE_FP32_2, 3 , 5 },
589
+ eltwise_test_params{ CASE_ELTWISE_FP32_3, 3 , 5 },
590
+ eltwise_test_params{ CASE_ELTWISE_FP32_FP16_1, 3 , 5 },
591
+ eltwise_test_params{ CASE_ELTWISE_FP32_FP16_2, 3 , 5 },
592
+ eltwise_test_params{ CASE_ELTWISE_FP32_FP16_3, 3 , 5 },
593
+ eltwise_test_params{ CASE_ELTWISE_FP16_FP32_1, 3 , 5 },
594
+ eltwise_test_params{ CASE_ELTWISE_FP16_FP32_2, 3 , 5 },
595
+ eltwise_test_params{ CASE_ELTWISE_FP16_FP32_3, 4 , 5 }
596
+ }));
597
+
577
598
INSTANTIATE_TEST_SUITE_P (fusings_gpu, eltwise_activation, ::testing::ValuesIn(std::vector<eltwise_test_params>{
578
599
eltwise_test_params{ CASE_ELTWISE_FP16_1, 3 , 4 },
579
600
eltwise_test_params{ CASE_ELTWISE_FP16_2, 3 , 4 },
@@ -590,6 +611,7 @@ INSTANTIATE_TEST_SUITE_P(fusings_gpu, eltwise_activation, ::testing::ValuesIn(st
590
611
}));
591
612
592
613
614
+
593
615
class eltwise_quantize_fs_b_yx_fsv32 : public EltwiseFusingTest {};
594
616
TEST_P (eltwise_quantize_fs_b_yx_fsv32, fusing_eltwise_quantize_layout) {
595
617
auto p = GetParam ();
@@ -649,4 +671,4 @@ INSTANTIATE_TEST_SUITE_P(fusings_gpu, eltwise_quantize_fs_b_yx_fsv32_exception,
649
671
eltwise_test_params{ CASE_ELTWISE_FP16_B_FS_YX, 6 , 6 },
650
672
eltwise_test_params{ CASE_ELTWISE_FP16_BATCH_FS_B, 6 , 6 },
651
673
eltwise_test_params{ CASE_ELTWISE_FP16_BATCH_B_FS, 6 , 6 },
652
- }));
674
+ }));
0 commit comments