|
MLIR 22.0.0git
|
CRTP base class for Python MLIR values that subclass Value and should be castable from it. More...
#include "mlir/Bindings/Python/IRCore.h"
Public Types | |
| using | ClassTy = nanobind::class_<DerivedTy, PyValue> |
| using | IsAFunctionTy = bool (*)(MlirValue) |
| using | GetTypeIDFunctionTy = MlirTypeID (*)() |
| using | Base = PyConcreteValue |
Public Member Functions | |
| PyConcreteValue ()=default | |
| PyConcreteValue (PyOperationRef operationRef, MlirValue value) | |
| PyConcreteValue (PyValue &orig) | |
| Public Member Functions inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue | |
| virtual | ~PyValue ()=default |
| PyValue (PyOperationRef parentOperation, MlirValue value) | |
| operator MlirValue () const | |
| MlirValue | get () |
| PyOperationRef & | getParentOperation () |
| void | checkValid () |
| nanobind::object | getCapsule () |
| Gets a capsule wrapping the void* within the MlirValue. | |
| nanobind::typed< nanobind::object, PyValue > | maybeDownCast () |
Static Public Member Functions | |
| static MlirValue | castFrom (PyValue &orig) |
| Attempts to cast the original value to the derived type and throws on type mismatches. | |
| static void | bind (nanobind::module_ &m) |
| Binds the Python module objects to functions of this class. | |
| static void | bindDerived (ClassTy &m) |
| Implemented by derived classes to add methods to the Python subclass. | |
| Static Public Member Functions inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue | |
| static PyValue | createFromCapsule (nanobind::object capsule) |
| Creates a PyValue from the MlirValue wrapped by a capsule. | |
Static Public Attributes | |
| static constexpr GetTypeIDFunctionTy | getTypeIdFunction = nullptr |
CRTP base class for Python MLIR values that subclass Value and should be castable from it.
The value hierarchy is one level deep and is not supposed to accommodate other levels unless core MLIR changes.
| using mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteValue< DerivedTy >::Base = PyConcreteValue |
| using mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteValue< DerivedTy >::ClassTy = nanobind::class_<DerivedTy, PyValue> |
| using mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteValue< DerivedTy >::GetTypeIDFunctionTy = MlirTypeID (*)() |
| using mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteValue< DerivedTy >::IsAFunctionTy = bool (*)(MlirValue) |
|
default |
Referenced by PyConcreteValue().
|
inline |
Definition at line 1536 of file IRCore.h.
References mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue::PyValue().
|
inline |
Definition at line 1538 of file IRCore.h.
References castFrom(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue::getParentOperation(), PyConcreteValue(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue::PyValue().
|
inlinestatic |
Binds the Python module objects to functions of this class.
Definition at line 1557 of file IRCore.h.
References mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyGlobals::get(), MLIR_PYTHON_MAYBE_DOWNCAST_ATTR, and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue::PyValue().
|
inlinestatic |
|
inlinestatic |
Attempts to cast the original value to the derived type and throws on type mismatches.
Definition at line 1543 of file IRCore.h.
References mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue::get(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyValue::PyValue().
Referenced by PyConcreteValue().
|
staticconstexpr |