For a vector of n_elements, with each Triton program processing BLOCK_SIZE entries, triton.cdiv(n_elements, BLOCK_SIZE) gives the number of programs needed. Ceiling division includes a final program when the vector length is not an exact multiple of the block size. section 2.2.8 section 3.1.2
grid = lambda meta: (
triton.cdiv(n_elements, meta['BLOCK_SIZE']),
)
A one-dimensional launch grid can compute its size from n_elements and the resolved BLOCK_SIZE. section 2.2.8
