From 39edcf61e162d7f3a7449e05bfedccd1301fe34e Mon Sep 17 00:00:00 2001 From: "Safonov, Igor" Date: Thu, 7 Apr 2022 10:21:18 -0700 Subject: [PATCH] src: cpu: reorder: simple: fix reverse order between memory with different block size --- src/cpu/reorder/simple_reorder.hpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/cpu/reorder/simple_reorder.hpp b/src/cpu/reorder/simple_reorder.hpp index e6034a0728c..8c5454ed758 100644 --- a/src/cpu/reorder/simple_reorder.hpp +++ b/src/cpu/reorder/simple_reorder.hpp @@ -1355,10 +1355,11 @@ struct simple_reorder_impl()(i[i_off + c]); } - if (order_keep && b + 1 == nb) { + if (b + 1 == nb) { // zero padding - const auto pad_size - = blksize_16 - ((nb - 1) * blksize_i); + const auto pad_size = order_keep + ? blksize_16 - ((nb - 1) * blksize_i) + : blksize_i; const auto pad_start = block_i + o_off; const auto pad_end = pad_size + o_off; PRAGMA_OMP_SIMD() @@ -1379,10 +1380,11 @@ struct simple_reorder_impl()( i[i_off + c], o[o_off + c], alpha, beta); } - if (order_keep && b + 1 == nb) { + if (b + 1 == nb) { // zero padding - const auto pad_size - = blksize_16 - ((nb - 1) * blksize_i); + const auto pad_size = order_keep + ? blksize_16 - ((nb - 1) * blksize_i) + : blksize_i; const auto pad_start = block_i + o_off; const auto pad_end = pad_size + o_off; PRAGMA_OMP_SIMD()