Skip to content

Commit

Permalink
#9036: only use one llk_sfpu params file for wormhole
Browse files Browse the repository at this point in the history
  • Loading branch information
rtawfik01 committed Jun 3, 2024
1 parent d9068b2 commit 604889b
Show file tree
Hide file tree
Showing 44 changed files with 352 additions and 306 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "llk_math_eltwise_unary_sfpu_init.h"
#include "llk_math_eltwise_unary_sfpu_0_param.h"
#include "llk_math_eltwise_unary_sfpu_params.h"
#include "ckernel_sfpu_abs.h"

namespace ckernel {
Expand All @@ -19,10 +19,10 @@ inline void llk_math_eltwise_unary_sfpu_abs_init() {

template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_abs(uint dst_index, int vector_mode = (int)VectorMode::RC) {
llk_math_eltwise_unary_sfpu_0_param<APPROXIMATE>
(ckernel::sfpu::calculate_abs<APPROXIMATE>,
ckernel::sfpu::calculate_abs<APPROXIMATE>,
dst_index, vector_mode);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_abs<APPROXIMATE>,
dst_index,
vector_mode);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "llk_math_eltwise_unary_sfpu_init.h"
#include "llk_math_eltwise_unary_sfpu_0_param.h"
#include "llk_math_eltwise_unary_sfpu_params.h"
#include "ckernel_sfpu_add1.h"

namespace ckernel {
Expand All @@ -19,10 +19,10 @@ inline void llk_math_eltwise_unary_sfpu_add1_init() {

template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_add1(uint dst_index, int vector_mode = (int)VectorMode::RC) {
llk_math_eltwise_unary_sfpu_0_param<APPROXIMATE>
(ckernel::sfpu::calculate_add1<APPROXIMATE>,
ckernel::sfpu::calculate_add1<APPROXIMATE>,
dst_index, vector_mode);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_add1<APPROXIMATE>,
dst_index,
vector_mode);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "ckernel_sfpu_binop_with_unary.h"
#include "llk_math_eltwise_unary_sfpu_1_param.h"
#include "llk_math_eltwise_unary_sfpu_params.h"
#include "llk_math_eltwise_unary_sfpu_init.h"

namespace ckernel {
Expand All @@ -14,8 +14,7 @@ namespace ckernel {

template <bool APPROXIMATE, int binop_mode>
inline void llk_math_eltwise_unary_sfpu_binop_with_scalar(uint dst_index, uint32_t param1, int vector_mode = VectorMode::RC) {
llk_math_eltwise_unary_sfpu_1_param<APPROXIMATE>(
ckernel::sfpu::calculate_binop_with_scalar<APPROXIMATE, binop_mode, 8>,
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_binop_with_scalar<APPROXIMATE, binop_mode, 8>,
dst_index,
vector_mode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "llk_math_eltwise_unary_sfpu_init.h"
#include "llk_math_eltwise_unary_sfpu_0_param.h"
#include "llk_math_eltwise_unary_sfpu_params.h"
#include "ckernel_sfpu_cast_fp32_to_fp16a.h"

namespace ckernel {
Expand All @@ -19,10 +19,10 @@ inline void llk_math_eltwise_unary_sfpu_cast_fp32_to_fp16a_init() {

template <bool APPROXIMATE>
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_0_param<APPROXIMATE>
(ckernel::sfpu::calculate_cast_fp32_to_fp16a<APPROXIMATE>,
ckernel::sfpu::calculate_cast_fp32_to_fp16a<APPROXIMATE>,
dst_index, vector_mode);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_cast_fp32_to_fp16a<APPROXIMATE>,
dst_index,
vector_mode);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "llk_math_eltwise_unary_sfpu_init.h"
#include "llk_math_eltwise_unary_sfpu_3_param.h"
#include "llk_math_eltwise_unary_sfpu_params.h"
#include "ckernel_sfpu_clamp.h"

namespace ckernel {
Expand All @@ -19,10 +19,13 @@ inline void llk_math_eltwise_unary_sfpu_clamp_init() {

template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_clamp(uint dst_index, uint param0, uint param1, uint param2, int vector_mode = (int)VectorMode::RC) {
llk_math_eltwise_unary_sfpu_3_param<APPROXIMATE>
(ckernel::sfpu::calculate_clamp<APPROXIMATE>,
ckernel::sfpu::calculate_clamp<APPROXIMATE>,
dst_index, vector_mode, param0, param1, param2);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_clamp<APPROXIMATE>,
dst_index,
vector_mode,
param0,
param1,
param2);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "llk_math_eltwise_unary_sfpu_init.h"
#include "llk_math_eltwise_unary_sfpu_1_param.h"
#include "llk_math_eltwise_unary_sfpu_params.h"
#include "ckernel_sfpu_comp.h"

namespace ckernel {
Expand All @@ -15,10 +15,11 @@ namespace ckernel {
//EQZ
template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_eqz(uint dst_index, int vector_mode = (int)VectorMode::RC) {
llk_math_eltwise_unary_sfpu_1_param<APPROXIMATE>
(ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::equal_zero>,
ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::equal_zero>,
dst_index, vector_mode, 8);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::equal_zero>,
dst_index,
vector_mode,
8);
}

template <bool APPROXIMATE>
Expand All @@ -29,10 +30,11 @@ inline void llk_math_eltwise_unary_sfpu_eqz_init() {
//NEZ
template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_nez(uint dst_index, int vector_mode = (int)VectorMode::RC) {
llk_math_eltwise_unary_sfpu_1_param<APPROXIMATE>
(ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::not_equal_zero>,
ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::not_equal_zero>,
dst_index, vector_mode, 8);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::not_equal_zero>,
dst_index,
vector_mode,
8);
}

template <bool APPROXIMATE>
Expand All @@ -43,10 +45,11 @@ inline void llk_math_eltwise_unary_sfpu_nez_init() {
//LTZ
template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_ltz(uint dst_index, int vector_mode = (int)VectorMode::RC) {
llk_math_eltwise_unary_sfpu_1_param<APPROXIMATE>
(ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::less_than_zero>,
ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::less_than_zero>,
dst_index, vector_mode, 8);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::less_than_zero>,
dst_index,
vector_mode,
8);
}

template <bool APPROXIMATE>
Expand All @@ -57,10 +60,11 @@ inline void llk_math_eltwise_unary_sfpu_ltz_init() {
//GTZ
template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_gtz(uint dst_index, int vector_mode = (int)VectorMode::RC) {
llk_math_eltwise_unary_sfpu_1_param<APPROXIMATE>
(ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::greater_than_zero>,
ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::greater_than_zero>,
dst_index, vector_mode, 8);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::greater_than_zero>,
dst_index,
vector_mode,
8);
}

template <bool APPROXIMATE>
Expand All @@ -71,10 +75,11 @@ inline void llk_math_eltwise_unary_sfpu_gtz_init() {
//LEZ
template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_lez(uint dst_index, int vector_mode = (int)VectorMode::RC) {
llk_math_eltwise_unary_sfpu_1_param<APPROXIMATE>
(ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::less_than_equal_zero>,
ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::less_than_equal_zero>,
dst_index, vector_mode, 8);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::less_than_equal_zero>,
dst_index,
vector_mode,
8);
}

template <bool APPROXIMATE>
Expand All @@ -85,10 +90,11 @@ inline void llk_math_eltwise_unary_sfpu_lez_init() {
//GEZ
template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_gez(uint dst_index, int vector_mode = (int)VectorMode::RC) {
llk_math_eltwise_unary_sfpu_1_param<APPROXIMATE>
(ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::greater_than_equal_zero>,
ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::greater_than_equal_zero>,
dst_index, vector_mode, 8);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_comp<APPROXIMATE, SfpuType::greater_than_equal_zero>,
dst_index,
vector_mode,
8);
}

template <bool APPROXIMATE>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "llk_math_eltwise_unary_sfpu_init.h"
#include "llk_math_eltwise_unary_sfpu_2_param.h"
#include "llk_math_eltwise_unary_sfpu_params.h"
#include "ckernel_sfpu_dropout.h"

namespace ckernel {
Expand All @@ -19,10 +19,12 @@ inline void llk_math_eltwise_unary_sfpu_dropout_init(uint seed = 0) {

template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_dropout(uint dst_index, int vector_mode = (int)VectorMode::RC, int integer_dropout, int scale_factor) {
llk_math_eltwise_unary_sfpu_2_param<APPROXIMATE>
(ckernel::sfpu::calculate_dropout<APPROXIMATE>,
ckernel::sfpu::calculate_dropout<APPROXIMATE>,
dst_index, vector_mode, integer_dropout, scale_factor);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_dropout<APPROXIMATE>,
dst_index,
vector_mode,
integer_dropout,
scale_factor);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "llk_math_eltwise_unary_sfpu_init.h"
#include "llk_math_eltwise_unary_sfpu_1_param.h"
#include "llk_math_eltwise_unary_sfpu_params.h"
#include "ckernel_sfpu_elu.h"

namespace ckernel {
Expand All @@ -19,10 +19,11 @@ inline void llk_math_eltwise_unary_sfpu_elu_init() {

template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_elu(uint dst_index, uint param0) {
llk_math_eltwise_unary_sfpu_1_param<APPROXIMATE>
(ckernel::sfpu::calculate_elu<APPROXIMATE>,
ckernel::sfpu::calculate_elu<APPROXIMATE>,
dst_index, (int)VectorMode::RC, param0);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_elu<APPROXIMATE>,
dst_index,
(int)VectorMode::RC,
param0);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "llk_math_eltwise_unary_sfpu_init.h"
#include "llk_math_eltwise_unary_sfpu_0_param.h"
#include "llk_math_eltwise_unary_sfpu_params.h"
#include "ckernel_sfpu_erf_erfc.h"

namespace ckernel {
Expand All @@ -24,18 +24,18 @@ inline void llk_math_eltwise_unary_sfpu_erfc_init() {

template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_erf(uint dst_index, int param0 = 0) {
llk_math_eltwise_unary_sfpu_0_param<APPROXIMATE>
(ckernel::sfpu::calculate_sfpu_erf_erfc<SfpuType::erf, APPROXIMATE>,
ckernel::sfpu::calculate_sfpu_erf_erfc<SfpuType::erf, APPROXIMATE>,
dst_index, (int)VectorMode::RC);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_sfpu_erf_erfc<SfpuType::erf, APPROXIMATE>,
dst_index,
(int)VectorMode::RC);
}

template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_erfc(uint dst_index, int param0 = 0) {
llk_math_eltwise_unary_sfpu_0_param<APPROXIMATE>
(ckernel::sfpu::calculate_sfpu_erf_erfc<SfpuType::erfc, APPROXIMATE>,
ckernel::sfpu::calculate_sfpu_erf_erfc<SfpuType::erfc, APPROXIMATE>,
dst_index, (int)VectorMode::RC);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_sfpu_erf_erfc<SfpuType::erfc, APPROXIMATE>,
dst_index,
(int)VectorMode::RC);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "llk_math_eltwise_unary_sfpu_init.h"
#include "llk_math_eltwise_unary_sfpu_0_param.h"
#include "llk_math_eltwise_unary_sfpu_params.h"
#include "ckernel_sfpu_erfinv.h"

namespace ckernel {
Expand All @@ -19,10 +19,10 @@ inline void llk_math_eltwise_unary_sfpu_erfinv_init() {

template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_erfinv_op(uint dst_index) {
llk_math_eltwise_unary_sfpu_0_param<APPROXIMATE>
(ckernel::sfpu::calculate_erfinv<APPROXIMATE>,
ckernel::sfpu::calculate_erfinv<APPROXIMATE>,
dst_index, (int)VectorMode::RC);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_erfinv<APPROXIMATE>,
dst_index,
(int)VectorMode::RC);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ inline void llk_math_eltwise_unary_sfpu_exponential(uint dst_index, int vector_m

llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_exponential<APPROXIMATE>,
dst_index, vector_mode, param0, param1);
dst_index,
vector_mode,
param0,
param1);
}

template <bool APPROXIMATE>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "llk_math_eltwise_unary_sfpu_init.h"
#include "llk_math_eltwise_unary_sfpu_0_param.h"
#include "llk_math_eltwise_unary_sfpu_params.h"
#include "ckernel_sfpu_exp2.h"

namespace ckernel {
Expand All @@ -19,10 +19,10 @@ inline void llk_math_eltwise_unary_sfpu_exp2_init() {

template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_exp2(uint dst_index, int vector_mode = (int)VectorMode::RC) {
llk_math_eltwise_unary_sfpu_0_param<APPROXIMATE>
(ckernel::sfpu::calculate_exp2<APPROXIMATE>,
ckernel::sfpu::calculate_exp2<APPROXIMATE>,
dst_index, vector_mode);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_exp2<APPROXIMATE>,
dst_index,
vector_mode);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "llk_math_eltwise_unary_sfpu_init.h"
#include "llk_math_eltwise_unary_sfpu_0_param.h"
#include "llk_math_eltwise_unary_sfpu_params.h"
#include "ckernel_sfpu_expm1.h"

namespace ckernel {
Expand All @@ -19,10 +19,10 @@ inline void llk_math_eltwise_unary_sfpu_expm1_init() {

template <bool APPROXIMATE>
inline void llk_math_eltwise_unary_sfpu_expm1(uint dst_index, int vector_mode = (int)VectorMode::RC) {
llk_math_eltwise_unary_sfpu_0_param<APPROXIMATE>
(ckernel::sfpu::calculate_expm1<APPROXIMATE>,
ckernel::sfpu::calculate_expm1<APPROXIMATE>,
dst_index, vector_mode);
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_expm1<APPROXIMATE>,
dst_index,
vector_mode);
}

}
Loading

0 comments on commit 604889b

Please sign in to comment.