Skip to content

Commit b89c348

Browse files
Update docs
1 parent fa22f61 commit b89c348

File tree

5 files changed

+34
-4
lines changed

5 files changed

+34
-4
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ tilelang.language.print
66
.. autoapi-nested-parse::
77

88
This module provides macros and utilities for debugging TileLang (tl) programs.
9-
It includes functionality to print variables, print values in buffers, and conditionally execute debug prints.
9+
It includes functionality to print variables, print values in buffers, conditionally execute debug prints and assert.
1010

1111

1212

@@ -21,6 +21,7 @@ Functions
2121
tilelang.language.print.print_shared_buffer_with_condition
2222
tilelang.language.print.print_fragment_buffer_with_condition
2323
tilelang.language.print.print_local_buffer_with_condition
24+
tilelang.language.print.device_assert
2425
tilelang.language.print.print
2526

2627

@@ -101,6 +102,13 @@ Module Contents
101102
:rtype: tir.PrimExpr
102103

103104

105+
.. py:function:: device_assert(condition, msg = '')
106+
107+
Device-side assert emulation.
108+
Emits a device-side assert call on CUDA targets when CUDA is available.
109+
The assert is always enabled and cannot be disabled at runtime.
110+
111+
104112
.. py:function:: print(obj, msg = '', warp_group_id = 0, warp_id = 0)
105113
106114
A generic print function that handles both TIR buffers and primitive expressions.

autoapi/tilelang/language/print/index.html

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@
482482
<section id="module-tilelang.language.print">
483483
<span id="tilelang-language-print"></span><h1>tilelang.language.print<a class="headerlink" href="#module-tilelang.language.print" title="Link to this heading"></a></h1>
484484
<p>This module provides macros and utilities for debugging TileLang (tl) programs.
485-
It includes functionality to print variables, print values in buffers, and conditionally execute debug prints.</p>
485+
It includes functionality to print variables, print values in buffers, conditionally execute debug prints and assert.</p>
486486
<section id="functions">
487487
<h2>Functions<a class="headerlink" href="#functions" title="Link to this heading"></a></h2>
488488
<div class="table-wrapper autosummary longtable docutils container">
@@ -506,7 +506,10 @@ <h2>Functions<a class="headerlink" href="#functions" title="Link to this heading
506506
<tr class="row-even"><td><p><a class="reference internal" href="#tilelang.language.print.print_local_buffer_with_condition" title="tilelang.language.print.print_local_buffer_with_condition"><code class="xref py py-obj docutils literal notranslate"><span class="pre">print_local_buffer_with_condition</span></code></a>(condition, buffer, elems)</p></td>
507507
<td><p>Conditionally prints the values of a flattened TIR buffer if the condition is True.</p></td>
508508
</tr>
509-
<tr class="row-odd"><td><p><a class="reference internal" href="#tilelang.language.print.print" title="tilelang.language.print.print"><code class="xref py py-obj docutils literal notranslate"><span class="pre">print</span></code></a>(obj[, msg, warp_group_id, warp_id])</p></td>
509+
<tr class="row-odd"><td><p><a class="reference internal" href="#tilelang.language.print.device_assert" title="tilelang.language.print.device_assert"><code class="xref py py-obj docutils literal notranslate"><span class="pre">device_assert</span></code></a>(condition[, msg])</p></td>
510+
<td><p>Device-side assert emulation.</p></td>
511+
</tr>
512+
<tr class="row-even"><td><p><a class="reference internal" href="#tilelang.language.print.print" title="tilelang.language.print.print"><code class="xref py py-obj docutils literal notranslate"><span class="pre">print</span></code></a>(obj[, msg, warp_group_id, warp_id])</p></td>
510513
<td><p>A generic print function that handles both TIR buffers and primitive expressions.</p></td>
511514
</tr>
512515
</tbody>
@@ -641,6 +644,22 @@ <h2>Module Contents<a class="headerlink" href="#module-contents" title="Link to
641644
</dl>
642645
</dd></dl>
643646

647+
<dl class="py function">
648+
<dt class="sig sig-object py" id="tilelang.language.print.device_assert">
649+
<span class="sig-prename descclassname"><span class="pre">tilelang.language.print.</span></span><span class="sig-name descname"><span class="pre">device_assert</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">condition</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">msg</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tilelang.language.print.device_assert" title="Link to this definition"></a></dt>
650+
<dd><p>Device-side assert emulation.
651+
Emits a device-side assert call on CUDA targets when CUDA is available.
652+
The assert is always enabled and cannot be disabled at runtime.</p>
653+
<dl class="field-list simple">
654+
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
655+
<dd class="field-odd"><ul class="simple">
656+
<li><p><strong>condition</strong> (<em>tvm.tir.PrimExpr</em>)</p></li>
657+
<li><p><strong>msg</strong> (<em>str</em>)</p></li>
658+
</ul>
659+
</dd>
660+
</dl>
661+
</dd></dl>
662+
644663
<dl class="py function">
645664
<dt class="sig sig-object py" id="tilelang.language.print.print">
646665
<span class="sig-prename descclassname"><span class="pre">tilelang.language.print.</span></span><span class="sig-name descname"><span class="pre">print</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">obj</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">msg</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">warp_group_id</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">warp_id</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tilelang.language.print.print" title="Link to this definition"></a></dt>
@@ -738,6 +757,7 @@ <h2>Module Contents<a class="headerlink" href="#module-contents" title="Link to
738757
<li><a class="reference internal" href="#tilelang.language.print.print_shared_buffer_with_condition"><code class="docutils literal notranslate"><span class="pre">print_shared_buffer_with_condition()</span></code></a></li>
739758
<li><a class="reference internal" href="#tilelang.language.print.print_fragment_buffer_with_condition"><code class="docutils literal notranslate"><span class="pre">print_fragment_buffer_with_condition()</span></code></a></li>
740759
<li><a class="reference internal" href="#tilelang.language.print.print_local_buffer_with_condition"><code class="docutils literal notranslate"><span class="pre">print_local_buffer_with_condition()</span></code></a></li>
760+
<li><a class="reference internal" href="#tilelang.language.print.device_assert"><code class="docutils literal notranslate"><span class="pre">device_assert()</span></code></a></li>
741761
<li><a class="reference internal" href="#tilelang.language.print.print"><code class="docutils literal notranslate"><span class="pre">print()</span></code></a></li>
742762
</ul>
743763
</li>

genindex.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,6 +1600,8 @@ <h2>D</h2>
16001600
<li><a href="autoapi/tilelang/tools/Analyzer/index.html#tilelang.tools.Analyzer.Analyzer.device">(tilelang.tools.Analyzer.Analyzer attribute)</a>
16011601
</li>
16021602
</ul></li>
1603+
<li><a href="autoapi/tilelang/language/print/index.html#tilelang.language.print.device_assert">device_assert() (in module tilelang.language.print)</a>
1604+
</li>
16031605
<li><a href="autoapi/tilelang/engine/lower/index.html#tilelang.engine.lower.device_codegen">device_codegen() (in module tilelang.engine.lower)</a>
16041606
</li>
16051607
<li><a href="autoapi/tilelang/engine/lower/index.html#tilelang.engine.lower.device_codegen_without_compile">device_codegen_without_compile() (in module tilelang.engine.lower)</a>

objects.inv

7 Bytes
Binary file not shown.

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)