tl.load reads values from global memory using pointer expressions. Adding a vector of offsets to a base pointer forms addresses for a block of elements in one call; loaded values arrive in on-chip registers for computation. section 2.2.7
x = tl.load(x_ptr + offsets, mask=mask)
A masked vector load uses the same offsets to select elements and to avoid out-of-bounds accesses. section 2.2.7
Use a mask to handle partial blocks safely:
- Mark valid indices so loads skip positions outside the array, such as the tail of the final vector block. section 2.4
- For incomplete matrix tiles, masked input values need an explicit other=0.0 when they feed tl.dot; otherwise, their values are undefined. section 5.8.1
Vector addition
Each Triton program adds its offsets to the input base pointers, loads its slice of both vectors with a mask, and computes the corresponding output values. section 2.2.7
