Skip to content

Commit

Permalink
src: cpu: reorder: simple: fix reverse order between memory with diff…
Browse files Browse the repository at this point in the history
…erent block size
  • Loading branch information
igorsafo committed Apr 26, 2022
1 parent 3e0a0d9 commit 39edcf6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/cpu/reorder/simple_reorder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1355,10 +1355,11 @@ struct simple_reorder_impl<SIMPLE_REORDER_TEMPL_CALL,
for (int c = 0; c < block_i; ++c) {
o[o_off + c] = _qz_a1b0<type_i, type_o>()(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()
Expand All @@ -1379,10 +1380,11 @@ struct simple_reorder_impl<SIMPLE_REORDER_TEMPL_CALL,
o[o_off + c] = _qz<type_i, type_o>()(
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()
Expand Down

0 comments on commit 39edcf6

Please sign in to comment.