From a1b1e41bb261f5613f443fed7071936a360686ed Mon Sep 17 00:00:00 2001 From: Mohammed Suhail Munshi Date: Thu, 23 Mar 2023 22:21:31 +0000 Subject: Implement MatMul Function and Operator with Floating Point support for CPU - Implements MatMul function and operator for floating point datatype FP16/FP32 - Includes support for transposing dynamic tensors prior to matrix multiplication. - Adds tests for 2D/3D/4D+ tensors in MatMul with F32/F16 datatype (with all combinations of transposed/not-transposed tensors) - Updates fixture to allow for testing fused activation in MatMul - Adds tests for matmul with and without fused activation Resolved: [COMPMID-5898] Signed-off-by: Mohammed Suhail Munshi Change-Id: Iefa84b26dd723c9a51e6c3f91023152c6c31ace2 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9411 Reviewed-by: SiCong Li Tested-by: Arm Jenkins Benchmark: Arm Jenkins --- arm_compute/runtime/CL/functions/CLMatMul.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'arm_compute/runtime/CL/functions') diff --git a/arm_compute/runtime/CL/functions/CLMatMul.h b/arm_compute/runtime/CL/functions/CLMatMul.h index 56dd9c5655..712bac06bf 100644 --- a/arm_compute/runtime/CL/functions/CLMatMul.h +++ b/arm_compute/runtime/CL/functions/CLMatMul.h @@ -35,6 +35,13 @@ class ITensorInfo; class MatMulInfo; class Status; +/** Settings for MatMul OpenCL implementation */ +class GpuMatMulSettings +{ +public: + /* Placeholder for operator parity between CPU/GPU */ +}; + /** Basic function to execute MatMul (Matrix Multiplication) on OpenCL */ class CLMatMul : public IFunction { @@ -73,13 +80,14 @@ public: * @param[in] rhs RHS input tensor (Matrix B). Data type supported: same as @p lhs. * @param[out] output Output tensor. Data type supported: same as @p lhs. * @param[in] matmul_info Attributes for MatMul + * @param[in] settings Class containing flags for function level settings */ - void configure(const CLCompileContext &compile_context, ICLTensor *rhs, ICLTensor *lhs, ICLTensor *output, const MatMulInfo &matmul_info); + void configure(const CLCompileContext &compile_context, ICLTensor *rhs, ICLTensor *lhs, ICLTensor *output, const MatMulInfo &matmul_info, const GpuMatMulSettings &settings = GpuMatMulSettings{}); /** Initialise the kernel's inputs and output * * Similar to @ref CLMatMul::configure() */ - void configure(ICLTensor *lhs, ICLTensor *rhs, ICLTensor *output, const MatMulInfo &matmul_info); + void configure(ICLTensor *lhs, ICLTensor *rhs, ICLTensor *output, const MatMulInfo &matmul_info, const GpuMatMulSettings &settings = GpuMatMulSettings{}); /** Static function to check if given info will lead to a valid configuration of @ref CLMatMul. * * Similar to @ref CLMatMul::configure() -- cgit v1.2.1