diff options
author | Fadi Arafeh <fadi.arafeh@arm.com> | 2022-10-06 16:20:14 +0000 |
---|---|---|
committer | fadi.arafeh <fadi.arafeh@arm.com> | 2022-11-22 14:04:45 +0000 |
commit | 73bb6b7ad80801e56633ad4ea12b0404b586a979 (patch) | |
tree | 9f35a75499df4e1cc49cc6f3336c805384a53c13 /src/cpu/kernels/CpuElementwiseKernel.h | |
parent | ca1a52d14551147456a9a1ea2e24f5c141a6d80e (diff) | |
download | ComputeLibrary-73bb6b7ad80801e56633ad4ea12b0404b586a979.tar.gz |
ONCPUML-1072: Tuned MWS values (for N1, V1) for binary operators used by oneDNN
Added approximate values for MWS for the following binary operators:
Add, Sub, Mul, Min, Max, Div
Change-Id: I5c4c75511129982a3f44c038ee272f09598469de
Signed-off-by: Fadi Arafeh <fadi.arafeh@arm.com>
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/c/VisualCompute/ComputeLibrary/+/459609
Tested-by: bsgcomp <bsgcomp@arm.com>
Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Comments-Addressed: bsgcomp <bsgcomp@arm.com>
Signed-off-by: fadara01 <fadi.arafeh@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8392
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/cpu/kernels/CpuElementwiseKernel.h')
-rw-r--r-- | src/cpu/kernels/CpuElementwiseKernel.h | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/cpu/kernels/CpuElementwiseKernel.h b/src/cpu/kernels/CpuElementwiseKernel.h index 2785e0a44c..634e38bf9f 100644 --- a/src/cpu/kernels/CpuElementwiseKernel.h +++ b/src/cpu/kernels/CpuElementwiseKernel.h @@ -72,8 +72,8 @@ protected: static Status validate_arguments_common(const ITensorInfo &src0, const ITensorInfo &src1, const ITensorInfo &dst); protected: - std::function<ElementwiseFunction> _run_method{ nullptr }; - std::string _name{}; + ElementwiseKernelPtr _run_method{ nullptr }; + std::string _name{}; }; class CpuArithmeticKernel : public CpuElementwiseKernel<CpuArithmeticKernel> @@ -100,6 +100,15 @@ public: static const std::vector<CpuElementwiseKernel<CpuArithmeticKernel>::ElementwiseKernel> &get_available_kernels(); + /** Return minimum workload size of the relevant kernel + * + * @param[in] platform The CPU platform used to create the context. + * @param[in] thread_count Number of threads in the execution. + * + * @return[out] mws Minimum workload size for requested configuration. + */ + size_t get_mws(const CPUInfo &platform, size_t thread_count) const override; + protected: /** Commmon configure function for element-wise operators with no additional options (e.g. Min, Max, SquaredDiff) */ @@ -108,16 +117,6 @@ protected: static Status validate_arguments(const ITensorInfo &src0, const ITensorInfo &src1, const ITensorInfo &dst); ArithmeticOperation _op{}; - -private: - /** Function to get the micro kernel implementation - * - * @param[in] src0 First input tensor information - * @param[in] src1 Second input tensor information - * @param[in] dst Output tensor information - * - * @return the function instance for the micro kernel - */ }; class CpuDivisionKernel : public CpuArithmeticKernel @@ -141,6 +140,15 @@ public: */ static Status validate(const ITensorInfo *src0, const ITensorInfo *src1, const ITensorInfo *dst); + /** Return minimum workload size of the relevant kernel + * + * @param[in] platform The CPU platform used to create the context. + * @param[in] thread_count Number of threads in the execution. + * + * @return[out] mws Minimum workload size for requested configuration. + */ + size_t get_mws(const CPUInfo &platform, size_t thread_count) const override; + protected: // Inherited methods overridden: static Status validate_arguments(const ITensorInfo &src0, const ITensorInfo &src1, const ITensorInfo &dst); |