1//===- LinalgTransformOps.h - Linalg transform ops --------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef MLIR_DIALECT_LINALG_TRANSFORMOPS_LINALGTRANSFORMOPS_H
10#define MLIR_DIALECT_LINALG_TRANSFORMOPS_LINALGTRANSFORMOPS_H
11
12#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
13#include "mlir/Dialect/Func/IR/FuncOps.h"
14#include "mlir/Dialect/Linalg/IR/Linalg.h"
15#include "mlir/Dialect/Transform/IR/TransformAttrs.h"
16#include "mlir/Dialect/Transform/IR/TransformDialect.h"
17#include "mlir/Dialect/Transform/IR/TransformTypes.h"
18#include "mlir/Dialect/Transform/Interfaces/TransformInterfaces.h"
19#include "mlir/Dialect/Utils/StructuredOpsUtils.h"
20#include "mlir/IR/OpImplementation.h"
21#include "mlir/IR/RegionKindInterface.h"
22
23namespace mlir {
24class TilingInterface;
25class RewriterBase;
26
27namespace linalg {
28class CopyOp;
29struct ForallTilingResult;
30class GenericOp;
31class LinalgOp;
32} // namespace linalg
33
34namespace scf {
35struct SCFTilingResult;
36} // namespace scf
37
38namespace tensor {
39class InsertSliceOp;
40class PackOp;
41class PadOp;
42class UnPackOp;
43} // namespace tensor
44
45namespace transform {
46// Types needed for builders.
47struct TileSizesSpec {};
48struct NumThreadsSpec {};
49} // namespace transform
50} // namespace mlir
51
52namespace mlir {
53class DialectRegistry;
54
55namespace transform {
56
57/// Implementation of tiling operations using `scf.forall`.
58DiagnosedSilenceableFailure
59tileToForallOpImpl(RewriterBase &rewriter, transform::TransformState &state,
60 TransformOpInterface transformOp, Operation *target,
61 ArrayRef<OpFoldResult> mixedNumThreads,
62 ArrayRef<OpFoldResult> mixedTileSizes,
63 std::optional<ArrayAttr> mapping,
64 scf::SCFTilingResult &tilingResult);
65
66} // namespace transform
67} // namespace mlir
68
69//===----------------------------------------------------------------------===//
70// Linalg Transform Operations
71//===----------------------------------------------------------------------===//
72
73#include "mlir/Dialect/Linalg/TransformOps/LinalgTransformOpsEnums.h.inc"
74
75#define GET_OP_CLASSES
76#include "mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.h.inc"
77
78#endif // MLIR_DIALECT_LINALG_TRANSFORMOPS_LINALGTRANSFORMOPS_H
79