| 1 | //===- TosaToLinalgUtils.h - Shared TOSA to Linalg lowering utilities |
| 2 | //-------===// |
| 3 | // |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 | // See https://llvm.org/LICENSE.txt for license information. |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef MLIR_LIB_CONVERSION_TOSATOLINALG_TOSATOLINALGUTILS_H |
| 11 | #define MLIR_LIB_CONVERSION_TOSATOLINALG_TOSATOLINALGUTILS_H |
| 12 | |
| 13 | #include "mlir/IR/BuiltinTypes.h" |
| 14 | #include "mlir/IR/Value.h" |
| 15 | |
| 16 | namespace mlir { |
| 17 | class PatternRewriter; |
| 18 | |
| 19 | namespace tosa { |
| 20 | struct MatMulTOperands { |
| 21 | Value a; |
| 22 | Value b; |
| 23 | Value init; |
| 24 | }; |
| 25 | |
| 26 | /// Broadcast the batch dimensions of the ranked operands and create a |
| 27 | /// zero-filled result tensor for either MATMUL_T lowering pattern. |
| 28 | MatMulTOperands prepareMatMulOperands(PatternRewriter &rewriter, Location loc, |
| 29 | Value a, Value b, |
| 30 | RankedTensorType outputType, |
| 31 | bool transposeB); |
| 32 | } // namespace tosa |
| 33 | } // namespace mlir |
| 34 | |
| 35 | #endif // MLIR_LIB_CONVERSION_TOSATOLINALG_TOSATOLINALGUTILS_H |
| 36 | |