[CPU] Fix the unnecessary calculation of blk_stride for dynamic shape (#10385)

This commit is contained in:
Chen Xu 2022-02-16 17:20:01 +08:00 committed by GitHub
parent 2a1d8d7e99
commit 4d954d0c13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,7 +99,7 @@ struct jit_uni_topk_kernel_f32 : public jit_uni_topk_kernel, public jit_generato
mov(reg_table, l_table);
data_type = MKLDNNExtensionUtils::IEPrecisionToDataType(jcp_.precision);
if (jcp_.layout == TopKLayoutType::topk_blocked && jcp_.topk_innermost)
if (!shape_agnostic_alg && jcp_.layout == TopKLayoutType::topk_blocked && jcp_.topk_innermost)
blk_stride = jcp_.sort_stride * jcp_.blk_size;
if (jcp_.mode_max) {
@ -209,7 +209,7 @@ private:
const int tail = jcp_.work_amount % step;
const int topk_tail = jcp_.top_k % step;
int blk_stride; // stride of channel blocks at the same space coordinate, only used in blocked layout with topk on channel
int blk_stride = 0; // stride of channel blocks at the same space coordinate, only used in blocked layout with topk on channel
unsigned char cmp_flg;
unsigned char heap_cmp_flg;