Skip to content

Commit

Permalink
#15713: Fix checks for fp32 eltwise binary DST clear (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncvetkovicTT authored Dec 17, 2024
1 parent 10394b3 commit 48e7139
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions llk_lib/llk_math_eltwise_binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ inline void _llk_math_eltwise_binary_(const std::uint32_t num_faces, uint dst_in
eltwise_binary_reuse_dest_as_src<binary_reuse_dest>();
if constexpr (binary_reuse_dest != EltwiseBinaryReuseDestType::NONE) {
// We clear the DEST face-by-face, given the DEST base, tile index and face index
if (1 == 1) {
if (is_fp32_dest_acc_en && clear_fp32_dst_acc) {
TT_ZEROACC(ZERO_ACC_MODE, 1/*clear fp32*/, 0, ADDR_MOD_1, (get_dest_buffer_base_32b() + get_dest_index_in_faces(dst_index, (0 + face_num)))); // Clear faces 0 & 1
} else {
TT_ZEROACC(ZERO_ACC_MODE, 0/*clear fp32*/, 0, ADDR_MOD_1, (get_dest_buffer_base_16b() + get_dest_index_in_faces(dst_index, (0 + face_num)))); // Clear faces 0 & 1
Expand All @@ -128,7 +128,7 @@ inline void _llk_math_eltwise_binary_(const std::uint32_t num_faces, uint dst_in
eltwise_binary_reuse_dest_as_src<binary_reuse_dest>();
if constexpr (binary_reuse_dest != EltwiseBinaryReuseDestType::NONE) {
// We clear the DEST face-by-face, given the DEST base, tile index and face index
if (1 == 1) {
if (is_fp32_dest_acc_en && clear_fp32_dst_acc) {
TT_ZEROACC(ZERO_ACC_MODE, 1/*clear fp32*/, 0, ADDR_MOD_1, (get_dest_buffer_base_32b() + get_dest_index_in_faces(dst_index, (0 + face_num)))); // Clear faces 0 & 1
} else {
TT_ZEROACC(ZERO_ACC_MODE, 0/*clear fp32*/, 0, ADDR_MOD_1, (get_dest_buffer_base_16b() + get_dest_index_in_faces(dst_index, (0 + face_num)))); // Clear faces 0 & 1
Expand All @@ -144,7 +144,7 @@ inline void _llk_math_eltwise_binary_(const std::uint32_t num_faces, uint dst_in
eltwise_binary_reuse_dest_as_src<binary_reuse_dest>();
if constexpr (binary_reuse_dest != EltwiseBinaryReuseDestType::NONE) {
// We clear the DEST face-by-face, given the DEST base, tile index and face index
if (1 == 1) {
if (is_fp32_dest_acc_en && clear_fp32_dst_acc) {
TT_ZEROACC(ZERO_ACC_MODE, 1/*clear fp32*/, 0, ADDR_MOD_1, (get_dest_buffer_base_32b() + get_dest_index_in_faces(dst_index, (2 + face_num)))); // Clear faces 2 & 3
} else {
TT_ZEROACC(ZERO_ACC_MODE, 0/*clear fp32*/, 0, ADDR_MOD_1, (get_dest_buffer_base_16b() + get_dest_index_in_faces(dst_index, (2 + face_num)))); // Clear faces 2 & 3
Expand All @@ -158,7 +158,7 @@ inline void _llk_math_eltwise_binary_(const std::uint32_t num_faces, uint dst_in
eltwise_binary_reuse_dest_as_src<binary_reuse_dest>();
if constexpr (binary_reuse_dest != EltwiseBinaryReuseDestType::NONE) {
// We clear the DEST face-by-face, given the DEST base, tile index and face index
if (1 == 1) {
if (is_fp32_dest_acc_en && clear_fp32_dst_acc) {
TT_ZEROACC(ZERO_ACC_MODE, 1/*clear fp32*/, 0, ADDR_MOD_1, (get_dest_buffer_base_32b() + get_dest_index_in_faces(dst_index, (2 + face_num)))); // Clear faces 2 & 3
} else {
TT_ZEROACC(ZERO_ACC_MODE, 0/*clear fp32*/, 0, ADDR_MOD_1, (get_dest_buffer_base_16b() + get_dest_index_in_faces(dst_index, (2 + face_num)))); // Clear faces 2 & 3
Expand All @@ -177,7 +177,7 @@ inline void _llk_math_eltwise_binary_(const std::uint32_t num_faces, uint dst_in
eltwise_binary_reuse_dest_as_src<binary_reuse_dest>();
if constexpr (binary_reuse_dest != EltwiseBinaryReuseDestType::NONE) {
// We clear the DEST face-by-face, given the DEST base, tile index and face index
if (1 == 1) {
if (is_fp32_dest_acc_en && clear_fp32_dst_acc) {
TT_ZEROACC(ZERO_ACC_MODE, 1/*clear fp32*/, 0, ADDR_MOD_1, (get_dest_buffer_base_32b() + get_dest_index_in_faces(dst_index, face_num)));
} else {
TT_ZEROACC(ZERO_ACC_MODE, 0/*clear fp32*/, 0, ADDR_MOD_1, (get_dest_buffer_base_16b() + get_dest_index_in_faces(dst_index, face_num)));
Expand All @@ -191,7 +191,7 @@ inline void _llk_math_eltwise_binary_(const std::uint32_t num_faces, uint dst_in
eltwise_binary_reuse_dest_as_src<binary_reuse_dest>();
if constexpr (binary_reuse_dest != EltwiseBinaryReuseDestType::NONE) {
// We clear the DEST face-by-face, given the DEST base, tile index and face index
if (1 == 1) {
if (is_fp32_dest_acc_en && clear_fp32_dst_acc) {
TT_ZEROACC(ZERO_ACC_MODE, 1/*clear fp32*/, 0, ADDR_MOD_1, (get_dest_buffer_base_32b() + get_dest_index_in_faces(dst_index, face_num)));
} else {
TT_ZEROACC(ZERO_ACC_MODE, 0/*clear fp32*/, 0, ADDR_MOD_1, (get_dest_buffer_base_16b() + get_dest_index_in_faces(dst_index, face_num)));
Expand Down

0 comments on commit 48e7139

Please sign in to comment.