Skip to content

Commit

Permalink
Replace vscaleexpminusmax yaml with table header
Browse files Browse the repository at this point in the history
 - Include table header and remove yaml file
  • Loading branch information
RahulSundarMCW committed Nov 4, 2024
1 parent 3a65060 commit ab42c5a
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 1,358 deletions.
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ MICROKERNEL_DEFS = [
"src/f32-vrnd/f32-vrndu.h",
"src/f32-vrnd/f32-vrndz.h",
"src/f32-vrsqrt/f32-vrsqrt.h",
"src/f32-vscaleexpminusmax/f32-vscaleexpminusmax.h",
"src/f32-vsigmoid/f32-vsigmoid.h",
"src/f32-vsqr/f32-vsqr.h",
"src/f32-vsqrt/f32-vsqrt.h",
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ tools/generate-raddstoreexpminusmax-test.py --spec test/f32-raddstoreexpminusmax
tools/generate-vscaleextexp-test.py --spec test/f32-vscaleextexp.yaml --output test/f32-vscaleextexp.cc &

### Tests for VScaleExpMinusMax micro-kernels
tools/generate-vscaleexpminusmax-test.py --spec test/f32-vscaleexpminusmax.yaml --output test/f32-vscaleexpminusmax.cc &
tools/generate-vscaleexpminusmax-test.py --tester VScaleExpMinusMaxMicrokernelTester --ukernel f32-vscaleexpminusmax --output test/f32-vscaleexpminusmax.cc &

### Tests for VMulCAddC micro-kernels
tools/generate-vmulcaddc-test.py --spec test/f16-vmulcaddc-minmax.yaml --output test/f16-vmulcaddc-minmax.cc &
Expand Down
53 changes: 53 additions & 0 deletions src/f32-vscaleexpminusmax/f32-vscaleexpminusmax.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright 2023 Google LLC
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
#ifndef XNN_UKERNEL_WITH_PARAMS
#define XNN_UKERNEL_WITH_PARAMS(arch_flags, ukernel, element_tile, datatype, params_type, init_params) \
XNN_UKERNEL(arch_flags, ukernel, element_tile, datatype)
#define XNN_DEFINED_UKERNEL_WITH_PARAMS
#endif
#ifndef XNN_UKERNEL
#define XNN_UKERNEL(arch_flags, ukernel, element_tile, datatype) \
XNN_UKERNEL_WITH_PARAMS(arch_flags, ukernel, element_tile, datatype, void, /*init_params=*/nullptr)
#define XNN_DEFINED_UKERNEL
#endif

#if XNN_ARCH_X86 || XNN_ARCH_X86_64
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx2, xnn_f32_vscaleexpminusmax_ukernel__avx2_p5_u8, 8, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx2, xnn_f32_vscaleexpminusmax_ukernel__avx2_p5_u16, 16, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx2, xnn_f32_vscaleexpminusmax_ukernel__avx2_p5_u24, 24, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx2, xnn_f32_vscaleexpminusmax_ukernel__avx2_p5_u32, 32, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx2, xnn_f32_vscaleexpminusmax_ukernel__avx2_p5_u40, 40, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx2, xnn_f32_vscaleexpminusmax_ukernel__avx2_p5_u48, 48, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx2, xnn_f32_vscaleexpminusmax_ukernel__avx2_p5_u56, 56, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx2, xnn_f32_vscaleexpminusmax_ukernel__avx2_p5_u64, 64, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx2, xnn_f32_vscaleexpminusmax_ukernel__avx2_p5_u72, 72, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx2, xnn_f32_vscaleexpminusmax_ukernel__avx2_p5_u80, 80, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx2, xnn_f32_vscaleexpminusmax_ukernel__avx2_p5_u88, 88, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx2, xnn_f32_vscaleexpminusmax_ukernel__avx2_p5_u96, 96, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
#endif

#if XNN_ENABLE_AVX512F && (XNN_ARCH_X86 || XNN_ARCH_X86_64)
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx512f, xnn_f32_vscaleexpminusmax_ukernel__avx512f_p5_scalef_u16, 16, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx512f, xnn_f32_vscaleexpminusmax_ukernel__avx512f_p5_scalef_u32, 32, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx512f, xnn_f32_vscaleexpminusmax_ukernel__avx512f_p5_scalef_u48, 48, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx512f, xnn_f32_vscaleexpminusmax_ukernel__avx512f_p5_scalef_u64, 64, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx512f, xnn_f32_vscaleexpminusmax_ukernel__avx512f_p5_scalef_u80, 80, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx512f, xnn_f32_vscaleexpminusmax_ukernel__avx512f_p5_scalef_u96, 96, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx512f, xnn_f32_vscaleexpminusmax_ukernel__avx512f_p5_scalef_u112, 112, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx512f, xnn_f32_vscaleexpminusmax_ukernel__avx512f_p5_scalef_u128, 128, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx512f, xnn_f32_vscaleexpminusmax_ukernel__avx512f_p5_scalef_u144, 144, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx512f, xnn_f32_vscaleexpminusmax_ukernel__avx512f_p5_scalef_u160, 160, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx512f, xnn_f32_vscaleexpminusmax_ukernel__avx512f_p5_scalef_u176, 176, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
XNN_UKERNEL_WITH_PARAMS(xnn_arch_x86_avx512f, xnn_f32_vscaleexpminusmax_ukernel__avx512f_p5_scalef_u192, 192, float, struct xnn_f32_default_params, ((xnn_f32_vscaleexpminusmax_ukernel_fn) NULL))
#endif

#ifdef XNN_DEFINED_UKERNEL_WITH_PARAMS
#undef XNN_DEFINED_UKERNEL_WITH_PARAMS
#undef XNN_UKERNEL_WITH_PARAMS
#endif
#ifdef XNN_DEFINED_UKERNEL
#undef XNN_DEFINED_UKERNEL
#undef XNN_UKERNEL
#endif
Loading

0 comments on commit ab42c5a

Please sign in to comment.