IRON 1.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes | List of all members
iron.globalbuffer.GlobalBuffer Class Reference
Inheritance diagram for iron.globalbuffer.GlobalBuffer:
Inheritance graph
[legend]
Collaboration diagram for iron.globalbuffer.GlobalBuffer:
Collaboration graph
[legend]

Public Member Functions

 __init__ (self, type[np.ndarray]|None type=None, np.ndarray|None initial_value=None, str|None name=None, PlacementTile|None placement=None, bool use_write_rtp=False)
 
Sequence[int] shape (self)
 
np.dtype dtype (self)
 
 __getitem__ (self, idx)
 
 __setitem__ (self, idx, source)
 
None resolve (self, ir.Location|None loc=None, ir.InsertionPoint|None ip=None)
 
- Public Member Functions inherited from iron.placeable.Placeable
None place (self, Tile tile)
 
PlacementTile|None tile (self)
 

Protected Attributes

 _initial_value
 
 _name
 
 _op
 
 _arr_type
 
 _use_write_rtp
 
 _obj_type
 
- Protected Attributes inherited from iron.placeable.Placeable
 _tile
 

Private Member Functions

int __get_index (cls)
 

Static Private Attributes

int __gbuf_index = 0
 

Detailed Description

A buffer that is available both to Workers and to the Runtime for operations.
This is often used for Runtime Parameters.
This is used to generate unique names if none is given during construction

Constructor & Destructor Documentation

◆ __init__()

iron.globalbuffer.GlobalBuffer.__init__ (   self,
type[np.ndarray] | None   type = None,
np.ndarray | None   initial_value = None,
str | None   name = None,
PlacementTile | None   placement = None,
bool   use_write_rtp = False 
)
A GlobalBuffer is a memory region declared at the top-level of the design, allowing it to
be accessed by both Workers and the Runtime.

Args:
    type (type[np.ndarray] | None, optional): The type of the buffer. Defaults to None.
    initial_value (np.ndarray | None, optional): An initial value to set the buffer to. Should be of same datatype and shape as the buffer. Defaults to None.
    name (str | None, optional): The name of the buffer. If none is given, a unique name will be generated. Defaults to None.
    placement (PlacementTile | None, optional): A placement location for the buffer. Defaults to None.
    use_write_rtp (bool, optional): If use_write_rtp, write_rtp/read_rtp operations will be generated. Otherwise, traditional write/read operations will be used. Defaults to False.

Raises:
    ValueError: Arguments are validated.

Reimplemented from iron.placeable.Placeable.

Member Function Documentation

◆ __get_index()

int iron.globalbuffer.GlobalBuffer.__get_index (   cls)
private

◆ __getitem__()

iron.globalbuffer.GlobalBuffer.__getitem__ (   self,
  idx 
)

◆ __setitem__()

iron.globalbuffer.GlobalBuffer.__setitem__ (   self,
  idx,
  source 
)

◆ dtype()

np.dtype iron.globalbuffer.GlobalBuffer.dtype (   self)
The per-element datatype of the buffer.

◆ resolve()

None iron.globalbuffer.GlobalBuffer.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.globalbuffer.GlobalBuffer.shape (   self)
The shape of the buffer

Member Data Documentation

◆ __gbuf_index

int iron.globalbuffer.GlobalBuffer.__gbuf_index = 0
staticprivate

◆ _arr_type

iron.globalbuffer.GlobalBuffer._arr_type
protected

◆ _initial_value

iron.globalbuffer.GlobalBuffer._initial_value
protected

◆ _name

iron.globalbuffer.GlobalBuffer._name
protected

◆ _obj_type

iron.globalbuffer.GlobalBuffer._obj_type
protected

◆ _op

iron.globalbuffer.GlobalBuffer._op
protected

◆ _use_write_rtp

iron.globalbuffer.GlobalBuffer._use_write_rtp
protected

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