diff options
author | Mohammed Suhail Munshi <MohammedSuhail.Munshi@arm.com> | 2023-12-05 14:27:31 +0000 |
---|---|---|
committer | Mohmun02 <MohammedSuhail.Munshi@arm.com> | 2024-01-10 09:56:39 +0000 |
commit | 7467ba8fac0afb19d750b3bdda9ba95002634038 (patch) | |
tree | e47d4989251f03d13590e6b22d9bd228fd1efe34 /src/cpu/kernels/lut/list.h | |
parent | 7fe7791468978429ab02343a8485b51b39832027 (diff) | |
download | ComputeLibrary-7467ba8fac0afb19d750b3bdda9ba95002634038.tar.gz |
Use look up table for fp16 activation
- Enables FP16 lut for logistic activation
- Adds LUTManager to re-use lut where appropriate.
Signed-off-by: Mohammed Suhail Munshi <MohammedSuhail.Munshi@arm.com>
Change-Id: I94667b63b452a8e58a1eb59cb0b5866178954523
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10864
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/cpu/kernels/lut/list.h')
-rw-r--r-- | src/cpu/kernels/lut/list.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/cpu/kernels/lut/list.h b/src/cpu/kernels/lut/list.h index da90346267..9acfe97728 100644 --- a/src/cpu/kernels/lut/list.h +++ b/src/cpu/kernels/lut/list.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Arm Limited. + * Copyright (c) 2023-2024 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -22,8 +22,8 @@ * SOFTWARE. */ -#ifndef SRC_CORE_NEON_KERNELS_LUT_LIST_H -#define SRC_CORE_NEON_KERNELS_LUT_LIST_H +#ifndef ACL_SRC_CPU_KERNELS_LUT_LIST_H +#define ACL_SRC_CPU_KERNELS_LUT_LIST_H #include <cstddef> #include <cstdint> @@ -34,17 +34,27 @@ namespace cpu { #ifdef __aarch64__ -#define DECLARE_LUT_KERNEL(func_name) \ +#define DECLARE_LUT_U8_KERNEL(func_name) \ void func_name(const uint8_t *table, size_t num_strings, size_t string_length, const uint8_t *const *input, \ uint8_t *const *output) -DECLARE_LUT_KERNEL(lut_u8_neon); -DECLARE_LUT_KERNEL(lut_u8_sve2); +DECLARE_LUT_U8_KERNEL(lut_u8_neon); +DECLARE_LUT_U8_KERNEL(lut_u8_sve2); + +#undef DECLARE_LUT_U8_KERNEL + +#define DECLARE_LUT_U16_KERNEL(func_name) \ + void func_name(const uint16_t *table, size_t num_strings, size_t string_length, const uint16_t *input, \ + uint16_t *output) + +DECLARE_LUT_U16_KERNEL(lut_u16_neon); +DECLARE_LUT_U16_KERNEL(lut_u16_sve); + +#undef DECLARE_LUT_U16_KERNEL -#undef DECLARE_LUT_KERNEL #endif // __aarch64__ } // namespace cpu } // namespace arm_compute -#endif // SRC_CORE_NEON_KERNELS_LUT_LIST_H +#endif // ACL_SRC_CPU_KERNELS_LUT_LIST_H |