summaryrefslogtreecommitdiff
path: root/mlir/test/python/lib/PythonTestDialect.h
AgeCommit message (Collapse)Author
2024-07-05[mlir][python] auto attribute casting (#97786)Maksim Levental
2023-08-28[MLIR] Switch the default for usePropertiesForAttributes (NFC)Mehdi Amini
This is adopting properties as storage for attribute by default. Reviewed By: springerm Differential Revision: https://reviews.llvm.org/D158581
2023-08-27Revert "[MLIR] Switch the default for usePropertiesForAttributes (NFC)"Mehdi Amini
This reverts commit ef3ab3de9787f55b05620e56853909d758b9eb9d. The revision hasn't actually been approved yet!
2023-08-27[MLIR] Switch the default for usePropertiesForAttributes (NFC)Mehdi Amini
This is adopting properties as storage for attribute by default.
2022-01-19[mlir] Rework subclass construction in PybindAdaptors.hAlex Zinenko
The constructor function was being defined without indicating its "__init__" name, which made it interpret it as a regular fuction rather than a constructor. When overload resolution failed, Pybind would attempt to print the arguments actually passed to the function, including "self", which is not initialized since the constructor couldn't be called. This would result in "__repr__" being called with "self" referencing an uninitialized MLIR C API object, which in turn would cause undefined behavior when attempting to print in C++. Even if the correct name is provided, the mechanism used by PybindAdaptors.h to bind constructors directly as "__init__" functions taking "self" is deprecated by Pybind. The new mechanism does not seem to have access to a fully-constructed "self" object (i.e., the constructor in C++ takes a `pybind11::detail::value_and_holder` that cannot be forwarded back to Python). Instead, redefine "__new__" to perform the required checks (there are no additional initialization needed for attributes and types as they are all wrappers around a C++ pointer). "__new__" can call its equivalent on a superclass without needing "self". Bump pybind11 dependency to 3.8.0, which is the first version that allows one to redefine "__new__". Reviewed By: stellaraccident Differential Revision: https://reviews.llvm.org/D117646
2021-10-25[mlir] support interfaces in Python bindingsAlex Zinenko
Introduce the initial support for operation interfaces in C API and Python bindings. Interfaces are a key component of MLIR's extensibility and should be available in bindings to make use of full potential of MLIR. This initial implementation exposes InferTypeOpInterface all the way to the Python bindings since it can be later used to simplify the operation construction methods by inferring their return types instead of requiring the user to do so. The general infrastructure for binding interfaces is defined and InferTypeOpInterface can be used as an example for binding other interfaces. Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D111656