MLIR  21.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
PyOpResultList Class Reference

A list of operation results. More...

+ Inheritance diagram for PyOpResultList:

Public Types

using SliceableT = Sliceable< PyOpResultList, PyOpResult >
 

Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

static constexpr const char * pyClassName = "OpResultList"
 

Friends

class Sliceable< PyOpResultList, PyOpResult >
 Give the parent CRTP class access to hook implementations below. More...
 

Additional Inherited Members

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

Detailed Description

A list of operation results.

Internally, these are stored as consecutive elements, random access is cheap. The (returned) result list is associated with the operation whose results these are, and thus extends the lifetime of this operation.

Definition at line 1739 of file IRCore.cpp.

Member Typedef Documentation

◆ SliceableT

Definition at line 1742 of file IRCore.cpp.

Constructor & Destructor Documentation

◆ PyOpResultList()

PyOpResultList::PyOpResultList ( PyOperationRef  operation,
intptr_t  startIndex = 0,
intptr_t  length = -1,
intptr_t  step = 1 
)
inline

Definition at line 1744 of file IRCore.cpp.

Member Function Documentation

◆ bindDerived()

static void PyOpResultList::bindDerived ( ClassTy c)
inlinestatic

Definition at line 1752 of file IRCore.cpp.

References mlir::python::BaseContextObject::getContext(), and getValueTypes().

◆ getOperation()

PyOperationRef& PyOpResultList::getOperation ( )
inline

Definition at line 1761 of file IRCore.cpp.

Referenced by getOpResultOrValue().

Friends And Related Function Documentation

◆ Sliceable< PyOpResultList, PyOpResult >

Give the parent CRTP class access to hook implementations below.

Definition at line 1761 of file IRCore.cpp.

Member Data Documentation

◆ pyClassName

constexpr const char* PyOpResultList::pyClassName = "OpResultList"
staticconstexpr

Definition at line 1741 of file IRCore.cpp.


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