Skip to content

Commit f64d1eb

Browse files
Update docs
1 parent 5dfe71b commit f64d1eb

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

_sources/autoapi/tilelang/language/allocate/index.rst.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,24 @@ Module Contents
8585
:rtype: T.Buffer
8686

8787

88-
.. py:function:: alloc_var(dtype, scope='local.var')
88+
.. py:function:: alloc_var(dtype, *args, scope='local.var', init = None)
8989
9090
Allocate a single-element variable buffer.
9191

9292
:param dtype: The data type of the buffer (e.g., 'float32', 'int32')
9393
:type dtype: str
94-
:param scope: The memory scope. Defaults to "local.var"
94+
:param \*args: Optional positional arguments. A single positional string is treated
95+
as the scope for backward compatibility. A single non-string positional
96+
argument (or keyword ``init``) specifies the initializer. When two
97+
positional arguments are provided, they are interpreted as
98+
``(init, scope)``.
99+
:param scope: The memory scope. Defaults to "local.var".
100+
Use as keyword argument for clarity when also providing an initializer.
95101
:type scope: str, optional
102+
:param init: The optional initializer value. When provided,
103+
the generated code will initialize the variable with this value instead
104+
of defaulting to zero.
105+
:type init: PrimExpr, optional
96106

97107
:returns: A TVM buffer object allocated as a single-element variable
98108
:rtype: T.Buffer

autoapi/tilelang/language/allocate/index.html

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ <h2>Functions<a class="headerlink" href="#functions" title="Link to this heading
510510
<tr class="row-odd"><td><p><a class="reference internal" href="#tilelang.language.allocate.alloc_fragment" title="tilelang.language.allocate.alloc_fragment"><code class="xref py py-obj docutils literal notranslate"><span class="pre">alloc_fragment</span></code></a>(shape, dtype[, scope])</p></td>
511511
<td><p>Allocate a fragment memory buffer for specialized operations.</p></td>
512512
</tr>
513-
<tr class="row-even"><td><p><a class="reference internal" href="#tilelang.language.allocate.alloc_var" title="tilelang.language.allocate.alloc_var"><code class="xref py py-obj docutils literal notranslate"><span class="pre">alloc_var</span></code></a>(dtype[, scope])</p></td>
513+
<tr class="row-even"><td><p><a class="reference internal" href="#tilelang.language.allocate.alloc_var" title="tilelang.language.allocate.alloc_var"><code class="xref py py-obj docutils literal notranslate"><span class="pre">alloc_var</span></code></a>(dtype, *args[, scope, init])</p></td>
514514
<td><p>Allocate a single-element variable buffer.</p></td>
515515
</tr>
516516
<tr class="row-odd"><td><p><a class="reference internal" href="#tilelang.language.allocate.alloc_barrier" title="tilelang.language.allocate.alloc_barrier"><code class="xref py py-obj docutils literal notranslate"><span class="pre">alloc_barrier</span></code></a>(arrive_count)</p></td>
@@ -596,13 +596,22 @@ <h2>Module Contents<a class="headerlink" href="#module-contents" title="Link to
596596

597597
<dl class="py function">
598598
<dt class="sig sig-object py" id="tilelang.language.allocate.alloc_var">
599-
<span class="sig-prename descclassname"><span class="pre">tilelang.language.allocate.</span></span><span class="sig-name descname"><span class="pre">alloc_var</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dtype</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scope</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'local.var'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tilelang.language.allocate.alloc_var" title="Link to this definition"></a></dt>
599+
<span class="sig-prename descclassname"><span class="pre">tilelang.language.allocate.</span></span><span class="sig-name descname"><span class="pre">alloc_var</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dtype</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">scope</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'local.var'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">init</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tilelang.language.allocate.alloc_var" title="Link to this definition"></a></dt>
600600
<dd><p>Allocate a single-element variable buffer.</p>
601601
<dl class="field-list simple">
602602
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
603603
<dd class="field-odd"><ul class="simple">
604604
<li><p><strong>dtype</strong> (<em>str</em>) – The data type of the buffer (e.g., ‘float32’, ‘int32’)</p></li>
605-
<li><p><strong>scope</strong> (<em>str</em><em>, </em><em>optional</em>) – The memory scope. Defaults to “local.var”</p></li>
605+
<li><p><strong>*args</strong> – Optional positional arguments. A single positional string is treated
606+
as the scope for backward compatibility. A single non-string positional
607+
argument (or keyword <code class="docutils literal notranslate"><span class="pre">init</span></code>) specifies the initializer. When two
608+
positional arguments are provided, they are interpreted as
609+
<code class="docutils literal notranslate"><span class="pre">(init,</span> <span class="pre">scope)</span></code>.</p></li>
610+
<li><p><strong>scope</strong> (<em>str</em><em>, </em><em>optional</em>) – The memory scope. Defaults to “local.var”.
611+
Use as keyword argument for clarity when also providing an initializer.</p></li>
612+
<li><p><strong>init</strong> (<em>PrimExpr</em><em>, </em><em>optional</em>) – The optional initializer value. When provided,
613+
the generated code will initialize the variable with this value instead
614+
of defaulting to zero.</p></li>
606615
</ul>
607616
</dd>
608617
<dt class="field-even">Returns<span class="colon">:</span></dt>

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)