From 0dc81d1134268cbae8b51546863652ee9756779e Mon Sep 17 00:00:00 2001 From: Egor Duplensky Date: Fri, 4 Jun 2021 20:40:34 +0300 Subject: [PATCH] Apply review comments 1 --- src/cpu/x64/jit_avx512_core_x8s8s32x_conv_kernel.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cpu/x64/jit_avx512_core_x8s8s32x_conv_kernel.cpp b/src/cpu/x64/jit_avx512_core_x8s8s32x_conv_kernel.cpp index 1a4d277c6b8..782e91afa70 100644 --- a/src/cpu/x64/jit_avx512_core_x8s8s32x_conv_kernel.cpp +++ b/src/cpu/x64/jit_avx512_core_x8s8s32x_conv_kernel.cpp @@ -792,6 +792,8 @@ void _jit_avx512_core_x8s8s32x_fwd_kernel::generate() { int out_shift = jcp.typesize_out * (jcp.ur_w * jcp.oc_without_padding * jcp.ngroups); preamble(); + bool with_quantization = attr_.post_ops_.find(primitive_kind::quantization) != -1; + if (jcp.is_depthwise) { int idx = jcp.max_regs_ur - 1; @@ -802,6 +804,7 @@ void _jit_avx512_core_x8s8s32x_fwd_kernel::generate() { // due to extra register used for shifts and compensations // and/or saturation, we increment by one more if (jcp.signed_input || jcp.with_input_zp || jcp.need_saturation) ++idx; + if (with_quantization) ++idx; assert(idx == ker_dw_reg_base_idx); } @@ -1289,6 +1292,7 @@ status_t jit_avx512_core_x8s8s32x_fwd_kernel::init_conf(jit_conv_conf_t &jcp, const int eltwise_ind = p.find(primitive_kind::eltwise); jcp.with_eltwise = eltwise_ind != -1; if (jcp.with_eltwise) jcp.eltwise = p.entry_[eltwise_ind].eltwise; + bool with_quantization = attr.post_ops_.find(primitive_kind::quantization) != -1; jcp.ver = mayiuse(avx512_core_vnni) ? ver_vnni : ver_avx512_core; jcp.is_fast_depthwise = true && jcp.is_depthwise && jcp.ver == ver_vnni @@ -1300,7 +1304,8 @@ status_t jit_avx512_core_x8s8s32x_fwd_kernel::init_conf(jit_conv_conf_t &jcp, if (jcp.is_depthwise) { jcp.max_regs_ur = 31 - jcp.is_fast_depthwise - !jcp.is_resrc_depthwise - (jcp.signed_input || jcp.with_input_zp) - (jcp.ver != ver_vnni) - - (jcp.signed_input || jcp.with_input_zp || jcp.need_saturation); // both alias + - (jcp.signed_input || jcp.with_input_zp || jcp.need_saturation) // both alias + - with_quantization; } else { jcp.max_regs_ur = jcp.ver == ver_vnni ? 31 : 28; }