Skip to content

Commit

Permalink
#9036: GS & BH --> Combine llk param files using variable args
Browse files Browse the repository at this point in the history
  • Loading branch information
rtawfik01 committed Jun 4, 2024
1 parent d280a3f commit 4b3674c
Show file tree
Hide file tree
Showing 84 changed files with 613 additions and 945 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

#pragma once

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

namespace ckernel {

Expand All @@ -19,8 +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);
}

} // namespace ckernel
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

#pragma once

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

namespace ckernel {

Expand All @@ -19,8 +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);
}

} // namespace ckernel
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@
#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 {

// New LLK SFPU APIs

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>,
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_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 @@ -4,9 +4,9 @@

#pragma once

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

namespace ckernel {

Expand All @@ -19,11 +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>,
llk_math_eltwise_unary_sfpu_params<APPROXIMATE>(
ckernel::sfpu::calculate_cast_fp32_to_fp16a<APPROXIMATE>,
dst_index,
vector_mode);
}

} // namespace ckernel
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

#pragma once

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

namespace ckernel {

Expand All @@ -18,10 +18,8 @@ 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>,
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_params<APPROXIMATE>(
ckernel::sfpu::calculate_clamp<APPROXIMATE>,
dst_index,
vector_mode,
Expand All @@ -30,4 +28,4 @@ inline void llk_math_eltwise_unary_sfpu_clamp(
param2);
}

} // namespace ckernel
}
Loading

0 comments on commit 4b3674c

Please sign in to comment.