Skip to content

Commit

Permalink
Add support for 16x16 (single face) tile reduce and pack untilize
Browse files Browse the repository at this point in the history
  • Loading branch information
acejkov committed Feb 29, 2024
1 parent de157f0 commit 60345bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion llk_lib/llk_math_reduce.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ inline void _llk_math_reduce_(const uint dst_index, bool narrow_tile = false, co
TTI_GAPOOL(p_setrwc::CLR_NONE, p_gpool::DIM_16X16, ADDR_MOD_0, p_gpool::INDEX_DIS, 0);
}
}
if (!narrow_tile) {
if ((!narrow_tile) && (num_faces>1)) {
TTI_SETRWC(p_setrwc::CLR_NONE, p_setrwc::CR_D, 8, 0, 0, p_setrwc::SET_D);
TTI_SETRWC(p_setrwc::CLR_AB, p_setrwc::CR_D, 8, 0, 0, p_setrwc::SET_D);

Expand Down
16 changes: 11 additions & 5 deletions llk_lib/llk_pack_untilize.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,18 @@ inline void _llk_pack_untilize_mop_config_(const std::uint32_t face_r_dim = FACE

constexpr uint MOP_OUTER_LOOP = block_ct_dim;

// Inc ch0_y+=1 (addr_mod_0 will increment by 15)
ckernel::ckernel_template tmp(MOP_OUTER_LOOP, MOP_INNER_LOOP, TT_OP_INCADCXY(p_setadc::PAC, 0, 0, 1, 0));
tmp.set_start_op(TT_OP_PACR(ADDR_MOD_0, ZERO_OUTPUT_FLAG, PACK_SEL(PACKCNT), 0, MEGAROW, 0, 0));
tmp.set_end_ops(TT_OP_PACR(ADDR_MOD_1, ZERO_OUTPUT_FLAG, PACK_SEL(PACKCNT), 0, MEGAROW, 0, 0),
if (num_faces>1) {
// Inc ch0_y+=1 (addr_mod_0 will increment by 15)
ckernel::ckernel_template tmp(MOP_OUTER_LOOP, MOP_INNER_LOOP, TT_OP_INCADCXY(p_setadc::PAC, 0, 0, 1, 0));
tmp.set_start_op(TT_OP_PACR(ADDR_MOD_0, ZERO_OUTPUT_FLAG, PACK_SEL(PACKCNT), 0, MEGAROW, 0, 0));
tmp.set_end_ops(TT_OP_PACR(ADDR_MOD_1, ZERO_OUTPUT_FLAG, PACK_SEL(PACKCNT), 0, MEGAROW, 0, 0),
TT_OP_INCADCZW(p_setadc::PAC, 0, 0, 1, 0)); // w cnt points to the next tile
tmp.program(instrn_buffer);
tmp.program(instrn_buffer);
} else {
ckernel::ckernel_template tmp(MOP_OUTER_LOOP, MOP_INNER_LOOP, TT_OP_PACR(ADDR_MOD_1, ZERO_OUTPUT_FLAG, PACK_SEL(PACKCNT), 0, MEGAROW, 0, 0));
tmp.set_end_op(TT_OP_INCADCZW(p_setadc::PAC, 0, 0, 1, 0)); // w cnt points to the next tile
tmp.program(instrn_buffer);
}
}

template <std::uint32_t block_ct_dim>
Expand Down

0 comments on commit 60345bc

Please sign in to comment.