tl.arange(0, n) creates local integer positions from 0 to n − 1. Add a block’s starting offset to turn them into global array positions for memory access. section 2.2.5
Shift local positions
If a block starts at 128, tl.arange(0, 4) produces [0, 1, 2, 3]; adding 128 gives the global positions [128, 129, 130, 131]. section 2.2.5
In a pairwise feature calculation, local_idx = tl.arange(0, BLOCK_SIZE) supplies pair indices. A mask such as local_idx < half_dim limits work when the block is larger than the number of pairs. section 3.5.3
Figure 2.6 Each program computes its global offsets by adding its block start position to the local indices inside the block. block_start and tl.arange combine to produce the exact positions this program will read and write.
Shows how local indices combine with a block start to produce global offsets. section 2.2.5
