From 48e71397b724ed53ae2150f5ba3c3ad5d1617e22 Mon Sep 17 00:00:00 2001 From: Nikola Cvetkovic Date: Tue, 17 Dec 2024 16:31:10 +0100 Subject: [PATCH] #15713: Fix checks for fp32 eltwise binary DST clear (#60) --- llk_lib/llk_math_eltwise_binary.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/llk_lib/llk_math_eltwise_binary.h b/llk_lib/llk_math_eltwise_binary.h index 25fea4b..6462866 100644 --- a/llk_lib/llk_math_eltwise_binary.h +++ b/llk_lib/llk_math_eltwise_binary.h @@ -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(); 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 @@ -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(); 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 @@ -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(); 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 @@ -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(); 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 @@ -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(); 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))); @@ -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(); 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)));