-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mlir python] Port in-tree dialects to nanobind. (#119924)
This is a companion to #118583, although it can be landed independently because since #117922 dialects do not have to use the same Python binding framework as the Python core code. This PR ports all of the in-tree dialect and pass extensions to nanobind, with the exception of those that remain for testing pybind11 support. This PR also: * removes CollectDiagnosticsToStringScope from NanobindAdaptors.h. This was overlooked in a previous PR and it is duplicated in Diagnostics.h. --------- Co-authored-by: Jacques Pienaar <jpienaar@google.com>
- Loading branch information
Showing
35 changed files
with
357 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//===- Nanobind.h - Trampoline header with ignored warnings ---------------===// | ||
// | ||
// 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// This file is a trampoline for the nanobind headers while disabling warnings | ||
// reported by the LLVM/MLIR build. This file avoids adding complexity build | ||
// system side. | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef MLIR_BINDINGS_PYTHON_NANOBIND_H | ||
#define MLIR_BINDINGS_PYTHON_NANOBIND_H | ||
|
||
#if defined(__clang__) || defined(__GNUC__) | ||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wzero-length-array" | ||
#pragma GCC diagnostic ignored "-Wcast-qual" | ||
#pragma GCC diagnostic ignored "-Wnested-anon-types" | ||
#pragma GCC diagnostic ignored "-Wc++98-compat-extra-semi" | ||
#pragma GCC diagnostic ignored "-Wcovered-switch-default" | ||
#endif | ||
#include <nanobind/nanobind.h> | ||
#include <nanobind/ndarray.h> | ||
#include <nanobind/stl/function.h> | ||
#include <nanobind/stl/optional.h> | ||
#include <nanobind/stl/pair.h> | ||
#include <nanobind/stl/string.h> | ||
#include <nanobind/stl/string_view.h> | ||
#include <nanobind/stl/tuple.h> | ||
#include <nanobind/stl/vector.h> | ||
#if defined(__clang__) || defined(__GNUC__) | ||
#pragma GCC diagnostic pop | ||
#endif | ||
|
||
#endif // MLIR_BINDINGS_PYTHON_NANOBIND_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.