Skip to content

Commit 7bc16a4

Browse files
vksnkxnnpack-bot
authored andcommitted
Enable WASM SIMD128 support for unary kernels.
PiperOrigin-RevId: 891906853
1 parent fe22bb1 commit 7bc16a4

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

ynnpack/kernels/unary/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ ARCHS = [
3636
"x86_avx512bf16",
3737
"arm_neon",
3838
"arm_neonfp16",
39+
"wasm_simd128",
3940
]
4041

4142
[ynn_generate_src_hdr(

ynnpack/kernels/unary/generator.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,21 @@ def main(argv: Sequence[str]) -> None:
108108
(convert_fp16_to_fp32, (8, 1)),
109109
(convert_fp32_to_fp16, (8, 1)),
110110
],
111+
"wasm_simd128": [
112+
(abs_fp32, (8, 1)),
113+
(ceil_fp32, (8, 1)),
114+
(cosine_fp32, (8, 1)),
115+
(erf_fp32, (8, 1)),
116+
(exp_fp32, (8, 1)),
117+
(floor_fp32, (8, 1)),
118+
(negate_fp32, (8, 1)),
119+
(reciprocal_square_root_fp32, (8, 1)),
120+
(round_fp32, (8, 1)),
121+
(sine_fp32, (8, 1)),
122+
(square_root_fp32, (8, 1)),
123+
(sigmoid_fp32, (8, 1)),
124+
(tanh_fp32, (8, 1)),
125+
],
111126
}[target]
112127

113128
generate_elementwise_kernels(output_src, output_inc, target, kernels)

ynnpack/kernels/unary/kernels.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@
3232
#ifdef YNN_ARCH_ARM_NEONFP16
3333
#include "ynnpack/kernels/unary/arm_neonfp16.inc"
3434
#endif // YNN_ARCH_ARM_NEONFP16
35+
36+
#ifdef YNN_ARCH_WASM_SIMD128
37+
#include "ynnpack/kernels/unary/wasm_simd128.inc"
38+
#endif // YNN_ARCH_WASM_SIMD128

0 commit comments

Comments
 (0)