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 --- utils/TypePrinter.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'utils') diff --git a/utils/TypePrinter.h b/utils/TypePrinter.h index d40c3eb3d7..0327cd1b35 100644 --- a/utils/TypePrinter.h +++ b/utils/TypePrinter.h @@ -49,6 +49,7 @@ #include "arm_compute/runtime/CL/CLTunerTypes.h" #include "arm_compute/runtime/CL/CLTypes.h" #include "arm_compute/runtime/FunctionDescriptors.h" +#include "arm_compute/runtime/NEON/functions/NEMatMul.h" #include "arm_compute/runtime/common/LSTMParams.h" #include "support/Cast.h" #include "support/StringSupport.h" @@ -3741,6 +3742,35 @@ inline std::string to_string(const arm_compute::MatMulKernelInfo &matmul_info) return str.str(); } +/** Formatted output of the arm_compute::CpuMatMulSettings type. + * + * @param[out] os Output stream. + * @param[in] settings arm_compute::CpuMatMulSettings type to output. + * + * @return Modified output stream. + */ +inline ::std::ostream &operator<<(::std::ostream &os, const arm_compute::CpuMatMulSettings &settings) +{ + os << "CpuMatMulSettings=" + << "[" + << "fast_math=" << settings.fast_math() + << "]"; + + return os; +} +/** Formatted output of the arm_compute::CpuMatMulSettings type. + * + * @param[in] settings arm_compute::CpuMatMulSettings type to output. + * + * @return Formatted string. + */ +inline std::string to_string(const arm_compute::CpuMatMulSettings &settings) +{ + std::stringstream str; + str << settings; + return str.str(); +} + } // namespace arm_compute #endif /* __ARM_COMPUTE_TYPE_PRINTER_H__ */ -- cgit v1.2.1