summaryrefslogtreecommitdiff
path: root/mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.h
blob: 797c6945c3cbfff63618f9f31a863b735679d3fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//===- LinalgTransformOps.h - Linalg transform ops --------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef MLIR_DIALECT_LINALG_TRANSFORMOPS_LINALGTRANSFORMOPS_H
#define MLIR_DIALECT_LINALG_TRANSFORMOPS_LINALGTRANSFORMOPS_H

#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Transform/IR/TransformAttrs.h"
#include "mlir/Dialect/Transform/IR/TransformDialect.h"
#include "mlir/Dialect/Transform/IR/TransformInterfaces.h"
#include "mlir/Dialect/Utils/StructuredOpsUtils.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/RegionKindInterface.h"

namespace mlir {
class TilingInterface;
class RewriterBase;

namespace linalg {
struct ForallTilingResult;
class GenericOp;
class LinalgOp;
} // namespace linalg

namespace tensor {
class InsertSliceOp;
class PackOp;
class PadOp;
class UnPackOp;
} // namespace tensor

namespace transform {
class TransformHandleTypeInterface;
// Types needed for builders.
struct TileSizesSpec {};
struct NumThreadsSpec {};
} // namespace transform
} // namespace mlir

namespace mlir {
class DialectRegistry;

namespace transform {

/// Implementation of tiling operations using `scf.forall`.
DiagnosedSilenceableFailure
tileToForallOpImpl(RewriterBase &rewriter, transform::TransformState &state,
                   TransformOpInterface transformOp, Operation *target,
                   ArrayRef<OpFoldResult> mixedNumThreads,
                   ArrayRef<OpFoldResult> mixedTileSizes,
                   std::optional<ArrayAttr> mapping,
                   linalg::ForallTilingResult &tilingResult);

} // namespace transform
} // namespace mlir

//===----------------------------------------------------------------------===//
// Linalg Transform Operations
//===----------------------------------------------------------------------===//

#include "mlir/Dialect/Linalg/TransformOps/LinalgTransformOpsEnums.h.inc"

#define GET_OP_CLASSES
#include "mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.h.inc"

#endif // MLIR_DIALECT_LINALG_TRANSFORMOPS_LINALGTRANSFORMOPS_H