Create a buffer declaration node. When ``data`` is provided, creates a DeclBuffer (alias to existing data). When ``data`` is None, creates an AllocBuffer (new allocation). Parameters ---------- shape : Union[List[PrimExpr], Tuple[PrimExpr], PrimExpr, Integral] The type
(
shape,
dtype="float32",
data=None,
strides=None,
elem_offset=None,
byte_offset=None,
scope="global",
align=0,
offset_factor=0,
buffer_type="",
axis_separators=None,
layout="default",
allocated_addr=None,
)
| 1733 | |
| 1734 | |
| 1735 | def decl_buffer( |
| 1736 | shape, |
| 1737 | dtype="float32", |
| 1738 | data=None, |
| 1739 | strides=None, |
| 1740 | elem_offset=None, |
| 1741 | byte_offset=None, |
| 1742 | scope="global", |
| 1743 | align=0, |
| 1744 | offset_factor=0, |
| 1745 | buffer_type="", |
| 1746 | axis_separators=None, |
| 1747 | layout="default", |
| 1748 | allocated_addr=None, |
| 1749 | ) -> Buffer: |
| 1750 | """Create a buffer declaration node. |
| 1751 | |
| 1752 | When ``data`` is provided, creates a DeclBuffer (alias to existing data). |
| 1753 | When ``data`` is None, creates an AllocBuffer (new allocation). |
| 1754 | |
| 1755 | Parameters |
| 1756 | ---------- |
| 1757 | shape : Union[List[PrimExpr], Tuple[PrimExpr], PrimExpr, Integral] |
| 1758 | The type of the buffer prior to flattening. |
| 1759 | |
| 1760 | dtype : str |
| 1761 | The data type in the content of the buffer. |
| 1762 | |
| 1763 | data : Var |
| 1764 | The pointer to the head of the data. |
| 1765 | |
| 1766 | strides : List[PrimExpr] |
| 1767 | The strides of each dimension. |
| 1768 | |
| 1769 | elem_offset : PrimExpr |
| 1770 | The offset in terms of number of dtype elements (including lanes). |
| 1771 | |
| 1772 | byte_offset : PrimExpr |
| 1773 | The offset in terms of number of bytes. |
| 1774 | |
| 1775 | scope : str |
| 1776 | The optional storage scope of buffer data pointer. |
| 1777 | |
| 1778 | align : int |
| 1779 | The alignment requirement of data pointer in bytes. |
| 1780 | |
| 1781 | offset_factor : int |
| 1782 | The factor of elem_offset field. |
| 1783 | |
| 1784 | buffer_type : str |
| 1785 | The buffer type. |
| 1786 | |
| 1787 | axis_separators : List[int] |
| 1788 | The separators between input axes when generating flattened output axes. |
| 1789 | |
| 1790 | layout : Layout |
| 1791 | The layout of the buffer. |
| 1792 |
no test coverage detected
searching dependent graphs…