asc2.block_num

asc2.block_num() PlainValue

Returns the total number of blocks (NPU cores) allocated for the kernel.

This function returns the total number of NPU blocks that are executing the kernel, which was specified when launching the kernel.

Returns:

The total number of blocks

Return type:

PlainValue

Examples

Use block count to compute a stride across blocks:

idx = asc2.block_idx()
n_blocks = asc2.block_num()
stride = n_blocks * TILE_SIZE