MLIR
22.0.0git
|
Wrapper around the generic MlirValue. More...
#include "Bindings/Python/IRModule.h"
Public Member Functions | |
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. More... | |
nanobind::object | maybeDownCast () |
Static Public Member Functions | |
static PyValue | createFromCapsule (nanobind::object capsule) |
Creates a PyValue from the MlirValue wrapped by a capsule. More... | |
Wrapper around the generic MlirValue.
Values are managed completely by the operation that resulted in their definition. For op result value, this is the operation that defines the value. For block argument values, this is the operation that contains the block to which the value is an argument (blocks cannot be detached in Python bindings so such operation always exists).
Definition at line 1122 of file IRModule.h.
|
virtualdefault |
|
inline |
Definition at line 1128 of file IRModule.h.
Referenced by createFromCapsule().
|
inline |
Definition at line 1135 of file IRModule.h.
References mlir::python::PyOperation::checkValid().
|
static |
Creates a PyValue from the MlirValue wrapped by a capsule.
Ownership of the underlying MlirValue is still tied to the owning operation.
Definition at line 2179 of file IRCore.cpp.
References mlir::python::PyMlirContext::forContext(), mlir::python::PyOperation::forOperation(), mlirBlockArgumentGetOwner(), mlirBlockGetParentOperation(), mlirOperationGetContext(), mlirOperationIsNull(), mlirOpResultGetOwner(), mlirPythonCapsuleToValue(), mlirValueIsABlockArgument(), mlirValueIsAOpResult(), mlirValueIsNull(), and PyValue().
|
inline |
Definition at line 1132 of file IRModule.h.
Referenced by getCapsule(), getOpResultOrValue(), and maybeDownCast().
nb::object PyValue::getCapsule | ( | ) |
Gets a capsule wrapping the void* within the MlirValue.
Definition at line 2160 of file IRCore.cpp.
References get(), and mlirPythonValueToCapsule().
|
inline |
Definition at line 1133 of file IRModule.h.
nb::object PyValue::maybeDownCast | ( | ) |
Definition at line 2164 of file IRCore.cpp.
References mlir::python::PyGlobals::get(), get(), mlir::python::PyGlobals::lookupValueCaster(), mlirTypeGetDialect(), mlirTypeGetTypeID(), mlirTypeIDIsNull(), and mlirValueGetType().
|
inline |
Definition at line 1130 of file IRModule.h.