Skip to content

Commit

Permalink
#9036: Combine llk param files using variable args
Browse files Browse the repository at this point in the history
  • Loading branch information
rtawfik01 committed Jun 3, 2024
1 parent 348cc5b commit 8e3cd8f
Show file tree
Hide file tree
Showing 49 changed files with 368 additions and 586 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 @@ -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);
}

}
Loading

0 comments on commit 8e3cd8f

Please sign in to comment.