asc.experimental.asctile.static_assert
- asc.experimental.asctile.static_assert(test: Any, message: str | None = None) None
Check a condition during JIT compilation on the host.
If the condition is false, raises
AssertionErrorand aborts compilation.- Parameters:
test – Condition to check (must be a compile-time value, not an IR value).
message – Optional error message for the exception.
Note
Always runs during compilation, regardless of the
debugoption. The built-inassertstatement does NOT dispatch to this function — it dispatches todevice_assert()instead. Use this function explicitly for compile-time checks.Examples
Validate a tile size constant at compile time:
@asctile.jit def kernel(TILE: asc.ConstExpr[int]): asctile.static_assert(TILE % 16 == 0, "TILE must be a multiple of 16")