`tl.constexpr` marks a Triton kernel parameter as a compile-time constant. Triton interprets the annotation during compilation and specializes generated code for its supplied value. For `BLOCK_SIZE`, this lets the compiler lay out loads, address arithmetic, and stores for a fixed chunk size. By contrast, marking a changing vector length as `tl.constexpr` would create redundant compiled variants, so `n_elements` remains a runtime argument. section 2.2.2
def add_kernel(
x_ptr, y_ptr, z_ptr,
n_elements,
BLOCK_SIZE: tl.constexpr,
):
Kernel signature showing `BLOCK_SIZE` annotated with `tl.constexpr` and `n_elements` left as a runtime parameter. section 2.2.2
