MLIR 22.0.0git
mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRegionList Class Reference

Regions of an op are fixed length and indexed numerically so are represented with a sequence-like container. More...

#include "mlir/Bindings/Python/IRCore.h"

Inheritance diagram for mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRegionList:

Public Member Functions

 PyRegionList (PyOperationRef operation, intptr_t startIndex=0, intptr_t length=-1, intptr_t step=1)
PyRegionIterator dunderIter ()
Public Member Functions inherited from mlir::Sliceable< PyRegionList, PyRegion >
 Sliceable (intptr_t startIndex, intptr_t length, intptr_t step)
PyRegion getElement (intptr_t index)
 Returns the index-th element in the slice, supports negative indices.
intptr_t size ()
 Returns the size of slice.
std::vector< PyRegion > dunderAdd (PyRegionList &other)
 Returns a new vector (mapped to Python list) containing elements from two slices.

Static Public Member Functions

static void bindDerived (ClassTy &c)
Static Public Member Functions inherited from mlir::Sliceable< PyRegionList, PyRegion >
static void bind (nanobind::module_ &m)
 Binds the indexing and length methods in the Python class.
static void bindDerived (ClassTy &)
 Hook for derived classes willing to bind more methods.

Static Public Attributes

static constexpr const char * pyClassName = "RegionSequence"

Friends

class Sliceable< PyRegionList, PyRegion >
 Give the parent CRTP class access to hook implementations below.

Additional Inherited Members

Public Attributes inherited from mlir::Sliceable< PyRegionList, PyRegion >
intptr_t startIndex
intptr_t length
intptr_t step
Protected Types inherited from mlir::Sliceable< PyRegionList, PyRegion >
using ClassTy
using has_maybe_downcast
 Trait to check if T provides a maybeDownCast method.
Protected Member Functions inherited from mlir::Sliceable< PyRegionList, PyRegion >
intptr_t wrapIndex (intptr_t index)
 Transforms index into a legal value to access the underlying sequence.
intptr_t linearizeIndex (intptr_t index)
 Computes the linear index given the current slice properties.
nanobind::object getItem (intptr_t index)
 Returns the element at the given slice index.
nanobind::object getItemSlice (PyObject *slice)
 Returns a new instance of the pseudo-container restricted to the given slice.

Detailed Description

Regions of an op are fixed length and indexed numerically so are represented with a sequence-like container.

Definition at line 1388 of file IRCore.h.

Constructor & Destructor Documentation

◆ PyRegionList()

Member Function Documentation

◆ bindDerived()

void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRegionList::bindDerived ( ClassTy & c)
static

Definition at line 227 of file IRCore.cpp.

References dunderIter().

Referenced by Sliceable< PyRegionList, PyRegion >.

◆ dunderIter()

PyRegionIterator mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRegionList::dunderIter ( )

Definition at line 222 of file IRCore.cpp.

References mlir::Sliceable< PyRegionList, PyRegion >::startIndex.

Referenced by bindDerived().

◆ Sliceable< PyRegionList, PyRegion >

Member Data Documentation

◆ pyClassName

const char* mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRegionList::pyClassName = "RegionSequence"
staticconstexpr

Definition at line 1391 of file IRCore.h.


The documentation for this class was generated from the following files: