1 | //===-- mlir-c/Dialect/Linalg.h - C API for Linalg dialect -------*- C -*-===// |
---|---|
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM |
4 | // 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_C_DIALECT_LINALG_H |
11 | #define MLIR_C_DIALECT_LINALG_H |
12 | |
13 | #include "mlir-c/IR.h" |
14 | #include "mlir-c/Support.h" |
15 | |
16 | #ifdef __cplusplus |
17 | extern "C"{ |
18 | #endif |
19 | |
20 | /// Apply the special region builder for the builtin named Linalg op. |
21 | /// Assert that `mlirOp` is a builtin named Linalg op. |
22 | MLIR_CAPI_EXPORTED void |
23 | mlirLinalgFillBuiltinNamedOpRegion(MlirOperation mlirOp); |
24 | |
25 | MLIR_CAPI_EXPORTED bool mlirLinalgIsAContractionOp(MlirOperation op); |
26 | |
27 | typedef struct MlirLinalgContractionDimensions { |
28 | MlirAttribute batch; |
29 | MlirAttribute m; |
30 | MlirAttribute n; |
31 | MlirAttribute k; |
32 | } MlirLinalgContractionDimensions; |
33 | |
34 | MLIR_CAPI_EXPORTED MlirLinalgContractionDimensions |
35 | mlirLinalgInferContractionDimensions(MlirOperation op); |
36 | |
37 | MLIR_CAPI_EXPORTED bool mlirLinalgIsAConvolutionOp(MlirOperation op); |
38 | |
39 | typedef struct MlirLinalgConvolutionDimensions { |
40 | MlirAttribute batch; |
41 | MlirAttribute outputImage; |
42 | MlirAttribute outputChannel; |
43 | MlirAttribute filterLoop; |
44 | MlirAttribute inputChannel; |
45 | MlirAttribute depth; |
46 | MlirAttribute strides; |
47 | MlirAttribute dilations; |
48 | } MlirLinalgConvolutionDimensions; |
49 | |
50 | MLIR_CAPI_EXPORTED MlirLinalgConvolutionDimensions |
51 | mlirLinalgInferConvolutionDimensions(MlirOperation op); |
52 | |
53 | MLIR_CAPI_EXPORTED MlirAttribute |
54 | mlirLinalgGetIndexingMapsAttribute(MlirOperation op); |
55 | |
56 | MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Linalg, linalg); |
57 | |
58 | #ifdef __cplusplus |
59 | } |
60 | #endif |
61 | |
62 | #include "mlir/Dialect/Linalg/Passes.capi.h.inc" |
63 | |
64 | #endif // MLIR_C_DIALECT_LINALG_H |
65 |