From f941509b6aa6989a66622d3880284b73cae32ca5 Mon Sep 17 00:00:00 2001 From: "Soto Flores, Manuel" Date: Mon, 15 Nov 2021 12:34:17 -0800 Subject: [PATCH] src: cpu: x64: matmul: prevent vnni_granularity division by zero --- src/cpu/x64/matmul/brgemm_matmul_utils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cpu/x64/matmul/brgemm_matmul_utils.cpp b/src/cpu/x64/matmul/brgemm_matmul_utils.cpp index 4e0ddcc783b..a8b80bfe9b8 100644 --- a/src/cpu/x64/matmul/brgemm_matmul_utils.cpp +++ b/src/cpu/x64/matmul/brgemm_matmul_utils.cpp @@ -785,6 +785,7 @@ status_t init_brgemm_matmul_conf(cpu_isa_t isa, brgemm_matmul_conf_t &bgmmc, // required granularity for k dimension bgmmc.required_k_granularity = bgmmc.is_amx ? data_type_vnni_granularity(bgmmc.wei_dt) : 1; + if (bgmmc.required_k_granularity == 0) return status::unimplemented; bgmmc.wei_k_blk = data_type_vnni_simd_elems(bgmmc.wei_dt); bgmmc.wei_n_blk = get_default_n_block(format_tag::undef);