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/CpuAddKernel.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/CpuAddKernel.h')
-rw-r--r-- | src/core/cpu/kernels/CpuAddKernel.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/cpu/kernels/CpuAddKernel.h b/src/core/cpu/kernels/CpuAddKernel.h index a36ec7ad65..3ebaa462ee 100644 --- a/src/core/cpu/kernels/CpuAddKernel.h +++ b/src/core/cpu/kernels/CpuAddKernel.h @@ -61,12 +61,9 @@ public: * @param[in] policy Overflow policy. */ 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 CpuAddKernel + /** Static function to check if given info will lead to a valid configuration * - * @param[in] src0 First input tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/QSYMM16/F16/S32/F32 - * @param[in] src1 Second input tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/QSYMM16/F16/S32/F32 - * @param[in] dst The dst tensor info. Data types supported: U8/QASYMM8/QASYMM8_SIGNED/S16/QSYMM16/F16/S32/F32. - * @param[in] policy Overflow policy. + * Similar to CpuAddKernel::configure() * * @return a status */ @@ -77,7 +74,12 @@ public: const char *name() const override; private: + using AddKernelPtr = std::add_pointer<void(const ITensor *, const ITensor *, ITensor *, const ConvertPolicy &, const Window &)>::type; + +private: ConvertPolicy _policy{}; + AddKernelPtr _run_method{ nullptr }; + std::string _name{}; }; } // namespace kernels } // namespace cpu |