12
12
13
13
using namespace cldnn ;
14
14
15
- static bool eltwise_supports_fusings (eltwise_node& node) {
16
- auto out_layout = node.get_output_layout ();
17
- // This condition refers to optimizied kernel EltwiseKernel_fs_b_yx_fsv32
18
- if (out_layout.data_type == data_types::f16 && out_layout.batch () > 1 && out_layout.format == format::fs_b_yx_fsv32) {
19
- return false ;
20
- }
15
+ void fuse_primitives_with_layout::run (program& p) {
16
+ auto eltwise_supports_fusings = [&](eltwise_node& node) -> bool {
17
+ auto out_layout = node.get_output_layout ();
18
+ // This condition refers to optimizied kernel EltwiseKernel_fs_b_yx_fsv32
19
+ if (out_layout.data_type == data_types::f16 && out_layout.batch () > 1 &&
20
+ (_lo.get_optimization_attributes ().fs_b_yx_fsv32_network || out_layout.format == format::fs_b_yx_fsv32)) {
21
+ return false ;
22
+ }
21
23
22
- return true ;
23
- }
24
+ return true ;
25
+ };
24
26
25
- void fuse_primitives_with_layout::run (program& p) {
26
27
bool need_recalc_processing_order = false ;
27
28
std::map<primitive_id, std::vector<std::pair<primitive_id, size_t >>> fusing_history;
28
29
@@ -35,7 +36,7 @@ void fuse_primitives_with_layout::run(program& p) {
35
36
continue ;
36
37
37
38
// No optimized Eltwise kernel supports fused-operation for fs_b_yx_fsv32
38
- // Check fusing quantize to eltwsise for this case
39
+ // Check fusing quantize to eltwise for this case
39
40
auto func_fuse_quantize = [&](quantize_node& node) {
40
41
bool should_fuse = false ;
41
42
auto out_layout = node.get_output_layout ();
@@ -49,7 +50,6 @@ void fuse_primitives_with_layout::run(program& p) {
49
50
return ;
50
51
51
52
should_fuse |= input_node.is_type <eltwise>() && eltwise_supports_fusings (input_node.as <eltwise>());
52
-
53
53
if (!should_fuse)
54
54
return ;
55
55
0 commit comments