Skip to content

Commit 6dfd73a

Browse files
authored
[MLIR][Docs] Move back the "other functionality" section in bindings (#163129)
In the previous PR #163123 I made a mistake that unexpectedly moved the "other functionality" section from the "[Providing Python bindings for a dialect](https://mlir.llvm.org/docs/Bindings/Python/#providing-python-bindings-for-a-dialect)" section to the newly-added section ([Extending MLIR in Python](https://mlir.llvm.org/docs/Bindings/Python/#extending-mlir-in-python)). This PR is to fix it.
1 parent 14a42e6 commit 6dfd73a

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

mlir/docs/Bindings/Python.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,19 @@ which can be `import`ed from the main dialect file, i.e.
11881188
`python/mlir/dialects/<dialect-namespace>/passes.py` if it is undesirable to
11891189
make the passes available along with the dialect.
11901190

1191+
### Other functionality
1192+
1193+
Dialect functionality other than IR objects or passes, such as helper functions,
1194+
can be exposed to Python similarly to attributes and types. C API is expected to
1195+
exist for this functionality, which can then be wrapped using pybind11 and
1196+
[`include/mlir/Bindings/Python/PybindAdaptors.h`](https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Bindings/Python/PybindAdaptors.h),
1197+
or nanobind and
1198+
[`include/mlir/Bindings/Python/NanobindAdaptors.h`](https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Bindings/Python/NanobindAdaptors.h)
1199+
utilities to connect to the rest of Python API. The bindings can be located in a
1200+
separate module or in the same module as attributes and types, and
1201+
loaded along with the dialect.
1202+
1203+
11911204
## Extending MLIR in Python
11921205

11931206
The MLIR Python bindings provide support for defining custom components in Python,
@@ -1262,17 +1275,6 @@ This frozen set can then be applied to an operation
12621275
using the greedy rewrite pattern driver via `apply_patterns_and_fold_greedily`.
12631276
For further information, see [the PDL dialect documentation](/docs/Dialects/PDLOps/).
12641277

1265-
### Other functionality
1266-
1267-
Dialect functionality other than IR objects or passes, such as helper functions,
1268-
can be exposed to Python similarly to attributes and types. C API is expected to
1269-
exist for this functionality, which can then be wrapped using pybind11 and
1270-
[`include/mlir/Bindings/Python/PybindAdaptors.h`](https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Bindings/Python/PybindAdaptors.h),
1271-
or nanobind and
1272-
[`include/mlir/Bindings/Python/NanobindAdaptors.h`](https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Bindings/Python/NanobindAdaptors.h)
1273-
utilities to connect to the rest of Python API. The bindings can be located in a
1274-
separate module or in the same module as attributes and types, and
1275-
loaded along with the dialect.
12761278

12771279
## Free-threading (No-GIL) support
12781280

0 commit comments

Comments
 (0)