coder.loop.vectorize
R2026bDescription
coder.loop.vectorize( prompts the code
generator to transform the loopID)for-loop with index name
loopID into vectorized operations in the generated code. To use this
directive, you must enable the SIMD instruction set for your target hardware. See
Leverage target hardware
instruction set extensions.
Using this directive can improve the performance of the generated code by processing multiple data elements per instruction. This directive works best for element-wise, independent operations that have relatively simple loop bodies. For more information about loop optimizations, see Optimize Loops in Generated Code.
Examples
Input Arguments
Limitations
To use the coder.loop.vectorize directive, you must enable the SIMD instruction set for your target hardware. See Leverage target hardware instruction set extensions.
Tips
To view potential issues that the code generator encounters when applying the
coder.loop.vectorizedirective, review the Code Insights section of the code generation report. See Code Generation Reports.
Extended Capabilities
Version History
Introduced in R2023a