coder.loop.tile
R2026bDescription
coder.loop.tile(
directs the code generator to apply loop tiling to the loop with index
loopID,tileSize,tiledLoopId)loopID in the generated code and partitions the iteration space into
smaller blocks of size tileSize. This directive introduces an outer tiled
loop and an inner loop that retains the original loop index loopID. Use
the optional tiledLoopId to add additional loop-control directives to the
tiled loop.
Use this directive with nested loops that operate on large data sets that have regular array access patterns and independent iterations. To improve data reuse and memory access, choose a tile size that fits in the cache. This directive provides less benefit if the data already fits in the cache or if the added loop overhead outweighs its benefits. For more information about loop optimizations, see Optimize Loops in Generated Code.
Examples
Input Arguments
Tips
To view potential issues that the code generator encounters when applying the
coder.loop.tiledirective, review the Code Insights section of the code generation report. See Code Generation Reports.
Extended Capabilities
Version History
Introduced in R2023a