IRON dda37d5934b525fc5832d3d5e94037a8931956aa
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Member Functions | Static Private Attributes | List of all members
iron.buffer.Buffer Class Reference
Inheritance diagram for iron.buffer.Buffer:
Inheritance graph
[legend]
Collaboration diagram for iron.buffer.Buffer:
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)
 
 op (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
 
- 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.

Constructor & Destructor Documentation

◆ __init__()

iron.buffer.Buffer.__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 Buffer 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: If neither ``type`` nor ``initial_value`` is provided.

Reimplemented from iron.placeable.Placeable.

Member Function Documentation

◆ __get_index()

int iron.buffer.Buffer.__get_index (   cls)
private

◆ __getitem__()

iron.buffer.Buffer.__getitem__ (   self,
  idx 
)

◆ __setitem__()

iron.buffer.Buffer.__setitem__ (   self,
  idx,
  source 
)

◆ dtype()

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

◆ op()

iron.buffer.Buffer.op (   self)

◆ resolve()

None iron.buffer.Buffer.resolve (   self,
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.buffer.Buffer.shape (   self)
The shape of the buffer

Member Data Documentation

◆ __gbuf_index

int iron.buffer.Buffer.__gbuf_index = 0
staticprivate

◆ _arr_type

iron.buffer.Buffer._arr_type
protected

◆ _initial_value

iron.buffer.Buffer._initial_value
protected

◆ _name

iron.buffer.Buffer._name
protected

◆ _op

iron.buffer.Buffer._op
protected

◆ _use_write_rtp

iron.buffer.Buffer._use_write_rtp
protected

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