|
MLIR 22.0.0git
|
Wrapper around the generic MlirType. More...
#include "Bindings/Python/IRModule.h"
Public Member Functions | |
| PyType (PyMlirContextRef contextRef, MlirType type) | |
| bool | operator== (const PyType &other) const |
| operator MlirType () const | |
| MlirType | get () const |
| nanobind::object | getCapsule () |
| Gets a capsule wrapping the void* within the MlirType. | |
| nanobind::object | maybeDownCast () |
| Public Member Functions inherited from mlir::python::BaseContextObject | |
| BaseContextObject (PyMlirContextRef ref) | |
| PyMlirContextRef & | getContext () |
| Accesses the context reference. | |
Static Public Member Functions | |
| static PyType | createFromCapsule (nanobind::object capsule) |
| Creates a PyType from the MlirType wrapped by a capsule. | |
Wrapper around the generic MlirType.
The lifetime of a type is bound by the PyContext that created it.
Definition at line 878 of file IRModule.h.
|
inline |
Definition at line 880 of file IRModule.h.
References mlir::python::BaseContextObject::BaseContextObject().
Referenced by mlir::python::PyConcreteType< DerivedTy, BaseTy >::bind(), mlir::PyShapedType::bindDerived(), mlir::python::PyConcreteType< DerivedTy, BaseTy >::castFrom(), createFromCapsule(), operator==(), and mlir::python::PyConcreteType< DerivedTy, BaseTy >::PyConcreteType().
|
static |
Creates a PyType from the MlirType wrapped by a capsule.
Note that PyType instances are uniqued, so the returned object may be a pre-existing object. Ownership of the underlying MlirType is taken by calling this function.
Definition at line 2077 of file IRCore.cpp.
References mlir::python::PyMlirContext::forContext(), mlirPythonCapsuleToType(), mlirTypeGetContext(), mlirTypeIsNull(), and PyType().
|
inline |
Definition at line 884 of file IRModule.h.
Referenced by maybeDownCast().
| nb::object PyType::getCapsule | ( | ) |
Gets a capsule wrapping the void* within the MlirType.
Definition at line 2073 of file IRCore.cpp.
References mlirPythonTypeToCapsule().
| nb::object PyType::maybeDownCast | ( | ) |
Definition at line 2085 of file IRCore.cpp.
References mlir::python::PyGlobals::get(), get(), mlir::python::PyGlobals::lookupTypeCaster(), mlirTypeGetDialect(), mlirTypeGetTypeID(), and mlirTypeIDIsNull().
Referenced by mlir::python::PyConcreteAttribute< DerivedTy, BaseTy >::bind(), and getValueTypes().
|
inline |
Definition at line 883 of file IRModule.h.
Definition at line 2069 of file IRCore.cpp.
References mlirTypeEqual(), and PyType().