IRON  1.0
Public Member Functions | Private Attributes | List of all members
iron.dataflow.objectfifo.ObjectFifoHandle Class Reference
Inheritance diagram for iron.dataflow.objectfifo.ObjectFifoHandle:
Inheritance graph
[legend]
Collaboration diagram for iron.dataflow.objectfifo.ObjectFifoHandle:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, ObjectFifo of, bool is_prod, int|None depth=None, list[Sequence[int]]|None dims_from_stream=None)
 
list acquire (self, int num_elem)
 
None release (self, int num_elem)
 
str name (self)
 
ObjectFifoCreateOp op (self)
 
type[np.ndarray] obj_type (self)
 
Sequence[int] shape (self)
 
np.dtype dtype (self)
 
str handle_type (self)
 
int depth (self)
 
list[Sequence[int]] dims_from_stream (self)
 
ObjectFifoEndpoint|None endpoint (self)
 
str __str__ (self)
 
None endpoint (self, ObjectFifoEndpoint endpoint)
 
list[ObjectFifoEndpointall_of_endpoints (self)
 
list[ObjectFifojoin (self, list[int] offsets, PlacementTile placement=AnyMemTile, list[int]|None depths=None, list[type[np.ndarray]] obj_types=None, list[str]|None names=None, list[list[Sequence[int]|None]]|None dims_to_stream=None, list[list[Sequence[int]|None]]|None dims_from_stream=None, bool plio=False)
 
list[ObjectFifosplit (self, list[int] offsets, PlacementTile placement=AnyMemTile, list[int]|None depths=None, list[type[np.ndarray]] obj_types=None, list[str]|None names=None, list[list[Sequence[int]]]|None dims_to_stream=None, list[list[Sequence[int]]]|None dims_from_stream=None, bool plio=False)
 
ObjectFifo forward (self, PlacementTile placement=AnyMemTile, type[np.ndarray]|None obj_type=None, int|None depth=None, str|None name=None, list[Sequence[int]]|None dims_to_stream=None, list[Sequence[int]]|None dims_from_stream=None, bool plio=False)
 
None resolve (self, ir.Location|None loc=None, ir.InsertionPoint|None ip=None)
 

Private Attributes

 _is_prod
 
 _object_fifo
 
 _depth
 
 _endpoint
 
 _dims_from_stream
 

Detailed Description

This class represents a handle to an ObjectFifo. A handle may be of type Producer or type Consumer.

Constructor & Destructor Documentation

◆ __init__()

def iron.dataflow.objectfifo.ObjectFifoHandle.__init__ (   self,
ObjectFifo  of,
bool  is_prod,
int | None   depth = None,
list[Sequence[int]] | None   dims_from_stream = None 
)
Construct an ObjectFifoHandle

Args:
    of (ObjectFifo): The ObjectFifo to construct the handle for.
    is_prod (bool): Whether the handle should be producer or consumer handle.
    depth (int | None, optional): The depth of the ObjectFifo at this endpoint. Defaults to None.
    dims_from_stream (list[Sequence[int]] | None, optional): A unique dimensions from stream. This is only valid for consumer handles. Defaults to None.

Raises:
    ValueError: Arguments are validated.

Member Function Documentation

◆ __str__()

str iron.dataflow.objectfifo.ObjectFifoHandle.__str__ (   self)

◆ acquire()

list iron.dataflow.objectfifo.ObjectFifoHandle.acquire (   self,
int  num_elem 
)
Acquire access to some elements of the ObjectFifo using ObjectFifo synchronization to moderate access.

Args:
    num_elem (int): Number of elements to acquire. If some elements are already acquired, it will only require the additional elements needed
    to acquire a total of num_elem.

Raises:
    ValueError: Number of elements cannot exceed ObjectFifo depth.

Returns:
    list: A indexable handle to the acquired elements.

◆ all_of_endpoints()

list[ObjectFifoEndpoint] iron.dataflow.objectfifo.ObjectFifoHandle.all_of_endpoints (   self)
All endpoints belonging to an ObjectFifo

◆ depth()

int iron.dataflow.objectfifo.ObjectFifoHandle.depth (   self)
The depth of this ObjectFifoHandle

◆ dims_from_stream()

list[Sequence[int]] iron.dataflow.objectfifo.ObjectFifoHandle.dims_from_stream (   self)
The dimensions from stream of a consumer ObjectFifoHandle

◆ dtype()

np.dtype iron.dataflow.objectfifo.ObjectFifoHandle.dtype (   self)
The per-element datatype of the ObjectFifo

◆ endpoint() [1/2]

ObjectFifoEndpoint | None iron.dataflow.objectfifo.ObjectFifoHandle.endpoint (   self)
The endpoint of this ObjectFifoHandle

◆ endpoint() [2/2]

None iron.dataflow.objectfifo.ObjectFifoHandle.endpoint (   self,
ObjectFifoEndpoint  endpoint 
)

◆ forward()

ObjectFifo iron.dataflow.objectfifo.ObjectFifoHandle.forward (   self,
PlacementTile   placement = AnyMemTile,
type[np.ndarray] | None   obj_type = None,
int | None   depth = None,
str | None   name = None,
list[Sequence[int]] | None   dims_to_stream = None,
list[Sequence[int]] | None   dims_from_stream = None,
bool   plio = False 
)
This is a special case of the split() operation where an ObjectFifoHandle of type consumer
is forwarded to the producer of a newly-constructed ObjectFifo.

Args:
    placement (PlacementTile, optional): The placement of the Forward operation. Defaults to AnyMemTile.
    obj_type (type[np.ndarray] | None, optional): The object type of the new ObjectFifo. Defaults to None.
    depth (int | None, optional): The depth of the new ObjectFifo. Defaults to None.
    name (str | None, optional): The name of the new ObjectFifo. If None is given, a unique name will be generated. Defaults to None.
    dims_to_stream (list[Sequence[int]] | None, optional): The dimensions to stream for the new ObjectFifo. Defaults to None.
    dims_from_stream (list[Sequence[int]] | None, optional): The dimensions from stream for the new ObjectFifo. Defaults to None.
    plio (bool, optional): Set plio on each new ObjectFifo. Defaults to False.

Raises:
    ValueError: Arguments are Validated

Returns:
    ObjectFifo: A newly constructed ObjectFifo whose producer used in this forward() operation.

◆ handle_type()

str iron.dataflow.objectfifo.ObjectFifoHandle.handle_type (   self)
A string referencing the type of this ObjectFifoHandle.

◆ join()

list[ObjectFifo] iron.dataflow.objectfifo.ObjectFifoHandle.join (   self,
list[int]  offsets,
PlacementTile   placement = AnyMemTile,
list[int] | None   depths = None,
list[type[np.ndarray]]   obj_types = None,
list[str] | None   names = None,
list[list[Sequence[int] | None]] | None   dims_to_stream = None,
list[list[Sequence[int] | None]] | None   dims_from_stream = None,
bool   plio = False 
)
Construct multiple ObjectFifos which feed data into a ObjectFifoHandle.
Note that this function is only valid for producer ObjectFifoHandles.

Args:
    offsets (list[int]): Offsets into the current producer, each corresponding to a new consumer.
    placement (PlacementTile, optional): The placement where the Join operation occurs. Defaults to AnyMemTile.
    depths (list[int] | None, optional): The depth of each new ObjectFifo. Defaults to None.
    obj_types (list[type[np.ndarray]], optional): The type of the buffers corresponding to each new ObjectFifo. Defaults to None.
    names (list[str] | None, optional): The name of each new ObjectFifo. If not given, unique names will be generated. Defaults to None.
    dims_to_stream (list[list[Sequence[int]  |  None]] | None, optional): The dimensionsToStream to assign to each new ObjectFifo. Defaults to None.
    dims_from_stream (list[list[Sequence[int]  |  None]] | None, optional): The dimensionsFromStream to assign to each new ObjectFifo consumer. Defaults to None.
    plio (bool, optional): Set plio on each new ObjectFifo. Defaults to False.

Raises:
    ValueError: Arguments are validated

Returns:
    list[ObjectFifo]: A list of newly constructed ObjectFifos whose consumers are used in this join() operation.

◆ name()

str iron.dataflow.objectfifo.ObjectFifoHandle.name (   self)
The name of the ObjectFifo

◆ obj_type()

type[np.ndarray] iron.dataflow.objectfifo.ObjectFifoHandle.obj_type (   self)
The per-buffer type of the ObjectFifo

◆ op()

ObjectFifoCreateOp iron.dataflow.objectfifo.ObjectFifoHandle.op (   self)

◆ release()

None iron.dataflow.objectfifo.ObjectFifoHandle.release (   self,
int  num_elem 
)
Release access to some elements of the ObjectFifo. This the other endpoint of the ObjectFifo to acquire them.

Args:
    num_elem (int): Number of elements to release.

Raises:
    ValueError: Number of elements cannot exceed ObjectFifo depth.

◆ resolve()

None iron.dataflow.objectfifo.ObjectFifoHandle.resolve (   cls,
ir.Location | None   loc = None,
ir.InsertionPoint | None   ip = None 
)
Resolve the current object into one or more MLIR operations.
Should only be called within an MLIR context.

Args:
    loc (ir.Location | None, optional): Location is used by MLIR object during construction in some cases. Defaults to None.
    ip (ir.InsertionPoint | None, optional): InsertionPoint is used by MLIR object during construction in some cases. Defaults to None.

Reimplemented from iron.resolvable.Resolvable.

◆ shape()

Sequence[int] iron.dataflow.objectfifo.ObjectFifoHandle.shape (   self)
The per-buffer shape of the ObjectFifo

◆ split()

list[ObjectFifo] iron.dataflow.objectfifo.ObjectFifoHandle.split (   self,
list[int]  offsets,
PlacementTile   placement = AnyMemTile,
list[int] | None   depths = None,
list[type[np.ndarray]]   obj_types = None,
list[str] | None   names = None,
list[list[Sequence[int]]] | None   dims_to_stream = None,
list[list[Sequence[int]]] | None   dims_from_stream = None,
bool   plio = False 
)
Split the data from an ObjectFifoConsumer handle by sending it to producers in N newly constructed ObjectFifos.
Note this operation is only valid for ObjectFifoHandles of type consumer.

Args:
    offsets (list[int]): The offset into the current consumer for each new ObjectFifo producer.
    placement (PlacementTile, optional): The placement tile where the Split operation takes place. Defaults to AnyMemTile.
    depths (list[int] | None, optional): The depth of each new ObjectFifo. Defaults to None.
    obj_types (list[type[np.ndarray]], optional): The buffer type of each new ObjectFifo. Defaults to None.
    names (list[str] | None, optional): The name of each new ObjectFifo. If not given, a unique name will be generated. Defaults to None.
    dims_to_stream (list[list[Sequence[int]]] | None, optional): The dimensions to stream for each new ObjectFifo. Defaults to None.
    dims_from_stream (list[list[Sequence[int]]] | None, optional): The dimensions from stream for each new ObjectFifo. Defaults to None.
    plio (bool, optional): Set plio on each new ObjectFifo. Defaults to False.

Raises:
    ValueError: Arguments are validated.

Returns:
    list[ObjectFifo]: A list of newly constructed ObjectFifos whose producers are used in this split() operation.

Member Data Documentation

◆ _depth

iron.dataflow.objectfifo.ObjectFifoHandle._depth
private

◆ _dims_from_stream

iron.dataflow.objectfifo.ObjectFifoHandle._dims_from_stream
private

◆ _endpoint

iron.dataflow.objectfifo.ObjectFifoHandle._endpoint
private

◆ _is_prod

iron.dataflow.objectfifo.ObjectFifoHandle._is_prod
private

◆ _object_fifo

iron.dataflow.objectfifo.ObjectFifoHandle._object_fifo
private

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