Skip to content

Commit

Permalink
Apply review comments 1
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorDuplensky committed Jun 4, 2021
1 parent ec3ae94 commit 0dc81d1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cpu/x64/jit_avx512_core_x8s8s32x_conv_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,8 @@ void _jit_avx512_core_x8s8s32x_fwd_kernel<Vmm>::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;
Expand All @@ -802,6 +804,7 @@ void _jit_avx512_core_x8s8s32x_fwd_kernel<Vmm>::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);
}

Expand Down Expand Up @@ -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
Expand All @@ -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;
}
Expand Down

0 comments on commit 0dc81d1

Please sign in to comment.