|
MLIR 23.0.0git
|
Wrapper around the generic MlirType. More...
#include "mlir/Bindings/Python/IRCore.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::typed< nanobind::object, PyType > | maybeDownCast () |
| Public Member Functions inherited from mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::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.
|
inline |
Definition at line 877 of file IRCore.h.
References mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::BaseContextObject::BaseContextObject().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteType< DerivedTy, BaseTy >::bind(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::amdgpu::TDMBaseType::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::amdgpu::TDMGatherBaseType::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::llvm::ArrayType::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::nvgpu::TensorMapDescriptorType::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::pdl::RangeType::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyComplexType::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyShapedType::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyTupleType::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::quant::QuantizedType::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::transform::ParamType::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteType< DerivedTy, BaseTy >::castFrom(), getCapsule(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::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 1934 of file IRCore.cpp.
References mlirPythonTypeToCapsule().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().
|
inline |
Definition at line 881 of file IRCore.h.
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRankedTensorType::bindDerived(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyTypeAttribute::bindDerived().
| nb::object mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyType::getCapsule | ( | ) |
Gets a capsule wrapping the void* within the MlirType.
Definition at line 1930 of file IRCore.cpp.
References mlirTypeEqual(), and PyType().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().
| nb::typed< nb::object, PyType > mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyType::maybeDownCast | ( | ) |
Definition at line 1942 of file IRCore.cpp.
References mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyMlirContext::forContext().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteAttribute< DerivedTy, BaseTy >::bind(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyTypeAttribute::bindDerived(), mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyTypeConverter::convertType(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().
|
inline |
Definition at line 1926 of file IRCore.cpp.