Python type annotations normally store metadata without affecting execution. Triton interprets `tl.constexpr` annotations during compilation, treating the supplied value as fixed for that kernel binary and specializing its generated code. section 2.2.2
def add_kernel(
x_ptr, y_ptr, z_ptr,
n_elements,
BLOCK_SIZE: tl.constexpr,
):
The signature marks `BLOCK_SIZE` for compile-time specialization while leaving `n_elements` as a runtime argument. section 2.2.2





















