diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-06-25 05:42:57 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-06-29 12:38:33 +0000 |
commit | 5fdde99f4271891a40c02cd1e89f1344aa84583a (patch) | |
tree | 35944b8bb0eee6aa9bbca08c38325f10cf66370c /src/core/cpu/kernels/CpuSubKernel.h | |
parent | 4a95bba6ca61ce99995ece6fd237b5498c9f322c (diff) | |
download | ComputeLibrary-5fdde99f4271891a40c02cd1e89f1344aa84583a.tar.gz |
Improve selection speed of CPU implementations
CPU micro-kernel to be used was picked during kernel execution.
Move selection during configuration to reduce runtime overhead.
Standardize kernel names as follows:
<simd_tech>_<data_type>_<data_layout>_<kernel_name>
e.g. sve_fp32_nhwc_scale
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: I544f1c08c8fef0f130a3bde61882ccb9a1f47f21
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5855
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/cpu/kernels/CpuSubKernel.h')
-rw-r--r-- | src/core/cpu/kernels/CpuSubKernel.h | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/core/cpu/kernels/CpuSubKernel.h b/src/core/cpu/kernels/CpuSubKernel.h index da114b6e08..b9160bd150 100644 --- a/src/core/cpu/kernels/CpuSubKernel.h +++ b/src/core/cpu/kernels/CpuSubKernel.h @@ -61,25 +61,9 @@ public: * @param[in] policy Overflow policy. Convert policy cannot be WRAP if datatype is quantized. */ void configure(const ITensorInfo *src0, const ITensorInfo *src1, ITensorInfo *dst, ConvertPolicy policy); - /** Static function to check if given info will lead to a valid configuration of @ref CpuSubKernel + /** Static function to check if given info will lead to a valid configuration * - * Valid configurations (src0,src1) -> dst : - * - * - (U8,U8) -> U8 - * - (U8,U8) -> S16 - * - (QASYMM8, QASYMM8) -> QASYMM8 - * - (QASYMM8_SIGNED, QASYMM8_SIGNED) -> QASYMM8_SIGNED - * - (S16,U8) -> S16 - * - (U8,S16) -> S16 - * - (S16,S16) -> S16 - * - (S32,S32) -> S32 - * - (F16,F16) -> F16 - * - (F32,F32) -> F32 - * - * @param[in] src0 An input tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/QSYMM16/S16/S32/F16/F32 - * @param[in] src1 An input tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/QSYMM16/S16/S32/F16/F32 - * @param[in] dst The dst tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/QSYMM16/S16/S32/F16/F32. - * @param[in] policy Policy to use to handle overflow. Convert policy cannot be WRAP if datatype is quantized. + * Similar to CpuSubKernel::configure() * * @return a status */ @@ -90,7 +74,12 @@ public: const char *name() const override; private: + using SubKernelPtr = std::add_pointer<void(const ITensor *, const ITensor *, ITensor *, const ConvertPolicy &, const Window &)>::type; + +private: ConvertPolicy _policy{}; + SubKernelPtr _run_method{ nullptr }; + std::string _name{}; }; } // namespace kernels } // namespace cpu |