diff options
| author | Peter Hawkins <phawkins@google.com> | 2024-12-03 12:13:34 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-03 09:13:34 -0800 |
| commit | afe75b4d5fcebd6fdd292ca1797de1b35cb687b0 (patch) | |
| tree | 9ff18f95f74c87c8fa9f3ed4d90c013731648136 /lldb/test/API/python_api/sbstructureddata | |
| parent | 5ae613c9b9dc37ec1b0a6d76714099375288d772 (diff) | |
| download | llvm-afe75b4d5fcebd6fdd292ca1797de1b35cb687b0.zip llvm-afe75b4d5fcebd6fdd292ca1797de1b35cb687b0.tar.gz llvm-afe75b4d5fcebd6fdd292ca1797de1b35cb687b0.tar.bz2 | |
[mlir python] Add nanobind support for standalone dialects. (#117922)
This PR allows out-of-tree dialects to write Python dialect modules
using nanobind instead of pybind11.
It may make sense to migrate in-tree dialects and some of the ODS Python
infrastructure to nanobind, but that is a topic for a future change.
This PR makes the following changes:
* adds nanobind to the CMake and Bazel build systems. We also add
robin_map to the Bazel build, which is a dependency of nanobind.
* adds a PYTHON_BINDING_LIBRARY option to various CMake functions, such
as declare_mlir_python_extension, allowing users to select a Python
binding library.
* creates a fork of mlir/include/mlir/Bindings/Python/PybindAdaptors.h
named NanobindAdaptors.h. This plays the same role, using nanobind
instead of pybind11.
* splits CollectDiagnosticsToStringScope out of PybindAdaptors.h and
into a new header mlir/include/mlir/Bindings/Python/Diagnostics.h, since
it is code that is no way related to pybind11 or for that matter,
Python.
* changed the standalone Python extension example to have both pybind11
and nanobind variants.
* changed mlir/python/mlir/dialects/python_test.py to have both pybind11
and nanobind variants.
Notes:
* A slightly unfortunate thing that I needed to do in the CMake
integration was to use FindPython in addition to FindPython3, since
nanobind's CMake integration expects the Python_ names for variables.
Perhaps there's a better way to do this.
Diffstat (limited to 'lldb/test/API/python_api/sbstructureddata')
0 files changed, 0 insertions, 0 deletions
