asc.experimental.asctile.device_assert
- asc.experimental.asctile.device_assert(test: Any, message: str | None = None) None
Check a condition during kernel execution on the device.
If the condition is false, prints an error message with source location and stops execution.
- Parameters:
test – Condition to check (boolean, comparison, or value convertible to bool).
message – Optional error message to include in the report.
Note
Only active when
debug=Trueis set in the JIT decorator. The built-inassertstatement dispatches to this function inside JIT kernels.Examples
Assert that the block index is non-negative:
@asctile.jit(debug=True) def kernel(): asctile.device_assert(asctile.block_idx() >= 0, "block_idx must be non-negative")