mirror of
https://github.com/ROCm/ROCm.git
synced 2026-04-05 03:01:17 -04:00
Note that `tl.device_print` and `print` accepts different arguments than
the normal `print`. The first argument must be a string, following by
variables.
Device side:
- `tl.device_print`
- `tl.device_assert`
- `print`
- `assert`
Compilation time:
- `tl.static_assert`
- `tl.static_print`
Usage example:
1.
```Python
tl.device_assert(x == 0, "x != 0")
```
Output:
```Python
...
python/test/unit/language/assert_helper.py:18: kernel: block: [0,0,0], thread: [33,0,0] Assertion `x != 0` failed.
...
```
2.
```Python
tl.device_print("hello ", x)
```
Output:
```Python
...
hello 1
...
```
The environment variable `TRITON_DEBUG` sets the default debugging flag; if it's true, `tl.device_assert` or `assert` will be skipped.