blob: c2ae2a67f4782098da72e164a2ff87e654a4428a [file] [log] [blame]
Gunes Bayire87fa662023-09-07 12:20:33 +01001/*
2 * Copyright (c) 2023 Arm Limited.
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24
25#ifndef ACL_SRC_GPU_CL_KERNELS_HELPERS_MATMULKERNELHELPERS_H
26#define ACL_SRC_GPU_CL_KERNELS_HELPERS_MATMULKERNELHELPERS_H
27
28#include "arm_compute/core/Error.h"
29#include "arm_compute/core/KernelDescriptors.h"
30#include "arm_compute/core/TensorShape.h"
31#include "arm_compute/core/Window.h"
32
33namespace arm_compute
34{
35namespace opencl
36{
37namespace kernels
38{
39/** Validate the input shapes of Matmul operation
40 *
41 * @param[in] lhs_shape Lhs tensor shape
42 * @param[in] rhs_shape Rhs tensor shape
43 * @param[in] matmul_kernel_info Matmul kernel info
44 *
45 * @return true if the shapes and matmul kernel info matches
46 */
Felix Thomasmathibalanafd38f02023-09-27 17:46:17 +010047Status validate_matmul_input_shapes(const TensorShape &lhs_shape,
48 const TensorShape &rhs_shape,
Gunes Bayire87fa662023-09-07 12:20:33 +010049 const MatMulKernelInfo &matmul_kernel_info);
50
51/** Validate and configure window for Matmul MMUL kernels
52 *
53 * @param[in] lhs Lhs tensor info
54 * @param[in] rhs Rhs tensor info
55 * @param[in] dst Dst tensor info
56 * @param[in] matmul_kernel_info Matmul kernel info
57 * @param[in] mmul_m0 Number of rows in the MMUL block
58 * @param[in] mmul_n0 Number of columns in the MMUL block
59 *
60 * @return a pair of Status and Window object
61 */
Felix Thomasmathibalanafd38f02023-09-27 17:46:17 +010062std::pair<Status, Window> validate_and_configure_window_for_mmul_kernels(const ITensorInfo *lhs,
63 const ITensorInfo *rhs,
64 const ITensorInfo *dst,
65 const MatMulKernelInfo &matmul_kernel_info,
66 int mmul_m0,
67 int mmul_n0);
Gunes Bayire87fa662023-09-07 12:20:33 +010068} // namespace kernels
69} // namespace opencl
70} // namespace arm_compute
71
72#endif // ACL_SRC_GPU_CL_KERNELS_HELPERS_MATMULKERNELHELPERS_H