MLIR
20.0.0git
|
Functions | |
static py::object | mlirApiObjectToCapsule (py::handle apiObject) |
Helper to convert a presumed MLIR API object to a capsule, accepting either an explicit Capsule (which can happen when two C APIs are communicating directly via Python) or indirectly by querying the MLIR_PYTHON_CAPI_PTR_ATTR attribute (through which supported MLIR Python API objects export their contained API pointer as a capsule). More... | |
|
static |
Helper to convert a presumed MLIR API object to a capsule, accepting either an explicit Capsule (which can happen when two C APIs are communicating directly via Python) or indirectly by querying the MLIR_PYTHON_CAPI_PTR_ATTR attribute (through which supported MLIR Python API objects export their contained API pointer as a capsule).
Throws a type error if the object is neither. This is intended to be used from type casters, which are invoked with a raw handle (unowned). The returned object's lifetime may not extend beyond the apiObject handle without explicitly having its refcount increased (i.e. on return).
Definition at line 49 of file PybindAdaptors.h.
References MLIR_PYTHON_CAPI_PTR_ATTR.
Referenced by pybind11::detail::type_caster< MlirAffineMap >::load(), pybind11::detail::type_caster< MlirAttribute >::load(), pybind11::detail::type_caster< MlirBlock >::load(), pybind11::detail::type_caster< MlirContext >::load(), pybind11::detail::type_caster< MlirDialectRegistry >::load(), pybind11::detail::type_caster< MlirLocation >::load(), pybind11::detail::type_caster< MlirModule >::load(), pybind11::detail::type_caster< MlirFrozenRewritePatternSet >::load(), pybind11::detail::type_caster< MlirOperation >::load(), pybind11::detail::type_caster< MlirValue >::load(), pybind11::detail::type_caster< MlirPassManager >::load(), pybind11::detail::type_caster< MlirTypeID >::load(), and pybind11::detail::type_caster< MlirType >::load().