diff options
author | Gunes Bayir <gunes.bayir@arm.com> | 2021-12-10 16:17:56 +0000 |
---|---|---|
committer | Gunes Bayir <gunes.bayir@arm.com> | 2022-07-13 14:47:44 +0000 |
commit | 4bfc70e31766587c951204c93a127a486e007d0c (patch) | |
tree | 198b2150c43b14c571c100b8dfa0d3aaa4c968d0 /src/gpu/cl/kernels/gemm/ClGemmHelpers.h | |
parent | 29cab36ddd73c174bf6b2de453663aa49c1cc576 (diff) | |
download | ComputeLibrary-4bfc70e31766587c951204c93a127a486e007d0c.tar.gz |
Add Gemm MMUL Reshaped Only Rhs Support for FP32/FP16
This patch introduces a GEMM routine that is optimized for Arm(R) Mali(TM)-G715 and Arm(R) Mali(TM)-G615
Resolves: COMPMID-5216
Signed-off-by: Gunes Bayir <gunes.bayir@arm.com>
Change-Id: I2e5d7806f5904347185bb3e250f73d73d6669dba
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/7914
Reviewed-by: SiCong Li <sicong.li@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/gpu/cl/kernels/gemm/ClGemmHelpers.h')
-rw-r--r-- | src/gpu/cl/kernels/gemm/ClGemmHelpers.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gpu/cl/kernels/gemm/ClGemmHelpers.h b/src/gpu/cl/kernels/gemm/ClGemmHelpers.h index 3fce8c9173..bf1e8fce82 100644 --- a/src/gpu/cl/kernels/gemm/ClGemmHelpers.h +++ b/src/gpu/cl/kernels/gemm/ClGemmHelpers.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021 Arm Limited. + * Copyright (c) 2019-2022 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -88,6 +88,21 @@ void update_padding_for_cl_image(ITensorInfo *tensor); * @return Status reporting if we can use the image2d OpenCL object on the RHS reshaped matrix */ Status validate_image2d_support_on_rhs(const ITensorInfo &tensor_reshaped_info, const GEMMRHSMatrixInfo &rhs_info); + +/** Determine if the MMUL kernels should be preferred + * + * @param[in] m Number of rows of the LHS matrix + * @param[in] n Number of columns of the RHS matrix + * @param[in] k Number of columns of the LHS matrix, rows of the RHS matrix + * @param[in] b Batch size + * @param[in] data_type Data type FP32/FP16 + * @param[in, out] best_m0 Suggested M0 (number of rows of the output block) for the kernel + * @param[in, out] best_n0 Suggested N0 (number of columns of the output block) for the kernel + * + * @return true if MMUL kernel is preferred over kernels w/o MMUL, false otherwise + */ +bool is_mmul_kernel_preferred(const unsigned int m, const unsigned int n, const unsigned int k, const unsigned int b, + const DataType data_type, unsigned int &best_m0, unsigned int &best_n0); } // namespace gemm } // namespace kernels } // namespace opencl |