From 80c6e43a3cb74a40d5f3d41ba10d97ecd44251dc Mon Sep 17 00:00:00 2001 From: acejkov Date: Tue, 5 Dec 2023 23:03:10 +0000 Subject: [PATCH] #3908: Uplift the latest changes from core llk lib. Common files are now identical --- .../ckernels/wormhole_b0/common/inc/ckernel.h | 4 ++-- .../wormhole_b0/common/inc/ckernel_sfpu.h | 20 +++++++++++++++++++ .../ckernels/wormhole_b0/llk_lib/llk_defs.h | 4 +--- .../metal/llk_api/llk_math_binary_sfpu_api.h | 8 ++++---- .../metal/llk_api/llk_math_unary_sfpu_api.h | 18 ++++++++--------- .../llk_math_eltwise_unary_sfpu_0_param.h | 6 +++--- .../llk_math_eltwise_unary_sfpu_1_param.h | 6 +++--- ..._math_eltwise_unary_sfpu_common_includes.h | 6 +++--- .../llk_math_eltwise_unary_sfpu_elu.h | 2 +- .../llk_math_eltwise_unary_sfpu_erf_erfc.h | 4 ++-- .../llk_math_eltwise_unary_sfpu_erfinv.h | 2 +- .../llk_math_eltwise_unary_sfpu_exp.h | 2 +- .../llk_math_eltwise_unary_sfpu_gelu.h | 4 ++-- .../llk_sfpu/llk_math_eltwise_unary_sfpu_i0.h | 2 +- .../llk_math_eltwise_unary_sfpu_isinf_isnan.h | 10 +++++----- ...math_eltwise_unary_sfpu_logical_not_noti.h | 2 +- .../llk_math_eltwise_unary_sfpu_recip.h | 2 +- .../llk_math_eltwise_unary_sfpu_relu.h | 8 ++++---- .../llk_math_eltwise_unary_sfpu_reverseops.h | 2 +- .../llk_math_eltwise_unary_sfpu_sqrt.h | 2 +- ...llk_math_eltwise_unary_sfpu_trigonometry.h | 6 +++--- 21 files changed, 69 insertions(+), 51 deletions(-) diff --git a/tt_metal/hw/ckernels/wormhole_b0/common/inc/ckernel.h b/tt_metal/hw/ckernels/wormhole_b0/common/inc/ckernel.h index b731cc4bf81..ebc48646c8a 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/common/inc/ckernel.h +++ b/tt_metal/hw/ckernels/wormhole_b0/common/inc/ckernel.h @@ -36,7 +36,7 @@ #define OVERLAY_DECOUPLE 0 #endif -#ifdef LLK_TB_TEST +#if defined(EN_KERNEL_SLOWDOWN) #include "kernel_slowdown_config.h" #endif @@ -61,10 +61,10 @@ #include "ckernel_include.h" #include "tensix.h" #include "fw_debug.h" +#include "tt_log.h" // #include #if defined(PERF_DUMP) || DELAY_EN > 0 #include -#include "tt_log.h" #include "perf_lib/scratch_api.h" #endif diff --git a/tt_metal/hw/ckernels/wormhole_b0/common/inc/ckernel_sfpu.h b/tt_metal/hw/ckernels/wormhole_b0/common/inc/ckernel_sfpu.h index b00ea4a0b1f..c0fcaf197cb 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/common/inc/ckernel_sfpu.h +++ b/tt_metal/hw/ckernels/wormhole_b0/common/inc/ckernel_sfpu.h @@ -1319,5 +1319,25 @@ inline void _dequant_int32_(const int iterations, const uint dst_offset) } } +template +inline void _add_int32_(const int iterations, const uint dst_offset) { + // Operand A is input1 (int32) + // Operand B is input2 (int32) + // Output is int32 + #pragma GCC unroll 8 + for (int d = 0; d < ITERATIONS; d++) { + // operand A - int32 + TTI_SFPLOAD(0, 12, 3, 0); + // operand B - int32 + TT_SFPLOAD(1, 12, 3, dst_offset * 64); + TTI_SFPIADD(0, 1, 0, 4); + // MAD has a 2-cycle pipeline latency so we need one cycle latency until next instr can consume the result + TTI_NOP; + // LREG_0 -> dest as int32 + TTI_SFPSTORE(0, 12, 3, 0); + dst_reg++; + } +} + } // namespace sfpu } // namespace ckernel diff --git a/tt_metal/hw/ckernels/wormhole_b0/llk_lib/llk_defs.h b/tt_metal/hw/ckernels/wormhole_b0/llk_lib/llk_defs.h index e5250fb7412..e80e29d83c7 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/llk_lib/llk_defs.h +++ b/tt_metal/hw/ckernels/wormhole_b0/llk_lib/llk_defs.h @@ -7,13 +7,11 @@ namespace ckernel { -enum Dim { +enum VectorMode { None = 0, R = 1, C = 2, - Z = 3, RC = 4, - ZR = 5, Invalid = 0xFF, }; diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_math_binary_sfpu_api.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_math_binary_sfpu_api.h index 5f662f22081..c7c42763d95 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_math_binary_sfpu_api.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_math_binary_sfpu_api.h @@ -15,7 +15,7 @@ inline void llk_math_eltwise_binary_sfpu( const uint operand, uint dst_index_a, uint dst_index_b, - int vector_mode = (int)Dim::RC, + int vector_mode = (int)VectorMode::RC, uint param0 = 0, uint param1 = 0, uint param2 = 0, @@ -38,7 +38,7 @@ inline void llk_math_eltwise_binary_sfpu_init( template inline void llk_math_eltwise_binary_sfpu_quant_int32( - uint dst_index_a, uint dst_index_b, int vector_mode = (int)Dim::RC) { + uint dst_index_a, uint dst_index_b, int vector_mode = (int)VectorMode::RC) { llk_math_eltwise_binary_sfpu(dst_index_a, dst_index_b, vector_mode); } @@ -49,7 +49,7 @@ inline void llk_math_eltwise_binary_sfpu_quant_int32_init(const uint zero_point) template inline void llk_math_eltwise_binary_sfpu_requant_int32( - uint dst_index_a, uint dst_index_b, int vector_mode = (int)Dim::RC) { + uint dst_index_a, uint dst_index_b, int vector_mode = (int)VectorMode::RC) { llk_math_eltwise_binary_sfpu(dst_index_a, dst_index_b, vector_mode); } @@ -60,7 +60,7 @@ inline void llk_math_eltwise_binary_sfpu_requant_int32_init(const uint zero_poin template inline void llk_math_eltwise_binary_sfpu_dequant_int32( - uint dst_index_a, uint dst_index_b, int vector_mode = (int)Dim::RC) { + uint dst_index_a, uint dst_index_b, int vector_mode = (int)VectorMode::RC) { llk_math_eltwise_binary_sfpu(dst_index_a, dst_index_b, vector_mode); } diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_math_unary_sfpu_api.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_math_unary_sfpu_api.h index 898788ca415..f65a6b86ddd 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_math_unary_sfpu_api.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_math_unary_sfpu_api.h @@ -25,7 +25,7 @@ inline void llk_math_eltwise_unary_sfpu_rsqrt_init() { } template -inline void llk_math_eltwise_unary_sfpu_log(uint dst_index, int vector_mode = Dim::RC) { +inline void llk_math_eltwise_unary_sfpu_log(uint dst_index, int vector_mode = (int)VectorMode::RC) { llk_math_eltwise_unary_sfpu(dst_index, vector_mode); } @@ -45,7 +45,7 @@ inline void llk_math_eltwise_unary_sfpu_log_with_base_init() { } template -inline void llk_math_eltwise_unary_sfpu_tanh(uint dst_index, int vector_mode = Dim::RC) { +inline void llk_math_eltwise_unary_sfpu_tanh(uint dst_index, int vector_mode = (int)VectorMode::RC) { llk_math_eltwise_unary_sfpu(dst_index, vector_mode); } @@ -88,7 +88,7 @@ inline void llk_math_eltwise_unary_sfpu_dropout_init(uint seed = 0) { } template -inline void llk_math_eltwise_unary_sfpu_sigmoid(uint dst_index, int vector_mode = Dim::RC) { +inline void llk_math_eltwise_unary_sfpu_sigmoid(uint dst_index, int vector_mode = (int)VectorMode::RC) { llk_math_eltwise_unary_sfpu(dst_index, vector_mode); } @@ -164,7 +164,7 @@ inline void llk_math_eltwise_unary_sfpu_gez_init() { } template -inline void llk_math_eltwise_unary_sfpu_max(uint dst_index, int vector_mode = Dim::RC) { +inline void llk_math_eltwise_unary_sfpu_max(uint dst_index, int vector_mode = (int)VectorMode::RC) { llk_math_eltwise_unary_sfpu(dst_index, vector_mode); } @@ -174,7 +174,7 @@ inline void llk_math_eltwise_unary_sfpu_max_init() { } template -inline void llk_math_eltwise_unary_sfpu_square(uint dst_index, int vector_mode = Dim::RC) { +inline void llk_math_eltwise_unary_sfpu_square(uint dst_index, int vector_mode = (int)VectorMode::RC) { llk_math_eltwise_unary_sfpu(dst_index, vector_mode); } @@ -184,7 +184,7 @@ inline void llk_math_eltwise_unary_sfpu_square_init() { } template -inline void llk_math_eltwise_unary_sfpu_power(uint dst_index, int pow = 0, int vector_mode = Dim::RC) { +inline void llk_math_eltwise_unary_sfpu_power(uint dst_index, int pow = 0, int vector_mode = (int)VectorMode::RC) { llk_math_eltwise_unary_sfpu(dst_index, vector_mode, pow); } @@ -194,7 +194,7 @@ inline void llk_math_eltwise_unary_sfpu_power_init() { } template -inline void llk_math_eltwise_unary_sfpu_abs(uint dst_index, int vector_mode = Dim::RC) { +inline void llk_math_eltwise_unary_sfpu_abs(uint dst_index, int vector_mode = (int)VectorMode::RC) { llk_math_eltwise_unary_sfpu(dst_index, vector_mode); } @@ -204,7 +204,7 @@ inline void llk_math_eltwise_unary_sfpu_abs_init() { } template -inline void llk_math_eltwise_unary_sfpu_cast_fp32_to_fp16a(uint dst_index, int vector_mode = Dim::RC) { +inline void llk_math_eltwise_unary_sfpu_cast_fp32_to_fp16a(uint dst_index, int vector_mode = (int)VectorMode::RC) { llk_math_eltwise_unary_sfpu(dst_index, vector_mode); } @@ -226,7 +226,7 @@ inline void llk_math_eltwise_unary_sfpu_exp2_init() { //heaviside template -inline void llk_math_eltwise_unary_sfpu_heaviside(uint dst_index,uint param0, int vector_mode = Dim::RC) { +inline void llk_math_eltwise_unary_sfpu_heaviside(uint dst_index,uint param0, int vector_mode = (int)VectorMode::RC) { llk_math_eltwise_unary_sfpu(dst_index,vector_mode,param0); } diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_0_param.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_0_param.h index a896c4064c3..c72b136f851 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_0_param.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_0_param.h @@ -11,7 +11,7 @@ inline void llk_math_eltwise_unary_sfpu_0_param( void (*first_func)(), void (*func)(), uint dst_index, - int vector_mode = Dim::RC) { + int vector_mode = (int)VectorMode::RC) { if constexpr ((Dst == DstSync::SyncTile16) || (Dst == DstSync::SyncTile2)) { math::set_dst_write_addr(math_sync_tile_dst_index); } else { @@ -19,7 +19,7 @@ inline void llk_math_eltwise_unary_sfpu_0_param( } math::set_addr_mod_base(); TTI_STALLWAIT(p_stall::STALL_SFPU, p_stall::MATH); - if (vector_mode == Dim::R) { + if (vector_mode == (int)VectorMode::R) { // Do a row vector, Face0 + Face1 -- first iteration (first row) const int ITERATIONS = 1; #pragma GCC unroll 0 @@ -33,7 +33,7 @@ inline void llk_math_eltwise_unary_sfpu_0_param( TTI_SETRWC(p_setrwc::CLR_NONE, p_setrwc::CR_D, 8, 0, 0, p_setrwc::SET_D); TTI_SETRWC(p_setrwc::CLR_NONE, p_setrwc::CR_D, 8, 0, 0, p_setrwc::SET_D); TTI_SETRWC(p_setrwc::CLR_NONE, p_setrwc::CR_D, 8, 0, 0, p_setrwc::SET_D); - } else if (vector_mode == Dim::C) { + } else if (vector_mode == (int)VectorMode::C) { // Do a column vector, Face0 + Face2 -- All iterations for full face #pragma GCC unroll 0 for (int face = 0; face < 2; face++) { diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_1_param.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_1_param.h index c3477ea5c7e..892ed513ea2 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_1_param.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_1_param.h @@ -11,7 +11,7 @@ inline void llk_math_eltwise_unary_sfpu_1_param( void (*first_func)(uint), void (*func)(uint), uint dst_index, - int vector_mode = Dim::RC, + int vector_mode = (int)VectorMode::RC, uint param0 = 0) { if constexpr ((Dst == DstSync::SyncTile16) || (Dst == DstSync::SyncTile2)) { math::set_dst_write_addr(math_sync_tile_dst_index); @@ -20,7 +20,7 @@ inline void llk_math_eltwise_unary_sfpu_1_param( } math::set_addr_mod_base(); TTI_STALLWAIT(p_stall::STALL_SFPU, p_stall::MATH); - if (vector_mode == Dim::R) { + if (vector_mode == (int)VectorMode::R) { // Do a row vector, Face0 + Face1 -- first iteration (first row) const int ITERATIONS = 1; #pragma GCC unroll 0 @@ -34,7 +34,7 @@ inline void llk_math_eltwise_unary_sfpu_1_param( TTI_SETRWC(p_setrwc::CLR_NONE, p_setrwc::CR_D, 8, 0, 0, p_setrwc::SET_D); TTI_SETRWC(p_setrwc::CLR_NONE, p_setrwc::CR_D, 8, 0, 0, p_setrwc::SET_D); TTI_SETRWC(p_setrwc::CLR_NONE, p_setrwc::CR_D, 8, 0, 0, p_setrwc::SET_D); - } else if (vector_mode == Dim::C) { + } else if (vector_mode == (int)VectorMode::C) { // Do a column vector, Face0 + Face2 -- All iterations for full face #pragma GCC unroll 0 for (int face = 0; face < 2; face++) { diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_common_includes.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_common_includes.h index cc08a9f346c..06aa57e9e34 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_common_includes.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_common_includes.h @@ -111,7 +111,7 @@ inline void llk_math_calculate_sfpu( template inline void llk_math_eltwise_unary_sfpu( uint dst_index, - int vector_mode = (int)Dim::RC, + int vector_mode = (int)VectorMode::RC, uint param0 = 0, uint param1 = 0, uint param2 = 0, @@ -126,7 +126,7 @@ inline void llk_math_eltwise_unary_sfpu( _llk_math_eltwise_unary_sfpu_start_(dst_index); - if (vector_mode == (int)Dim::R) { + if (vector_mode == (int)VectorMode::R) { // Do a row vector, Face0 + Face1 -- first iteration (first row) const int iterations = (num_faces < 4) ? ((face_r_dim <= 2) ? 2 : face_r_dim / 2) : 2; // At least 2 iterations for odd and even columns @@ -140,7 +140,7 @@ inline void llk_math_eltwise_unary_sfpu( // Skip next two faces _llk_math_eltwise_unary_sfpu_inc_dst_face_addr_(); _llk_math_eltwise_unary_sfpu_inc_dst_face_addr_(); - } else if (vector_mode == (int)Dim::C) { + } else if (vector_mode == (int)VectorMode::C) { // Do a column vector, Face0 + Face2 if tile is 32x32 or Face0+Face1 if tiles is 32x16 -- All iterations for // full face #pragma GCC unroll 0 diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_elu.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_elu.h index 7917165a25f..81250ea1d3b 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_elu.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_elu.h @@ -24,7 +24,7 @@ inline void llk_math_eltwise_unary_sfpu_elu(uint dst_index, uint param0) { llk_math_eltwise_unary_sfpu_1_param (ckernel::sfpu::calculate_elu, ckernel::sfpu::calculate_elu, - dst_index, Dim::RC, param0); + dst_index, (int)VectorMode::RC, param0); } } diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_erf_erfc.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_erf_erfc.h index 48f6b8dc398..da9a44c5382 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_erf_erfc.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_erf_erfc.h @@ -29,7 +29,7 @@ inline void llk_math_eltwise_unary_sfpu_erf(uint dst_index, int param0 = 0) { llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_sfpu_erf_erfc, ckernel::sfpu::calculate_sfpu_erf_erfc, - dst_index, Dim::RC); + dst_index, (int)VectorMode::RC); } template @@ -37,7 +37,7 @@ inline void llk_math_eltwise_unary_sfpu_erfc(uint dst_index, int param0 = 0) { llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_sfpu_erf_erfc, ckernel::sfpu::calculate_sfpu_erf_erfc, - dst_index, Dim::RC); + dst_index, (int)VectorMode::RC); } } diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_erfinv.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_erfinv.h index aadcb422609..6b7f6a9311e 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_erfinv.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_erfinv.h @@ -24,7 +24,7 @@ inline void llk_math_eltwise_unary_sfpu_erfinv_op(uint dst_index) { llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_erfinv, ckernel::sfpu::calculate_erfinv, - dst_index, Dim::RC); + dst_index, (int)VectorMode::RC); } } diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_exp.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_exp.h index 4022d34274b..ca18cfd4fb8 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_exp.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_exp.h @@ -15,7 +15,7 @@ namespace ckernel { // New LLK SFPU APIs template -inline void llk_math_eltwise_unary_sfpu_exponential(uint dst_index, int vector_mode = Dim::RC, int param0 = 0) { +inline void llk_math_eltwise_unary_sfpu_exponential(uint dst_index, int vector_mode = (int)VectorMode::RC, int param0 = 0) { constexpr bool zero_negative = true; constexpr int first_iterations = 1; diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_gelu.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_gelu.h index 9c96bd6877a..c4976bae921 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_gelu.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_gelu.h @@ -13,7 +13,7 @@ namespace ckernel { // New LLK SFPU APIs template -inline void llk_math_eltwise_unary_sfpu_gelu(uint dst_index, int vector_mode = Dim::RC, int param0=0) { +inline void llk_math_eltwise_unary_sfpu_gelu(uint dst_index, int vector_mode = (int)VectorMode::RC, int param0=0) { constexpr int first_iterations = 1; llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_gelu, @@ -27,7 +27,7 @@ inline void llk_math_eltwise_unary_sfpu_gelu_init() { } template -inline void llk_math_eltwise_unary_sfpu_gelu_derivative(uint dst_index, int vector_mode = Dim::RC) { +inline void llk_math_eltwise_unary_sfpu_gelu_derivative(uint dst_index, int vector_mode = (int)VectorMode::RC) { constexpr int first_iterations = 1; llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_gelu_derivative, diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_i0.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_i0.h index 3b3e8ef87a3..c0b686a269b 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_i0.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_i0.h @@ -24,7 +24,7 @@ inline void llk_math_eltwise_unary_sfpu_i0_op(uint dst_index) { llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_i0, ckernel::sfpu::calculate_i0, - dst_index, Dim::RC); + dst_index, (int)VectorMode::RC); } } diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_isinf_isnan.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_isinf_isnan.h index be0d2cfea43..216bcba507f 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_isinf_isnan.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_isinf_isnan.h @@ -26,7 +26,7 @@ inline void llk_math_eltwise_unary_sfpu_isinf(uint dst_index) { llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_sfpu_isinf_isnan, ckernel::sfpu::calculate_sfpu_isinf_isnan, - dst_index, Dim::RC); + dst_index, (int)VectorMode::RC); } @@ -41,7 +41,7 @@ inline void llk_math_eltwise_unary_sfpu_isposinf(uint dst_index) { llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_sfpu_isinf_isnan, ckernel::sfpu::calculate_sfpu_isinf_isnan, - dst_index,Dim::RC); + dst_index,(int)VectorMode::RC); } @@ -58,7 +58,7 @@ inline void llk_math_eltwise_unary_sfpu_isneginf(uint dst_index) { llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_sfpu_isinf_isnan, ckernel::sfpu::calculate_sfpu_isinf_isnan, - dst_index,Dim::RC); + dst_index,(int)VectorMode::RC); } @@ -73,7 +73,7 @@ inline void llk_math_eltwise_unary_sfpu_isnan(uint dst_index) { llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_sfpu_isinf_isnan, ckernel::sfpu::calculate_sfpu_isinf_isnan, - dst_index,Dim::RC); + dst_index,(int)VectorMode::RC); } @@ -88,7 +88,7 @@ inline void llk_math_eltwise_unary_sfpu_isfinite(uint dst_index) { llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_sfpu_isinf_isnan, ckernel::sfpu::calculate_sfpu_isinf_isnan, - dst_index,Dim::RC); + dst_index,(int)VectorMode::RC); } diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_logical_not_noti.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_logical_not_noti.h index 668701d0aa9..ca3db8419de 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_logical_not_noti.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_logical_not_noti.h @@ -24,7 +24,7 @@ inline void llk_math_eltwise_unary_sfpu_logical_not_unary_op(uint dst_index) { llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_logical_not_unary, ckernel::sfpu::calculate_logical_not_unary, - dst_index, Dim::RC); + dst_index, (int)VectorMode::RC); } } diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_recip.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_recip.h index a2baf2e58e6..251bed18f26 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_recip.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_recip.h @@ -14,7 +14,7 @@ namespace ckernel { // New LLK SFPU APIs template -inline void llk_math_eltwise_unary_sfpu_reciprocal(uint dst_index, int vector_mode = Dim::RC) { +inline void llk_math_eltwise_unary_sfpu_reciprocal(uint dst_index, int vector_mode = (int)VectorMode::RC) { constexpr int first_iterations = 1; llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_reciprocal, diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_relu.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_relu.h index 9d737a27db4..40862b65b8b 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_relu.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_relu.h @@ -38,7 +38,7 @@ inline void llk_math_eltwise_unary_sfpu_lrelu(uint dst_index, uint param0 = 0) { llk_math_eltwise_unary_sfpu_1_param (ckernel::sfpu::calculate_lrelu, ckernel::sfpu::calculate_lrelu, - dst_index, Dim::RC, param0); + dst_index, (int)VectorMode::RC, param0); } template @@ -46,7 +46,7 @@ inline void llk_math_eltwise_unary_sfpu_relu_max(uint dst_index, uint param0 = 0 llk_math_eltwise_unary_sfpu_1_param (ckernel::sfpu::relu_max, ckernel::sfpu::relu_max, - dst_index, Dim::RC, param0); + dst_index, (int)VectorMode::RC, param0); } template @@ -54,7 +54,7 @@ inline void llk_math_eltwise_unary_sfpu_relu_min(uint dst_index, uint param0 = 0 llk_math_eltwise_unary_sfpu_1_param (ckernel::sfpu::relu_min, ckernel::sfpu::relu_min, - dst_index, Dim::RC, param0); + dst_index, (int)VectorMode::RC, param0); } template @@ -62,7 +62,7 @@ inline void llk_math_eltwise_unary_sfpu_relu(uint dst_index) { llk_math_eltwise_unary_sfpu_1_param (ckernel::sfpu::relu_min, ckernel::sfpu::relu_min, - dst_index, Dim::RC, 0); + dst_index, (int)VectorMode::RC, 0); } } diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_reverseops.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_reverseops.h index c1c6c697f81..d307f9490ad 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_reverseops.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_reverseops.h @@ -24,7 +24,7 @@ namespace ckernel { llk_math_eltwise_unary_sfpu_1_param (ckernel::sfpu::calculate_rsub, ckernel::sfpu::calculate_rsub, - dst_index, Dim::RC, param0); + dst_index, (int)VectorMode::RC, param0); } } diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_sqrt.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_sqrt.h index dc1be1f16f9..ec50f756429 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_sqrt.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_sqrt.h @@ -13,7 +13,7 @@ namespace ckernel { // New LLK SFPU APIs template -inline void llk_math_eltwise_unary_sfpu_sqrt(uint dst_index, int vector_mode = Dim::RC) { +inline void llk_math_eltwise_unary_sfpu_sqrt(uint dst_index, int vector_mode = (int)VectorMode::RC) { constexpr bool zero_negative = true; constexpr int first_iterations = 1; llk_math_eltwise_unary_sfpu_0_param diff --git a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_trigonometry.h b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_trigonometry.h index e5066307377..94022110bc3 100644 --- a/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_trigonometry.h +++ b/tt_metal/hw/ckernels/wormhole_b0/metal/llk_api/llk_sfpu/llk_math_eltwise_unary_sfpu_trigonometry.h @@ -25,7 +25,7 @@ inline void llk_math_eltwise_unary_sfpu_sine_op(uint dst_index) { llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_sfpu_trig, ckernel::sfpu::calculate_sfpu_trig, - dst_index, Dim::RC); + dst_index, (int)VectorMode::RC); } @@ -40,7 +40,7 @@ inline void llk_math_eltwise_unary_sfpu_cosine_op(uint dst_index) { llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_sfpu_trig, ckernel::sfpu::calculate_sfpu_trig, - dst_index, Dim::RC); + dst_index, (int)VectorMode::RC); } @@ -55,7 +55,7 @@ inline void llk_math_eltwise_unary_sfpu_tan_op(uint dst_index) { llk_math_eltwise_unary_sfpu_0_param (ckernel::sfpu::calculate_sfpu_trig, ckernel::sfpu::calculate_sfpu_trig, - dst_index, Dim::RC); + dst_index, (int)VectorMode::RC); }