File tree Expand file tree Collapse file tree 11 files changed +165
-0
lines changed
mlir/dialects/async_dialect
test/Bindings/Python/dialects Expand file tree Collapse file tree 11 files changed +165
-0
lines changed Original file line number Diff line number Diff line change
1
+ //===-- mlir-c/Dialect/Async.h - C API for Async 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_ASYNC_H
11
+ #define MLIR_C_DIALECT_ASYNC_H
12
+
13
+ #include "mlir-c/Registration.h"
14
+ #include "mlir-c/Support.h"
15
+
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif
19
+
20
+ MLIR_DECLARE_CAPI_DIALECT_REGISTRATION (Async , async );
21
+
22
+ #ifdef __cplusplus
23
+ }
24
+ #endif
25
+
26
+ #include "mlir/Dialect/Async/Passes.capi.h.inc"
27
+
28
+ #endif // MLIR_C_DIALECT_ASYNC_H
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ add_subdirectory(IR)
2
2
3
3
set (LLVM_TARGET_DEFINITIONS Passes.td )
4
4
mlir_tablegen (Passes.h.inc -gen-pass-decls -name Async )
5
+ mlir_tablegen (Passes.capi.h.inc -gen-pass-capi-header --prefix Async )
6
+ mlir_tablegen (Passes.capi.cpp.inc -gen-pass-capi-impl --prefix Async )
5
7
add_public_tablegen_target (MLIRAsyncPassIncGen )
6
8
7
9
add_mlir_doc (Passes AsyncPasses ./ -gen-pass-doc )
Original file line number Diff line number Diff line change
1
+ //===-- AsyncOps.td - Entry point async_dialect bindings --*- tablegen -*-===//
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 PYTHON_BINDINGS_ASYNC_OPS
10
+ #define PYTHON_BINDINGS_ASYNC_OPS
11
+
12
+ include "mlir/Bindings/Python/Attributes.td"
13
+ include "mlir/Dialect/Async/IR/AsyncOps.td"
14
+
15
+ #endif
Original file line number Diff line number Diff line change
1
+ // ===- AsyncPasses.cpp - Pybind module for the Async passes -------------===//
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
+ #include " mlir-c/Dialect/Async.h"
10
+
11
+ #include < pybind11/pybind11.h>
12
+
13
+ // -----------------------------------------------------------------------------
14
+ // Module initialization.
15
+ // -----------------------------------------------------------------------------
16
+
17
+ PYBIND11_MODULE (_mlirAsyncPasses, m) {
18
+ m.doc () = " MLIR Async Dialect Passes" ;
19
+
20
+ // Register all Async passes on load.
21
+ mlirRegisterAsyncPasses ();
22
+ }
Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ endforeach()
31
31
# Generate dialect-specific bindings.
32
32
################################################################################
33
33
34
+ add_mlir_dialect_python_bindings (MLIRBindingsPythonAsyncOps
35
+ TD_FILE AsyncOps.td
36
+ DIALECT_NAME async_dialect )
37
+ add_dependencies (MLIRBindingsPythonSources MLIRBindingsPythonAsyncOps )
38
+
34
39
add_mlir_dialect_python_bindings (MLIRBindingsPythonBuiltinOps
35
40
TD_FILE BuiltinOps.td
36
41
DIALECT_NAME builtin )
@@ -120,6 +125,14 @@ endif()
120
125
add_subdirectory (Transforms )
121
126
add_subdirectory (Conversions )
122
127
128
+ add_mlir_python_extension (MLIRAsyncPassesBindingsPythonExtension _mlirAsyncPasses
129
+ INSTALL_DIR
130
+ python
131
+ SOURCES
132
+ AsyncPasses.cpp
133
+ )
134
+ add_dependencies (MLIRBindingsPythonExtension MLIRAsyncPassesBindingsPythonExtension )
135
+
123
136
add_mlir_python_extension (MLIRLinalgPassesBindingsPythonExtension _mlirLinalgPasses
124
137
INSTALL_DIR
125
138
python
Original file line number Diff line number Diff line change
1
+ # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2
+ # See https://llvm.org/LICENSE.txt for license information.
3
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
+
5
+ from .._async_dialect_ops_gen import *
Original file line number Diff line number Diff line change
1
+ # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2
+ # See https://llvm.org/LICENSE.txt for license information.
3
+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
+
5
+ from ...._cext_loader import _load_extension
6
+ _cextAsyncPasses = _load_extension ("_mlirAsyncPasses" )
Original file line number Diff line number Diff line change
1
+ // ===- Async.cpp - C Interface for Async dialect --------------------------===//
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
+ #include " mlir/Dialect/Async/IR/Async.h"
10
+ #include " mlir-c/Dialect/Async.h"
11
+ #include " mlir/CAPI/Registration.h"
12
+
13
+ MLIR_DEFINE_CAPI_DIALECT_REGISTRATION (Async, async, mlir::async::AsyncDialect)
Original file line number Diff line number Diff line change
1
+ // ===- AsyncPasses.cpp - C API for Async Dialect Passes -----------------===//
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
+ #include " mlir/CAPI/Pass.h"
10
+ #include " mlir/Dialect/Async/Passes.h"
11
+ #include " mlir/Pass/Pass.h"
12
+
13
+ // Must include the declarations as they carry important visibility attributes.
14
+ #include " mlir/Dialect/Async/Passes.capi.h.inc"
15
+
16
+ using namespace mlir ;
17
+
18
+ #ifdef __cplusplus
19
+ extern " C" {
20
+ #endif
21
+
22
+ #include " mlir/Dialect/Async/Passes.capi.cpp.inc"
23
+
24
+ #ifdef __cplusplus
25
+ }
26
+ #endif
Original file line number Diff line number Diff line change 1
1
# TODO: Make the check source feature optional as an argument on *_add_library.
2
2
set (LLVM_OPTIONAL_SOURCES
3
+ Async.cpp
4
+ AsyncPasses.cpp
3
5
Linalg.cpp
4
6
LinalgPasses.cpp
5
7
SCF.cpp
@@ -8,6 +10,20 @@ set(LLVM_OPTIONAL_SOURCES
8
10
Tensor.cpp
9
11
)
10
12
13
+ add_mlir_public_c_api_library (MLIRCAPIAsync
14
+ Async.cpp
15
+ AsyncPasses.cpp
16
+
17
+ DEPENDS
18
+ MLIRAsyncPassIncGen
19
+
20
+ LINK_LIBS PUBLIC
21
+ MLIRCAPIIR
22
+ MLIRAsync
23
+ MLIRAsyncTransforms
24
+ MLIRPass
25
+ )
26
+
11
27
add_mlir_public_c_api_library (MLIRCAPILinalg
12
28
Linalg.cpp
13
29
LinalgPasses.cpp
You can’t perform that action at this time.
0 commit comments